module-menu-vue 0.0.31 → 0.0.32

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,6 +1,6 @@
1
1
  {
2
2
  "name": "module-menu-vue",
3
- "version": "0.0.31",
3
+ "version": "0.0.32",
4
4
  "description": "城市大数据平台菜单--Vue版",
5
5
  "main": "/index.js",
6
6
  "scripts": {
@@ -5,15 +5,7 @@ import { checkToken} from './permessionUtils';
5
5
 
6
6
  let tokenValue = '574536b1-5832-417b-b909-82e204679d67';
7
7
 
8
- const service = axios.create({
9
- timeout: 20000,
10
- headers: {
11
- 'X-Requested-With': 'XMLHttpRequest',
12
- 'Content-Type': 'application/json; charset=UTF-8'
13
- },
14
- })
15
-
16
- service.interceptors.response.use(
8
+ axios.interceptors.response.use(
17
9
  (response) => {
18
10
  if (response.status === 200) {
19
11
  return response;
@@ -47,7 +39,7 @@ service.interceptors.response.use(
47
39
  );
48
40
 
49
41
  /** 全局请求拦截器 */
50
- service.interceptors.request.use(
42
+ axios.interceptors.request.use(
51
43
  async (params) => {
52
44
  // 多种环境,对接门户时,需要在请求头中设置token等信息
53
45
  const environmentList = ['production', 'development', 'test']
@@ -95,9 +87,11 @@ function Axios(method, api, params, map) {
95
87
  return new Promise((resolve, reject) => {
96
88
  axios(httpDefult)
97
89
  .then((res) => {
90
+ console.log('res', res)
98
91
  resolve(res);
99
92
  })
100
93
  .catch((err) => {
94
+ console.log('err', err)
101
95
  reject(err);
102
96
  });
103
97
  })
@@ -1,10 +1,14 @@
1
1
  const address = window.location.hostname
2
2
  const port = window.location.port
3
- const baseCof = process.env.NODE_ENV === 'production' ?{
4
- baseSever: `https://${address}:${port}`,
5
- basePath: `/app/cmcc/data`,
6
- }:{
7
- baseSever: 'http://localhost:8000',
3
+ const baseCof =
4
+ process.env.NODE_ENV === 'production' ?
5
+ {
6
+ baseSever: `https://${address}:${port}`,
7
+ basePath: `/app/cmcc/data`,
8
+ }
9
+ :
10
+ {
11
+ baseSever: 'http://localhost:8080',
8
12
  basePath: '/cmcc/data',
9
13
  };
10
14
  export default baseCof;