Commit 4fa516c1 by 匡雅琴

http修改

1 parent 9704a903
...@@ -3,23 +3,20 @@ import { Toast } from 'vant'; ...@@ -3,23 +3,20 @@ import { Toast } from 'vant';
import router from '../router' import router from '../router'
import qs from 'qs' import qs from 'qs'
import { createSign } from './util' import { createSign } from './util'
const sign = {
v: '1.0.0', const options: any = localStorage.getItem('config')
format: 'json', interface Config {
source: 'vite-integral', response: object,
appKey: '48e5e13229b82c1b4e6e8c96151f0637' request: {
} baseURL: string
const secret = 'c24619ed7fef02a0ae16328146bca5f97cc6493957a2137b' },
const response = { secret: string,
data_key: 'data', sign: object,
message_key: 'message', vconsole: boolean
code_key: 'code',
code_success_value: '0',
errId_logout_value: '10039',
logout_function: 'reLogin',
code_message_map: {}
} }
// const { response = {}, request = {}, headers = {}, alert, sign, signWay = 'sha1', secret } = options const config: Config = JSON.parse(options)
const { response, request, sign, secret } = config
axios.defaults.baseURL = request.baseURL
// 配置新建一个axios 实例 // 配置新建一个axios 实例
const service: AxiosInstance = axios.create({ const service: AxiosInstance = axios.create({
timeout: 50000, timeout: 50000,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!