| | |
| | | import { Session } from '@/util/storage'; |
| | | import {message} from "ant-design-vue"; |
| | | import { loginOut } from "@/api/login"; |
| | | import JSONBig from 'json-bigint'; |
| | | //用来拦截用的 |
| | | axios.defaults.headers.post["Content-Type"] = "application/json;charset=utf-8"; |
| | | //创建一个单例 |
| | |
| | | const http= axios.create({ |
| | | baseURL: baseUrl, |
| | | timeout: 50000,//响应时间 |
| | | transformResponse: [ |
| | | function (data) { |
| | | // 对 data 进行任意转换处理 |
| | | try { |
| | | return JSONBig.parse(data) |
| | | } catch (err) { |
| | | return data |
| | | } |
| | | } |
| | | ] |
| | | // headers:{"Content-Type":"application/json;charset=utf-8"}, |
| | | }) |
| | | |