| | |
| | | // 封装网络请求 |
| | | import axios from "axios"; |
| | | import { Message } from "element-ui"; |
| | | export const baseUrl = process.env.VUE_APP_API_URL; |
| | | // 创建请求实例 |
| | | const req = axios.create({ |
| | | // baseURL: '/api' |
| | | // baseURL: '/account/verification' |
| | | baseURL: "http://icmm.test.xyinde.com/api", |
| | | baseURL: baseUrl, |
| | | timeout: 10000 |
| | | }); |
| | | |
| | |
| | | (config) => { |
| | | // 携带token参数,一般会加载header Authorization |
| | | config.headers.Authorization = localStorage.getItem("access_token"); |
| | | config.headers.token = localStorage.getItem("access_token"); |
| | | return config; |
| | | }, |
| | | (error) => { |