feat: display version number #386

This commit is contained in:
chenos 2022-05-20 13:00:06 +08:00
parent e596e6d365
commit 14ad04a8b2
2 changed files with 4 additions and 0 deletions

View File

@ -1,6 +1,7 @@
import { getUmiConfig, resolveNocobasePackagesAlias } from '@nocobase/devtools/umiConfig';
import { defineConfig } from 'umi';
const packageJson = require('./package.json');
const umiConfig = getUmiConfig();
process.env.MFSU_AD = 'none';
@ -9,6 +10,7 @@ export default defineConfig({
hash: true,
define: {
'process.env.APP_ENV': process.env.APP_ENV,
'process.env.VERSION': packageJson?.devDependencies?.['@nocobase/client'],
...umiConfig.define,
},
// only proxy when using `umi dev`

View File

@ -26,6 +26,8 @@ export const CurrentUser = () => {
}}
overlay={
<Menu>
<Menu.Item disabled>Version {process.env.VERSION}</Menu.Item>
<Menu.Divider />
<EditProfile />
<ChangePassword />
<SwitchRole />