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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "mooho-base-admin-plus",
3
3
  "description": "MOOHO basic framework for admin by Vue3",
4
- "version": "0.1.31",
4
+ "version": "0.1.34",
5
5
  "author": "jinyifan <jinyifan@mooho.com.cn>",
6
6
  "dotnetVersion": "1.3.97",
7
7
  "license": "MIT",
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.VUE_APP_BASE_PATH;
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 = process.env.NODE_ENV === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
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;
@@ -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 的) 目录。
package/vite.config.js CHANGED
@@ -6,6 +6,7 @@ import Setting from './test/setting.env';
6
6
  // https://vitejs.dev/config/
7
7
  export default defineConfig({
8
8
  plugins: [vue()],
9
+ base: Setting.publicPath,
9
10
  target: 'es2015',
10
11
  build: {
11
12
  sourcemap: false, // 输出.map文件