mooho-base-admin-plus 0.1.38 → 0.1.41
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/dist/mooho-base-admin-plus.min.js +10 -10
- package/package.json +1 -1
- package/src/libs/request/index.js +5 -4
- package/src/mixins/page.js +2 -2
- package/src/plugins/error/index.js +1 -1
- package/src/router/index.js +1 -1
- package/src/setting.js +2 -10
- package/test/main.js +2 -1
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ function errorLog(err) {
|
|
|
25
25
|
}
|
|
26
26
|
});
|
|
27
27
|
// 打印到控制台
|
|
28
|
-
if (
|
|
28
|
+
if (window.$mode === 'development') {
|
|
29
29
|
util.log.error('>>>>>> Error >>>>>>');
|
|
30
30
|
console.log(err);
|
|
31
31
|
}
|
|
@@ -39,11 +39,9 @@ function errorLog(err) {
|
|
|
39
39
|
});
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
//axios.defaults.baseURL = 'aaa';
|
|
43
|
-
|
|
44
42
|
// 创建一个 axios 实例
|
|
45
43
|
const service = axios.create({
|
|
46
|
-
baseURL: Setting.apiBaseURL
|
|
44
|
+
//baseURL: import.meta.env.MODE === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd
|
|
47
45
|
// timeout: 5000 // 请求超时时间
|
|
48
46
|
});
|
|
49
47
|
|
|
@@ -52,6 +50,9 @@ service.interceptors.request.use(
|
|
|
52
50
|
config => {
|
|
53
51
|
store.commit('admin/loader/start');
|
|
54
52
|
|
|
53
|
+
let baseURL = window.$mode === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
|
|
54
|
+
config.url = baseURL + config.url;
|
|
55
|
+
|
|
55
56
|
// 在请求发送之前做一些处理
|
|
56
57
|
const token = util.cookies.get('token');
|
|
57
58
|
// 让每个请求携带token-- ['X-Token']为自定义key 请根据实际情况自行修改
|
package/src/mixins/page.js
CHANGED
|
@@ -82,10 +82,10 @@ export default {
|
|
|
82
82
|
return Setting.layout;
|
|
83
83
|
},
|
|
84
84
|
apiBaseURL() {
|
|
85
|
-
return Setting.apiBaseURL;
|
|
85
|
+
return window.$env.MODE === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
|
|
86
86
|
},
|
|
87
87
|
uploadURL() {
|
|
88
|
-
return
|
|
88
|
+
return this.apiBaseURL + 'api/Attachment/add';
|
|
89
89
|
},
|
|
90
90
|
uploadHeaders() {
|
|
91
91
|
const token = util.cookies.get('token');
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
// 只在开发模式下打印 log
|
|
19
|
-
if (
|
|
19
|
+
if (window.$mode === 'development') {
|
|
20
20
|
util.log.capsule('Admin Plus', 'ErrorHandler', 'error');
|
|
21
21
|
util.log.error('>>>>>> 错误信息 >>>>>>');
|
|
22
22
|
console.log(info);
|
package/src/router/index.js
CHANGED
package/src/setting.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Admin Plus 业务配置
|
|
3
3
|
* */
|
|
4
4
|
|
|
5
|
-
const env = import.meta.env.MODE;
|
|
6
5
|
const basePath = import.meta.env.VITE_APP_BASE_PATH;
|
|
7
6
|
|
|
8
7
|
const Setting = {
|
|
@@ -109,11 +108,11 @@ const Setting = {
|
|
|
109
108
|
// 全局面包屑是否显示图标,开启 showBreadcrumb 时有效
|
|
110
109
|
showBreadcrumbIcon: false,
|
|
111
110
|
// 是否显示日志入口,开启与否,不影响日志记录,如不希望用户看到可关闭
|
|
112
|
-
showLog:
|
|
111
|
+
showLog: false,
|
|
113
112
|
// 是否显示多语言
|
|
114
113
|
showI18n: false,
|
|
115
114
|
// 是否支持动态修改布局配置,移动端下会自动强制关闭
|
|
116
|
-
enableSetting:
|
|
115
|
+
enableSetting: false,
|
|
117
116
|
// 退出登录时,是否二次确认
|
|
118
117
|
logoutConfirm: true,
|
|
119
118
|
// 是否根据操作系统缩放比例,自动调整比例
|
|
@@ -196,11 +195,4 @@ if (localSetting) {
|
|
|
196
195
|
copyTo(localSetting, Setting);
|
|
197
196
|
}
|
|
198
197
|
|
|
199
|
-
console.log('import.meta.env', import.meta.env);
|
|
200
|
-
|
|
201
|
-
// API地址
|
|
202
|
-
Setting.apiBaseURL = import.meta.env.MODE === 'development' ? Setting.apiBaseURL.dev : Setting.apiBaseURL.prd;
|
|
203
|
-
|
|
204
|
-
console.log('Setting.apiBaseURL', Setting.apiBaseURL, import.meta.env.MODE);
|
|
205
|
-
|
|
206
198
|
export default Setting;
|
package/test/main.js
CHANGED