| | |
| | | // 封装网络请求 |
| | | import axios from "axios"; |
| | | import { Message } from "element-ui"; |
| | | export const baseUrl = "http://icmm.test.xyinde.com/api"; |
| | | export const baseUrl = process.env.VUE_APP_API_URL; |
| | | // 创建请求实例 |
| | | const req = axios.create({ |
| | | // baseURL: '/api' |
| | |
| | | res.data.errorText == "需要验证身份" && |
| | | res.data.errorCode == "11" |
| | | ) { |
| | | console.log("token过期了"); |
| | | Message.error(res.data.errorText || ""); |
| | | // 清楚token |
| | | uni.getStorageSync("access_token"); |
| | | uni.clearStorageSync(); |
| | | uni.showToast({ |
| | | title: "请重新登录", |
| | | icon: "none" |
| | | }); |
| | | uni.reLaunch({ |
| | | url: "/pages/Login/Login" |
| | | }); |