module-menu-vue 0.0.38 → 0.0.40
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,10 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "module-menu-vue",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.40",
|
|
4
4
|
"description": "城市大数据平台菜单--Vue版",
|
|
5
5
|
"main": "/index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"dev": "vue-cli-service serve",
|
|
8
7
|
"serve": "vue-cli-service serve",
|
|
9
8
|
"build": "vue-cli-service build",
|
|
10
9
|
"lint": "vue-cli-service lint"
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import axios from 'axios';
|
|
2
|
-
import baseCof from './config';
|
|
3
2
|
import getStore from './userInfo';
|
|
4
3
|
import { checkToken } from './permessionUtils';
|
|
5
4
|
let tokenValue = '574536b1-5832-417b-b909-82e204679d67';
|
|
@@ -8,6 +7,7 @@ axios.interceptors.response.use(
|
|
|
8
7
|
if (response.status === 200) {
|
|
9
8
|
return response;
|
|
10
9
|
} else if (response.status === 401 || response.status === 302 || response.status === 403) {
|
|
10
|
+
console.log('response env: ', process.env.NODE_ENV)
|
|
11
11
|
if (process.env.NODE_ENV === 'production') {
|
|
12
12
|
tokenValue = getStore({ name: 'access_token' });
|
|
13
13
|
}
|
|
@@ -21,6 +21,7 @@ axios.interceptors.response.use(
|
|
|
21
21
|
console.log('error', error)
|
|
22
22
|
if (error.response) {
|
|
23
23
|
if (error.response.status === 401) {
|
|
24
|
+
console.log('response error env: ', process.env.NODE_ENV)
|
|
24
25
|
if (process.env.NODE_ENV === 'production') {
|
|
25
26
|
tokenValue = getStore({ name: 'access_token' });
|
|
26
27
|
}
|
|
@@ -41,7 +42,7 @@ axios.interceptors.request.use(
|
|
|
41
42
|
async (params) => {
|
|
42
43
|
// 多种环境,对接门户时,需要在请求头中设置token等信息
|
|
43
44
|
const environmentList = ['production', 'development', 'test']
|
|
44
|
-
console.log('env: ', process.env.NODE_ENV)
|
|
45
|
+
console.log('request env: ', process.env.NODE_ENV)
|
|
45
46
|
if (environmentList.includes(process.env.NODE_ENV)) {
|
|
46
47
|
console.log('环境进来了。。。')
|
|
47
48
|
const TENANT_ID = getStore({ name: 'tenantId' }) || '1';
|
|
@@ -57,10 +58,10 @@ axios.interceptors.request.use(
|
|
|
57
58
|
if (TENANT_ID) {
|
|
58
59
|
params.headers["TENANT-ID"] = TENANT_ID; // 租户ID
|
|
59
60
|
}
|
|
60
|
-
|
|
61
|
-
params.headers['Authorization'] = `Bearer ${tokenValue}`;
|
|
62
|
-
params.headers['TENANT-ID'] = '1';
|
|
61
|
+
return params;
|
|
63
62
|
}
|
|
63
|
+
params.headers['Authorization'] = `Bearer ${tokenValue}`;
|
|
64
|
+
params.headers['TENANT-ID'] = '1';
|
|
64
65
|
console.log('params', JSON.stringify(params))
|
|
65
66
|
return params;
|
|
66
67
|
},
|
|
@@ -70,18 +71,9 @@ axios.interceptors.request.use(
|
|
|
70
71
|
},
|
|
71
72
|
);
|
|
72
73
|
|
|
73
|
-
function Axios(
|
|
74
|
-
|
|
75
|
-
let httpDefult;
|
|
76
|
-
// 几个外部特殊接口
|
|
77
|
-
// 退出登录
|
|
78
|
-
httpDefult = {
|
|
79
|
-
method: method,
|
|
80
|
-
url: `${baseCof.baseSever}${url}`,
|
|
81
|
-
};
|
|
82
|
-
console.log('httpDefult', httpDefult)
|
|
74
|
+
function Axios(url) {
|
|
83
75
|
return new Promise((resolve, reject) => {
|
|
84
|
-
axios(
|
|
76
|
+
axios.delete(url)
|
|
85
77
|
.then((res) => {
|
|
86
78
|
console.log('res', res)
|
|
87
79
|
resolve(res);
|
package/vue.config.js
CHANGED
|
@@ -1,47 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const url = 'https://192.168.108.86:30011/'
|
|
6
|
-
module.exports = {
|
|
7
|
-
lintOnSave: true,
|
|
8
|
-
productionSourceMap: false,
|
|
9
|
-
css: {
|
|
10
|
-
// 忽略 CSS order 顺序警告
|
|
11
|
-
extract: { ignoreOrder: true },
|
|
12
|
-
// 查看CSS属于哪个css文件
|
|
13
|
-
sourceMap: process.env.NODE_ENV === "development",
|
|
14
|
-
},
|
|
15
|
-
configureWebpack: () => {
|
|
16
|
-
if (process.env.NODE_ENV === "production") {
|
|
17
|
-
// 仅在生产环境下启用该配置
|
|
18
|
-
return {
|
|
19
|
-
performance: {
|
|
20
|
-
// 打包后最大文件大小限制
|
|
21
|
-
maxAssetSize: 1024000,
|
|
22
|
-
},
|
|
23
|
-
};
|
|
24
|
-
} else if (process.env.NODE_ENV === "development") {
|
|
25
|
-
return {
|
|
26
|
-
devtool: "source-map",
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
// 配置转发代理
|
|
31
|
-
devServer: {
|
|
32
|
-
// disableHostCheck: true,
|
|
33
|
-
port: 8080,
|
|
34
|
-
proxy: {
|
|
35
|
-
"/": {
|
|
36
|
-
// target:' https://10.136.106.82:30011',
|
|
37
|
-
target: url,
|
|
38
|
-
ws: false, // 需要websocket 开启
|
|
39
|
-
// changOrigin: true, //允许跨域
|
|
40
|
-
pathRewrite: {
|
|
41
|
-
"^/": "/",
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
// 3.5 以后不需要再配置
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
1
|
+
const { defineConfig } = require('@vue/cli-service')
|
|
2
|
+
module.exports = defineConfig({
|
|
3
|
+
transpileDependencies: true
|
|
4
|
+
})
|