Commit a312b3380be47450c828aca03697f3d239109191
1 parent
a945302e
公用url
Showing
2 changed files
with
14 additions
and
3 deletions
src/api/httpRequest.js
1 | 1 | //引入axios |
2 | 2 | import axios from 'axios' |
3 | - | |
3 | +import qs from 'qs' | |
4 | 4 | let cancel ,promiseArr = {} |
5 | 5 | const CancelToken = axios.CancelToken; |
6 | 6 | //请求拦截器 // 在发送请求之前做些什么 |
7 | 7 | axios.interceptors.request.use(config => { |
8 | 8 | //发起请求时,取消掉当前正在进行的相同请求 |
9 | 9 | config.headers['x-auth-token'] = '5a706458-5a67-4297-a009-30fb82a2fa45' |
10 | + // if(config.method === 'post') { | |
11 | + // let data = qs.parse(config.data) | |
12 | + // | |
13 | + // config.data = qs.stringify({ | |
14 | + // sysCode: '1001' | |
15 | + // }) | |
16 | + // } else if(config.method === 'get') { | |
17 | + // config.params = { | |
18 | + // sysCode: '1001' | |
19 | + // } | |
20 | + // } | |
10 | 21 | return config |
11 | 22 | }, error => { |
12 | 23 | return Promise.reject(error) |
... | ... | @@ -68,7 +79,7 @@ axios.interceptors.response.use(response => { |
68 | 79 | }) |
69 | 80 | //基础url前缀 |
70 | 81 | //axios.defaults.baseURL = '/api' |
71 | -// axios.defaults.baseURL = 'http://10.0.2.31:8096/'; | |
82 | +axios.defaults.baseURL = 'http://39.98.54.240:8093/'; | |
72 | 83 | //设置默认请求头 |
73 | 84 | // axios.defaults.withCredentials=true;//让ajax携带cookie |
74 | 85 | ... | ... |
src/components/memberNum/index.vue
... | ... | @@ -38,7 +38,7 @@ |
38 | 38 | mounted() { |
39 | 39 | //会员总数 |
40 | 40 | this.memberNumTotal=this.formatNumToStr(); |
41 | - this.axios.post('http://39.98.54.240:8093/urban/intelligence/appuser/queryUserPersonStatistic', { | |
41 | + this.axios.post('urban/intelligence/appuser/queryUserPersonStatistic', { | |
42 | 42 | sysCode: '1001' |
43 | 43 | }).then((response)=>{ |
44 | 44 | console.log(response) | ... | ... |