This commit is contained in:
zoujiandong
2025-08-29 09:46:07 +08:00
parent cc0ddd0bc9
commit da6e4ae551
10 changed files with 1121 additions and 624 deletions
+18
View File
@@ -0,0 +1,18 @@
let DOC_URL=''
if(process.env.UNI_PLATFORM =="h5"){
if (window.location.href.indexOf('//casedata.igandan.com')>-1){
DOC_URL='https://doc.igandan.com/app/'
}else{
DOC_URL='https://dev-doc.igandan.com/app/'
}
}else if(process.env.UNI_PLATFORM =="mp-weixin"){
const { envVersion } = uni.getAccountInfoSync().miniProgram;
if (envVersion == "release") {
DOC_URL='https://app.igandan.com/app/'
}else{
DOC_URL='https://dev-doc.igandan.com/app/'
}
}else{
DOC_URL='https://dev-doc.igandan.com/app/'
}
export default DOC_URL
+32 -9
View File
@@ -40,31 +40,54 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
let defaultData={}
let freeList=['/manager/getSystemTimeStamp','/expertAPI/smsLogin','/login/mobile','/expertAPI/login','/expertAPI/index']
let postData={
...data
}
if(freeList.indexOf(url)!=-1){
if(freeList[4].indexOf(url)!=-1){
if(!token){
header['Authorization']='Bearer ' + ''
}else{
header['Authorization']='Bearer ' + token
header['Authorization']='Bearer ' + token;
let userInfo= uni.getStorageSync('userInfo')
defaultData = {
version: '4.0.0',
user_uuid:userInfo.uuid,
client_type: 'A', //client_type,
}
postData={
...data,
...defaultData
}
}
}
}else{
if(token){
header['Authorization']='Bearer ' +token
header['Authorization']='Bearer ' +token;
let userInfo= uni.getStorageSync('userInfo')
defaultData = {
version: '4.0.0',
user_uuid:userInfo.uuid,
client_type: 'A', //client_type,
}
defaultData = {
version: '4.0.0',
user_uuid:userInfo.uuid,
client_type: 'A', //client_type,
}
postData={
...data,
...defaultData
}
}
}
// defaultData = {
// version: '4.0.0',
// user_uuid: 'Rj3zuTY6zP6YTjHsYEz',
// client_type: 'A', //client_type,
// }
return new Promise(function(e, n) {
let timestamp = Date.now();
uni.request({
data: {...data},
data: {...data,...defaultData},
url: url.indexOf('http') != -1 ? url : encodeURI(BASE_URL + url),
method: method,
sslVerify: false,