Commit 707626ad by 胡悦

修复bug,以及配置config

1 parent 0a44d422
...@@ -17,7 +17,8 @@ components.forEach(component => app.use(component)); ...@@ -17,7 +17,8 @@ components.forEach(component => app.use(component));
app.component('svg-icon', SvgIcon) app.component('svg-icon', SvgIcon)
fetchConfig().then(res => { fetchConfig().then(res => {
axios.defaults.baseURL = res.request.baseURL // axios.defaults.baseURL = res.request.baseURL
localStorage.setItem('config', JSON.stringify(res))
}) })
// app.config.globalProperties.$axios = apis // app.config.globalProperties.$axios = apis
// setupStore(app) // setupStore(app)
......
...@@ -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: '21',
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,
......
...@@ -433,6 +433,11 @@ onBeforeMount(() => { ...@@ -433,6 +433,11 @@ onBeforeMount(() => {
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
margin-right: 4px; margin-right: 4px;
max-width: 130px;
display: inline-block;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
} }
.auth-status { .auth-status {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!