mirror of
https://github.com/verdaccio/verdaccio.git
synced 2025-01-20 22:52:46 -05:00
commit
e81d50162f
2 changed files with 16 additions and 6 deletions
|
@ -32,9 +32,8 @@ module.exports = function(config, auth, storage) {
|
|||
});
|
||||
});
|
||||
|
||||
router.get('/-/logo', function(req, res) {
|
||||
res.sendFile(_.get(config, 'web.logo') || `${env.APP_ROOT}/static/logo-sm.png`
|
||||
);
|
||||
router.get('/-/verdaccio/logo', function(req, res) {
|
||||
res.send(_.get(config, 'web.logo') || '/-/static/logo.png');
|
||||
});
|
||||
|
||||
router.get('/', function(req, res) {
|
||||
|
|
|
@ -10,13 +10,14 @@ import storage from '../../../utils/storage';
|
|||
|
||||
|
||||
import classes from './header.scss';
|
||||
import logo from './logo.png';
|
||||
import './logo.png';
|
||||
|
||||
export default class Header extends React.Component {
|
||||
state = {
|
||||
showLogin: false,
|
||||
username: '',
|
||||
password: ''
|
||||
password: '',
|
||||
logo: ''
|
||||
}
|
||||
|
||||
constructor(props) {
|
||||
|
@ -37,6 +38,16 @@ export default class Header extends React.Component {
|
|||
});
|
||||
}
|
||||
|
||||
componentWillMount() {
|
||||
API.get('logo')
|
||||
.then((response) => {
|
||||
this.setState({logo: response.data});
|
||||
})
|
||||
.catch((error) => {
|
||||
throw new Error(error);
|
||||
});
|
||||
}
|
||||
|
||||
async handleSubmit() {
|
||||
if (this.state.username === '' || this.state.password === '') {
|
||||
return MessageBox.alert('Username or password can\'t be empty!', '');
|
||||
|
@ -120,7 +131,7 @@ export default class Header extends React.Component {
|
|||
<header className={ classes.header }>
|
||||
<div className={ classes.headerWrap }>
|
||||
<Link to="/">
|
||||
<img src={ logo } className={ classes.logo } />
|
||||
<img src={ this.state.logo } className={ classes.logo } />
|
||||
</Link>
|
||||
<figure>
|
||||
npm set registry { location.origin }
|
||||
|
|
Loading…
Add table
Reference in a new issue