feat: the production environment can be dynamically configured

This commit is contained in:
nebv
2020-10-13 01:40:21 +08:00
parent e83cb06bb9
commit bb3b8f817d
29 changed files with 563 additions and 118 deletions

View File

@@ -1,12 +1,13 @@
import { isDevMode, getEnv } from '/@/utils/env';
import { useSetting } from '/@/hooks/core/useSetting';
import moment from 'moment';
import pkg from '../../../package.json';
const { globSetting } = useSetting();
// Generate cache key according to version
export const getStorageShortName = () => {
const shortTime = moment().format('MMDDHHmmss');
return `${globSetting.shortName}__${getEnv()}${
isDevMode() ? `__${(pkg as any).version}` : '__' + process.env.VITE_BUILD_SHORT_TIME
`__${pkg.version}` + (isDevMode() ? '' : `__${shortTime}`)
}__`.toUpperCase();
};