Skip to content

Commit ac65515

Browse files
authored
Merge pull request #143 from ts-react/v1
feat: 配置优化
2 parents 616ea0d + 759673e commit ac65515

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

config/config.ts

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import isString from 'lodash/isString';
21
import routes from './router.config';
32
import plugins from './plugin.config';
43
import themeConfig from './theme.config';
@@ -14,16 +13,11 @@ try {
1413
localServerConfig = require('./local-server.config.ts');
1514
} catch (error) {}
1615

17-
if (SERVER_ENV) {
16+
if (serverConfig[SERVER_ENV]) {
1817
BaseURL = serverConfig[SERVER_ENV];
18+
} else if (localServerConfig && localServerConfig.baseURL) {
19+
BaseURL = localServerConfig.baseURL;
1920
} else {
20-
BaseURL =
21-
localServerConfig && localServerConfig.baseURL
22-
? localServerConfig.baseURL
23-
: '';
24-
}
25-
26-
if (!BaseURL || !isString(BaseURL)) {
2721
BaseURL = serverConfig.localhost;
2822
}
2923

0 commit comments

Comments
 (0)