调节系统开发
This commit is contained in:
+8
-5
@@ -5,9 +5,11 @@ import errorCode from '@/utils/errorCode'
|
||||
import { toast, showConfirm, tansParams } from '@/utils/common'
|
||||
|
||||
let timeout = 10000
|
||||
const baseUrl = config.baseUrl
|
||||
|
||||
const request = config => {
|
||||
const baseUrlZC = config.baseUrlZC
|
||||
const baseUrlTJ = config.baseUrlTJ
|
||||
const request = config => {
|
||||
const sysType = uni.getStorageSync('sysType')
|
||||
|
||||
// 是否需要设置 token
|
||||
const isToken = (config.headers || {}).isToken === false
|
||||
config.header = config.header || {}
|
||||
@@ -20,11 +22,12 @@ const request = config => {
|
||||
url = url.slice(0, -1)
|
||||
config.url = url
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
const reqURL = sysType == 1 ? baseUrlZC : baseUrlTJ
|
||||
uni.request({
|
||||
method: config.method || 'get',
|
||||
timeout: config.timeout || timeout,
|
||||
url: config.baseUrl || baseUrl + config.url,
|
||||
url: config.baseUrl || reqURL + config.url,
|
||||
data: config.data,
|
||||
header: config.header,
|
||||
dataType: 'json'
|
||||
|
||||
Reference in New Issue
Block a user