From 3d1a4b4bf3d37e29a3d3345e00f9f84c0d7959a6 Mon Sep 17 00:00:00 2001 From: Mr.Shi <1878285526@qq.com> Date: 星期一, 21 八月 2023 09:16:05 +0800 Subject: [PATCH] 改bug --- h5_standard/src/utils/request.ts | 9 ++++++++- 1 files changed, 8 insertions(+), 1 deletions(-) diff --git a/h5_standard/src/utils/request.ts b/h5_standard/src/utils/request.ts index d51170a..3c4de61 100644 --- a/h5_standard/src/utils/request.ts +++ b/h5_standard/src/utils/request.ts @@ -1,5 +1,6 @@ import axios from 'axios'; import { Toast } from 'vant'; +import store from '@/store' import router from "@/router"; // 鍒涘缓涓�涓� axios 瀹炰緥 @@ -29,13 +30,19 @@ // 娣诲姞鍝嶅簲鎷︽埅鍣� service.interceptors.response.use( (response) => { + // loading.clear(); if (response.config.url?.indexOf('/lingyang/login') == -1 && response.config.url?.indexOf('/edgp/loginDemo') == -1 && response.config.url?.indexOf('/lingyang/loginDemo') == -1 && response.config.url?.indexOf('/edgp/login') == -1) { loading.clear(); } if (response.data.code === 401) { // 澶勭悊鐧诲綍杩囨湡 Toast.fail({ message: '鐧诲綍杩囨湡锛屽噯澶囪嚜鍔ㄩ噸鏂扮櫥褰�', duration: 2000, forbidClick: true }) setTimeout(() => { - router.push({ name: 'logInAgain' }) + if (store.state.env == 'DD') { + router.push({ name: 'logInAgain' }) + } else if (store.state.env == 'WX') { + let tempUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6ea339a336f26380&redirect_url=https://www.mes.red/h5/redirect.html&response_type=code&scope=snsapi_base&state=#wechat_redirect` + window.location.replace(tempUrl) + } }, 2000) return } -- Gitblit v1.9.3