diff --git a/web/package.json b/web/package.json index 47acea9..ddd757d 100644 --- a/web/package.json +++ b/web/package.json @@ -1,6 +1,6 @@ { "name": "next-terminal", - "version": "0.0.3", + "version": "0.0.4", "private": true, "dependencies": { "@ant-design/icons": "^4.3.0", diff --git a/web/src/App.js b/web/src/App.js index a98c700..2138eb2 100644 --- a/web/src/App.js +++ b/web/src/App.js @@ -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 { diff --git a/web/src/utils/utils.js b/web/src/utils/utils.js index fef15c2..f737ffd 100644 --- a/web/src/utils/utils.js +++ b/web/src/utils/utils.js @@ -144,6 +144,16 @@ export function differTime(start, end) { return show; } -export const isEmpty = (text) =>{ +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 + } +}