From f28a4a64c825b02e32e79387e0a6763e934ce51d Mon Sep 17 00:00:00 2001
From: 石广澎 <shiguangpeng@163.com>
Date: 星期一, 17 十一月 2025 16:01:09 +0800
Subject: [PATCH] feat(config): 更新生态圈API基础URL配置

---
 common/http.interceptor.js |   20 ++++++++++++++------
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/common/http.interceptor.js b/common/http.interceptor.js
index 2a35602..5371580 100644
--- a/common/http.interceptor.js
+++ b/common/http.interceptor.js
@@ -3,9 +3,6 @@
 	config,
 	DEBUG
 } from '@/common/config.js';
-import {
-	getPlat
-} from 'common/util.js';
 module.exports = (vm) => {
 	uni.$u.http.setConfig((x) => {
 		return x = {
@@ -16,7 +13,6 @@
 			timer: null,
 			loadingTime: 800, //澶氬皯绉掓棤杩斿洖鍐嶆樉绀簂oading
 			header: {
-				'Clientid': '944c6aade52ebbffc015478e6ce51b5a',
 				'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8',
 				'Access-Control-Allow-Origin': '*'
 			}
@@ -28,7 +24,9 @@
 		// 寮曠敤token
 		const TOKEN = uni.getStorageSync(ACCESSTOKEN);
 		if (TOKEN) {
-			x.header[ACCESSTOKEN] = 'Bearer ' + TOKEN;
+			x.header[ACCESSTOKEN] = TOKEN;
+		} else {
+			delete x.header[ACCESSTOKEN]
 		}
 		return x;
 	}, x => {
@@ -40,10 +38,20 @@
 		let res = x.data
 		if (res.code == 10000) {
 			return res.data;
+		} else if (res.code == 20002) {
+			const cid = uni.getStorageSync('CID')
+			uni.removeStorageSync(ACCESSTOKEN)
+			vm.$u.toast("鎺堟潈杩囨湡,璇烽噸鏂扮櫥褰�");
+			setTimeout(() => {
+				uni.reLaunch({
+					url: "/pages/pay/scanpay?cid=" + cid
+				})
+			}, 800);
+			return Promise.reject(res)
 		} else if (res.code == 10002) {
 			return Promise.reject(res)
 		} else {
-			vm.$u.toast(res.description || res.msg ||res.info || "璇锋眰寮傚父锛�"); //閿欒鎻愮ず淇℃伅
+			vm.$u.toast(res.description || "璇锋眰寮傚父锛�"); //閿欒鎻愮ず淇℃伅
 			return Promise.reject(res)
 		}
 	}, (response) => {

--
Gitblit v1.9.1