소스 검색

feat: process相关

year 11 시간 전
부모
커밋
2392578c1d
4개의 변경된 파일9개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      src/app/[locale]/(navbar)/vip/page.tsx
  2. 1 1
      src/app/[locale]/layout.tsx
  3. 2 0
      src/utils/client/axios.ts
  4. 4 0
      src/utils/server/index.ts

+ 2 - 2
src/app/[locale]/(navbar)/vip/page.tsx

@@ -186,7 +186,7 @@ const Page = () => {
                                 return (
                                     <div
                                         key={item.coin_type}
-                                        className="mt-[.06rem] text-[.18rem] font-black text-[var(--textColor4)]"
+                                        className="mt-[.06rem] text-[.18rem] font-black leading-[1] text-[var(--textColor4)]"
                                     >
                                         R$ {formatAmount(item.amount)}
                                     </div>
@@ -217,7 +217,7 @@ const Page = () => {
                                 return (
                                     <div
                                         key={item.coin_type}
-                                        className="mt-[.06rem] text-[.32rem] font-black text-[var(--textColor4)]"
+                                        className="mt-[.06rem] text-[.32rem] font-black leading-[1] text-[var(--textColor4)]"
                                     >
                                         {formatAmount(
                                             (item.amount || 0) * (curReward.current?.multiple || 0)

+ 1 - 1
src/app/[locale]/layout.tsx

@@ -92,7 +92,7 @@ export default async function LocaleLayout({
     const messages = await getMessages();
 
     return (
-        <html lang={locale} suppressHydrationWarning>
+        <html lang={locale} suppressHydrationWarning data-returnid={process.env.RENTER_ID}>
             <head>
                 <script defer={true} src={"/iconfont.js"} />
             </head>

+ 2 - 0
src/utils/client/axios.ts

@@ -76,6 +76,8 @@ export default class Request {
                     // header请求头添加token
                     config.headers["Token"] = getToken() || "";
                     config.headers["language"] = getCookies("language") || defaultLocale;
+                    config.headers["x-return-id"] =
+                        document?.querySelector("html")?.dataset?.returnid;
                     if (config && config?.toast) {
                         Toast.show({
                             icon: "loading",

+ 4 - 0
src/utils/server/index.ts

@@ -5,6 +5,10 @@ import { cookies } from "next/headers";
 import { ServerOptions } from "./type";
 
 const requestInterceptor = (options: ServerOptions) => {
+    if (!options.headers) {
+        options.headers = {};
+    }
+    options.headers["x-return-id"] = process.env.RENTER_ID;
     // 判断token
     if (options.checkToken) {
         const token = cookies().has("Token");