修改项目版本号从package.json中读取
This commit is contained in:
parent
cb1d7fd318
commit
fbac4c7c2b
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "next-terminal",
|
||||
"version": "0.0.3",
|
||||
"version": "0.0.4",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@ant-design/icons": "^4.3.0",
|
||||
|
@ -33,6 +33,7 @@ import request from "./common/request";
|
||||
import {message} from "antd/es";
|
||||
import Setting from "./components/setting/Setting";
|
||||
import BatchCommand from "./components/command/BatchCommand";
|
||||
import {NT_PACKAGE} from "./utils/utils";
|
||||
|
||||
const {Footer, Sider} = Layout;
|
||||
|
||||
@ -46,7 +47,8 @@ class App extends Component {
|
||||
openKeys: sessionStorage.getItem('openKeys') ? JSON.parse(sessionStorage.getItem('openKeys')) : [],
|
||||
user: {
|
||||
'nickname': '未定义'
|
||||
}
|
||||
},
|
||||
package: NT_PACKAGE()
|
||||
};
|
||||
|
||||
toggle = () => {
|
||||
@ -226,7 +228,7 @@ class App extends Component {
|
||||
<Route path="/setting" component={Setting}/>
|
||||
|
||||
<Footer style={{textAlign: 'center'}}>
|
||||
Next Terminal ©2020 dushixiang Version:0.0.4
|
||||
Next Terminal ©2021 dushixiang Version:{this.state.package['version']}
|
||||
</Footer>
|
||||
</Layout>
|
||||
|
||||
|
@ -147,3 +147,13 @@ export function differTime(start, end) {
|
||||
export const isEmpty = (text) => {
|
||||
return text === undefined || text == null || text.length === 0;
|
||||
}
|
||||
|
||||
export const NT_PACKAGE = () => {
|
||||
const _package = require("../../package.json");
|
||||
const name = _package.name;
|
||||
const version = _package.version;
|
||||
return {
|
||||
name: name,
|
||||
version: version
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user