1
This commit is contained in:
@@ -8,8 +8,11 @@ import qs from 'qs'
|
||||
axios.defaults.timeout = 10000 // 超时时间
|
||||
axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8' // 配置请求头
|
||||
|
||||
axios.defaults.baseURL = 'http://www.tougao.com/'
|
||||
|
||||
// axios.defaults.baseURL = '/'
|
||||
// axios.defaults.baseURL = 'http://testtougao.tmrjournals.com/public/index.php/'
|
||||
axios.defaults.baseURL = 'http://www.tougao.com/'
|
||||
|
||||
|
||||
// 添加响应拦截器,统一处理服务器响应和异常
|
||||
axios.interceptors.response.use(
|
||||
@@ -89,7 +92,7 @@ export default {
|
||||
*/
|
||||
get (url, params) {
|
||||
return new Promise((resolve, reject) => {
|
||||
axios.get(url, {params: param})
|
||||
axios.get(url, qs.stringify(params))
|
||||
.then(res => {
|
||||
resolve(res.data)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user