This commit is contained in:
zoujiandong
2025-06-17 14:47:08 +08:00
parent 42d8814157
commit a6dbc4692c
31 changed files with 36 additions and 35 deletions
+6 -5
View File
@@ -12,8 +12,8 @@ import BASE_URL from "./config.js";
//import {msg} from "./util.js"
import pageUrl from './pageUrl'
// #ifdef h5
import api from './api/api'
import cookie from './utils/cookie'
import api from '../api/api.js'
import cookie from './cookie.js'
// #endif
//const BASE_URL=host+"/api"
export const request = (url, data = {}, method = 'post', loading = false, contentType = 'application/x-www-form-urlencoded') => {
@@ -76,7 +76,7 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
sslVerify: false,
header: url.indexOf('/manager/getSignature4bing') == -1 ? header : {},
timeout: 10000,
success: async function (res) {
success: async(res)=>{
var Authorization_token = res.header.Authorization;
if (Authorization_token) {
if (process.env.NODE_ENV === 'development') {
@@ -94,11 +94,12 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
} else if (res.data.code == 401 || res.data.code == 403 || res.data.code == 405 || res.data.code == 406) {
if(process.env.UNI_PLATFORM =="h5"){
let video_token = cookie.readCookie('video_token');
alert(video_token)
if(video_token){
const res = await api.h5Login({
token: video_token
});
let result = res.data;
let result = res.data;
if (window.location.href.indexOf('//casedata.igandan.com')>-1) {
uni.setStorageSync("AUTH_TOKEN_CASEDATA",result.token);
} else {
@@ -113,7 +114,7 @@ export const request = (url, data = {}, method = 'post', loading = false, conten
});
window.location.reload();
}else{
let H5url = 'https://dev-wx.igandan.com';
let H5url = 'https://dev-wx.igandan.com';
if(window.location.href.indexOf('//dev-casedata.igandan.com') == -1) {
H5url = 'https://wx.igandan.com'
}