mooho-base-admin-plus 0.1.31 → 0.1.34
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env +4 -0
- package/.envpr +4 -0
- package/dist/mooho-base-admin-plus.min.js +10 -10
- package/package.json +1 -1
- package/src/setting.js +4 -2
- package/test/setting.env.js +7 -1
- package/vite.config.js +1 -0
package/package.json
CHANGED
package/src/setting.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* */
|
|
4
4
|
|
|
5
5
|
const env = import.meta.env.NODE_ENV;
|
|
6
|
-
const basePath = import.meta.env.
|
|
6
|
+
const basePath = import.meta.env.VITE_APP_BASE_PATH;
|
|
7
7
|
|
|
8
8
|
const Setting = {
|
|
9
9
|
/**
|
|
@@ -197,6 +197,8 @@ if (localSetting) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
// API地址
|
|
200
|
-
Setting.apiBaseURL =
|
|
200
|
+
Setting.apiBaseURL = import.meta.env.NODE_ENV === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
|
|
201
|
+
|
|
202
|
+
console.log('Setting.apiBaseURL', Setting.apiBaseURL, import.meta.env.NODE_ENV);
|
|
201
203
|
|
|
202
204
|
export default Setting;
|
package/test/setting.env.js
CHANGED
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Admin Plus 开发配置
|
|
3
3
|
* */
|
|
4
|
+
import { loadEnv } from 'vite';
|
|
5
|
+
|
|
6
|
+
let env = loadEnv(process.env.NODE_ENV, process.cwd());
|
|
7
|
+
|
|
8
|
+
const basePath = env.VITE_APP_BASE_PATH;
|
|
9
|
+
const path = basePath == '' || basePath == null ? '/' : '/' + basePath + '/';
|
|
4
10
|
|
|
5
11
|
const Setting = {
|
|
6
12
|
// 是否使用 Mock 的数据,默认 开发环境为 true,生产环境为 false
|
|
7
13
|
// isMock: false,
|
|
8
14
|
// 部署应用包时的基本 URL
|
|
9
|
-
publicPath:
|
|
15
|
+
publicPath: path,
|
|
10
16
|
// 生产环境构建文件的目录名
|
|
11
17
|
outputDir: 'dist',
|
|
12
18
|
// 放置生成的静态资源 (js、css、img、fonts) 的 (相对于 outputDir 的) 目录。
|