zzzz
2024-04-21 60739973cb024fb8902000251531e006e7988f23
src/request/httpAxios.js
@@ -3,11 +3,13 @@
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 = "https://api.usdtone.com/wap/";
// let baseUrl = "http://192.168.0.105:18080/wap/";
// 创建
@@ -25,6 +27,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 +50,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) => {