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