master
xingyy 9 months ago
parent 668a96a8ff
commit af55a106e3

@ -1,12 +1,10 @@
import {uniRequest} from "@/http/main"; import {uniRequest} from "@/http/main";
const TEST_URL='http://172.16.100.93:9052' const TEST_URL='http://172.16.100.93:9052'
export default uniRequest.created({ const uniReq=uniRequest.created({
baseUrl: TEST_URL, baseUrl: TEST_URL,
header: {
Authorization: uni.getStorageSync('token') ?? ''
},
interceptor: { interceptor: {
request(config){ request(config){
config.header.Authorization=uni.getStorageSync('token')??''
if (config.isLoading){ if (config.isLoading){
uni.showLoading({ uni.showLoading({
title: '加载中...', title: '加载中...',
@ -33,3 +31,4 @@ export default uniRequest.created({
} }
} }
}) })
export default uniReq

Loading…
Cancel
Save