From 25b2ba1cf86bc3439e7ad2acf2cd4a9ea7e4b0ed Mon Sep 17 00:00:00 2001
From: dcc <dcc@163.com>
Date: Fri, 28 Jun 2024 09:28:04 +0800
Subject: [PATCH] 123

---
 src/request/httpAxios.js |   18 +++++++++++++-----
 1 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/src/request/httpAxios.js b/src/request/httpAxios.js
index e4129a4..6a49b42 100644
--- a/src/request/httpAxios.js
+++ b/src/request/httpAxios.js
@@ -3,12 +3,16 @@
 import { Toast } from "vant";
 import i18n from "@/i18n";
 import router from "@/router/router";
+import urlKyc from "./urlKyc";
 import { signatureGenerate } from "@/utils/signatureUtil";
+import { getStorage } from "@/utils/utis";
 axios.defaults.headers.post["Content-Type"] =
   "application/x-www-form-urlencoded";
 
-// let baseUrl = "https://stock.niveshnav.com/wap/";
-let baseUrl = "http://192.168.0.105:18080/wap/";
+let baseUrl = "https://www.coinzne.com/wap/";
+// let baseUrl = "http://192.168.0.105:18080/wap/";
+// let baseUrl = "https://csjys.gayssad.com/wap/";
+// let baseUrl = "https://api.gayssad.com/wap/";
 
 // 创建
 const request = axios.create({
@@ -25,6 +29,10 @@
 // 拦截请求
 request.interceptors.request.use(
   (config) => {
+    const arr = urlKyc.filter((item) => item === config.url);
+    if (arr.length !== 0 && store.state.user.kyc !== 2) {
+      return Toast.fail(i18n.t("请先实名认证!"));
+    }
     if (config.loading) {
       Toast.loading({ duration: 0, forbidClick: true });
     }
@@ -44,6 +52,7 @@
     const { timestamp, signature } = signatureGenerate();
     if (timestamp) config.headers["tissuePaper"] = timestamp;
     if (signature) config.headers["sign"] = signature;
+    config.headers["lang"] = getStorage("lang") || "en";
     return config;
   },
   (error) => {
@@ -88,12 +97,11 @@
       default:
         if (msg != undefined) {
           Toast.fail({
-            // icon: 'none',
             message: i18n.t(msg),
           });
         }
-        //console.log('错误')
-        return Promise.reject(res.data);
+        console.log(res, "-----");
+        return Promise.resolve(res.data);
     }
   },
   (error) => {

--
Gitblit v1.9.3