提交
This commit is contained in:
@@ -19,8 +19,8 @@ let exports = {
|
||||
// baseUrl: 'http://10.160.0.5:8903', // 演示环境外网
|
||||
|
||||
// baseUrl: 'http://111.34.80.140:8081/prod-api', // 正式环境(不要轻易连接)
|
||||
|
||||
baseUrl: 'http://10.160.0.5:8907', // 正式环境在济南人才上部署(不要轻易连接)
|
||||
baseUrl: 'http://ks.zhaopinzao8dian.com/api/ks',
|
||||
zytpBaseUrl: 'http://ks.zhaopinzao8dian.com/api/ks',
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@ import { toast, showConfirm, tansParams } from '@/utilsRc/common'
|
||||
|
||||
let timeout = 10000
|
||||
const baseUrl = configRc.baseUrl
|
||||
const zytpBaseUrl = configRc.zytpBaseUrl || ''
|
||||
|
||||
const request = config => {
|
||||
// 是否需要设置 token
|
||||
@@ -22,20 +23,27 @@ const request = config => {
|
||||
}
|
||||
config.header['Authorization'] = 'Bearer ' + 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJsb2dpblR5cGUiOiJsb2dpbiIsImxvZ2luSWQiOiJzeXNfdXNlcjoxIiwicm5TdHIiOiJVMDRocERSZjdZMXJUbUxXb05uOUpzYUdDZzBNazJJQSIsInVzZXJJZCI6MX0.LZ29vvA4tK3b9Hki4nU9Jb1himXZM2AEOue3CMRY95w'
|
||||
// get请求映射params参数
|
||||
const baseType = config.baseUrlType
|
||||
const requestBaseUrl = baseType === 'zytp' && zytpBaseUrl ? zytpBaseUrl : baseUrl
|
||||
let requestUrl = config.fullUrl ? config.fullUrl : (requestBaseUrl + (config.url || ''))
|
||||
|
||||
if (config.params) {
|
||||
let url = config.url + '?' + tansParams(config.params)
|
||||
let url = tansParams(config.params)
|
||||
url = url.slice(0, -1)
|
||||
config.url = url
|
||||
if (url) {
|
||||
requestUrl += (requestUrl.includes('?') ? '&' : '?') + url
|
||||
}
|
||||
}
|
||||
return new Promise((resolve, reject) => {
|
||||
uni.request({
|
||||
method: config.method || 'get',
|
||||
timeout: config.timeout || timeout,
|
||||
url: baseUrl + config.url,
|
||||
url: requestUrl,
|
||||
// url: 'https://gccrcdh.sd-talent.cn:80/zhq' + config.url,
|
||||
data: config.data,
|
||||
header: config.header,
|
||||
dataType: 'json'
|
||||
dataType: 'json',
|
||||
responseType: config.responseType || 'text'
|
||||
}).then(response => {
|
||||
let res = response.data
|
||||
let error = response.errMsg!='request:ok'
|
||||
|
||||
Reference in New Issue
Block a user