|
@@ -3,7 +3,6 @@ import { Toast } from "antd-mobile";
|
|
|
import axios, { AxiosInstance, AxiosResponse, InternalAxiosRequestConfig } from "axios";
|
|
|
import type { AxiosOptions } from "./type";
|
|
|
|
|
|
-import { locales } from "@/i18n/routing";
|
|
|
import { getCookies, getToken } from "@/utils/Cookies";
|
|
|
|
|
|
interface CustomRequestConfig {
|
|
@@ -45,7 +44,8 @@ export default class Request {
|
|
|
config = requestInterceptor(config);
|
|
|
// header请求头添加token
|
|
|
config.headers["Token"] = getToken() || "";
|
|
|
- config.headers["language"] = getCookies("language") || locales.at(0);
|
|
|
+ config.headers["language"] =
|
|
|
+ getCookies("language") || getCookies("NEXT_LOCALE");
|
|
|
if (config && config?.toast) {
|
|
|
Toast.show({
|
|
|
icon: "loading",
|