From 5e4d6e65219d037e7eb1f9778832ebaf3bef471d Mon Sep 17 00:00:00 2001 From: john Date: Fri, 28 Jun 2024 20:13:46 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20feat:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.production | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.env.production b/.env.production index 1a41ab5..bde13ab 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,11 @@ ### # @LastEditors: John # @Date: 2024-06-26 15:04:10 - # @LastEditTime: 2024-06-27 20:18:39 + # @LastEditTime: 2024-06-28 20:10:03 # @Author: John ### -VITE_BASE_URL=https://node.yotta-network.com -VITE_BASE_API_URL=https://node.yotta-network.com/api +VITE_BASE_URL=https://nodeai.world +VITE_BASE_API_URL=https://nodeai.world/api VITE_PARTICIPATE_CHAIN_ID=56 VITE_PURCHASED_CONTRACT_ADDRESS=0x17c38AaF564716A3D9dD4EBE7Fb5db2D43c6A834 VITE_NETWORK_USDT_ADDRESS=0x55d398326f99059fF775485246999027B3197955 From daf5634a105e3df17958e5698957c7b941c4872d Mon Sep 17 00:00:00 2001 From: john Date: Mon, 1 Jul 2024 15:18:09 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E2=9C=A8=20feat:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新主题色 --- .env.production | 6 +-- public/favicon.svg | 2 +- src/App.css | 2 +- src/assets/logo.svg | 2 +- src/assets/nft_bg.svg | 2 +- src/components/Header.module.css | 10 ++-- src/components/Header.tsx | 4 +- src/components/WalletProvider.tsx | 2 +- src/pages/Home.module.css | 49 +++++++++---------- src/pages/Home.tsx | 8 +-- src/pages/Mint.module.css | 14 +++--- src/server/api.ts | 4 +- src/server/client.ts | 13 +++-- src/style/ant-cover-m.css | 22 ++++----- .../react-data-table-component-cover-m.css | 7 ++- src/utils/wallet.ts | 10 ++-- 16 files changed, 85 insertions(+), 72 deletions(-) diff --git a/.env.production b/.env.production index bde13ab..e3d1f55 100644 --- a/.env.production +++ b/.env.production @@ -1,11 +1,11 @@ ### # @LastEditors: John # @Date: 2024-06-26 15:04:10 - # @LastEditTime: 2024-06-28 20:10:03 + # @LastEditTime: 2024-07-01 15:13:11 # @Author: John ### -VITE_BASE_URL=https://nodeai.world -VITE_BASE_API_URL=https://nodeai.world/api +VITE_BASE_URL=https://www.nodeai.world +VITE_BASE_API_URL=https://www.nodeai.world/api VITE_PARTICIPATE_CHAIN_ID=56 VITE_PURCHASED_CONTRACT_ADDRESS=0x17c38AaF564716A3D9dD4EBE7Fb5db2D43c6A834 VITE_NETWORK_USDT_ADDRESS=0x55d398326f99059fF775485246999027B3197955 diff --git a/public/favicon.svg b/public/favicon.svg index 080cf7f..474cfa7 100644 --- a/public/favicon.svg +++ b/public/favicon.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/App.css b/src/App.css index da8b319..30bc8ee 100644 --- a/src/App.css +++ b/src/App.css @@ -3,7 +3,7 @@ html, #root { width: 100%; height: 100%; - background: url("./assets/home_bg.png"); + background: #fafafb; } @font-face { diff --git a/src/assets/logo.svg b/src/assets/logo.svg index 080cf7f..474cfa7 100644 --- a/src/assets/logo.svg +++ b/src/assets/logo.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/assets/nft_bg.svg b/src/assets/nft_bg.svg index b9ace89..519bc35 100644 --- a/src/assets/nft_bg.svg +++ b/src/assets/nft_bg.svg @@ -1 +1 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/src/components/Header.module.css b/src/components/Header.module.css index 3449260..d1d1936 100644 --- a/src/components/Header.module.css +++ b/src/components/Header.module.css @@ -1,17 +1,17 @@ /* * @LastEditors: John * @Date: 2024-06-18 15:19:21 - * @LastEditTime: 2024-06-18 18:49:40 + * @LastEditTime: 2024-07-01 14:10:45 * @Author: John */ .header { - background-color: #101010; + background-color: #fafafb; padding: 0 15px; .header_top { display: flex; align-items: center; gap: 8px; - border-bottom: 0.25px solid #333333; + border-bottom: 1px solid #d8d8d8; padding: 10px 0; .header_logo { @@ -30,7 +30,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -57,7 +57,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } diff --git a/src/components/Header.tsx b/src/components/Header.tsx index 4ef53e3..19dfba6 100644 --- a/src/components/Header.tsx +++ b/src/components/Header.tsx @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-18 15:16:31 - * @LastEditTime: 2024-06-27 15:29:00 + * @LastEditTime: 2024-07-01 14:10:57 * @Author: John */ import Picker, { @@ -70,7 +70,7 @@ export default function () { {navTitle} diff --git a/src/components/WalletProvider.tsx b/src/components/WalletProvider.tsx index 24803bb..19135ab 100644 --- a/src/components/WalletProvider.tsx +++ b/src/components/WalletProvider.tsx @@ -61,7 +61,7 @@ createWeb3Modal({ wagmiConfig: config, projectId, themeVariables: { - "--w3m-accent": "#2dfcfc", + "--w3m-accent": "#EA6D28", }, featuredWalletIds: [ ...(window.ethereum diff --git a/src/pages/Home.module.css b/src/pages/Home.module.css index e5bb8a1..22f4107 100644 --- a/src/pages/Home.module.css +++ b/src/pages/Home.module.css @@ -14,10 +14,8 @@ border-radius: 16px; opacity: 1; - background: #171719; - - box-shadow: 0px 4px 10px 0px rgba(45, 252, 252, 0.3), - inset 0px 0px 8px 0px #2dfcfc; + background: #ffffff; + box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2); padding: 14px 15px; box-sizing: border-box; @@ -57,7 +55,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; } @@ -117,10 +115,9 @@ border-radius: 10px; opacity: 1; - background: #2dfcfc; + background: #ea6d28; box-sizing: border-box; - border: 1px solid; padding: 0 20px; @@ -153,7 +150,7 @@ border-radius: 16px; opacity: 1; - background: #212123; + background: #eeeeef; display: flex; flex-direction: column; @@ -173,7 +170,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; @@ -193,7 +190,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -210,7 +207,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -245,7 +242,7 @@ border-radius: 10px; opacity: 1; - background: #2dfcfc; + background: #ea6d28; color: #101010; } @@ -260,7 +257,8 @@ border-radius: 16px; opacity: 1; - background: #171719; + background: #ffffff; + box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2); z-index: 1; .nftToken_content_nft { /* 自动布局 */ @@ -286,7 +284,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; } @@ -303,7 +301,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #2dfcfc; + color: #ea6d28; z-index: 0; @@ -335,7 +333,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 2; } @@ -536,7 +534,7 @@ justify-content: center; align-items: center; padding: 10px 0; - background: #2dfcfc; + background: #ea6d28; z-index: 0; gap: 10px; box-sizing: border-box; @@ -574,7 +572,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -600,7 +598,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; } } } @@ -625,7 +623,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; } @@ -641,7 +639,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #2dfcfc; + color: #ea6d28; z-index: 0; @@ -657,7 +655,8 @@ border-radius: 16px; opacity: 1; - background: #171719; + background: #ffffff; + box-shadow: 0px 2px 8px 0px rgba(99, 99, 99, 0.2); display: flex; flex-direction: column; @@ -680,7 +679,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #333333; z-index: 0; } @@ -697,7 +696,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #eaeaea; + color: #666666; z-index: 1; } @@ -720,7 +719,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 2d5db22..3fe18dc 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -118,7 +118,7 @@ export default function () { }} name="tuichu" className={classes.userinfo_top_right_wallet_disconnect} - color={"#fff"} + color={"#000000"} />
@@ -200,7 +200,7 @@ export default function () { {t("Buy Node")}
@@ -262,7 +262,7 @@ export default function () { {t("邀请列表")}{" "} )} @@ -282,7 +282,7 @@ export default function () { }} className={classes.invite_content_icon} name="fuzhi" - color={"#fff"} + color={"#000000"} />{" "} ) : ( diff --git a/src/pages/Mint.module.css b/src/pages/Mint.module.css index 6638966..1830402 100644 --- a/src/pages/Mint.module.css +++ b/src/pages/Mint.module.css @@ -11,7 +11,7 @@ height: 190px; border-radius: 10px; opacity: 1; - background: #171719; + background: #ffffff; box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.16), 0px 3px 6px 0px rgba(0, 0, 0, 0.23); padding: 8px; @@ -95,7 +95,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #9e9e9e; + color: #333333; z-index: 0; } @@ -137,7 +137,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; } @@ -154,7 +154,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -178,7 +178,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 0; } @@ -194,7 +194,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; z-index: 1; } @@ -215,7 +215,7 @@ padding: 11px 40px; gap: 10px; - background: #2dfcfc; + background: #ea6d28; z-index: 3; diff --git a/src/server/api.ts b/src/server/api.ts index 95576ce..df01e13 100644 --- a/src/server/api.ts +++ b/src/server/api.ts @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-18 10:28:21 - * @LastEditTime: 2024-06-27 09:52:45 + * @LastEditTime: 2024-07-01 11:55:38 * @Author: John */ import { GET, POST } from "./client"; @@ -54,7 +54,7 @@ export function api_signUp() { chainType: 2; }, any - >({ url: "/api/account/signUp", requiresToken: false }); + >({ url: "/api/account/signUp", requiresToken: false, catchErr: true }); } // 获取钱包签名串 diff --git a/src/server/client.ts b/src/server/client.ts index 739dcee..5a8fea1 100644 --- a/src/server/client.ts +++ b/src/server/client.ts @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-18 10:09:21 - * @LastEditTime: 2024-06-21 14:47:26 + * @LastEditTime: 2024-07-01 11:38:43 * @Author: John */ import { Client } from "@hyper-fetch/core"; @@ -17,9 +17,11 @@ import i18next from "i18next"; function initClient({ requiresToken, requiresAddress, + catchErr, }: { requiresToken: boolean; requiresAddress: boolean; + catchErr: boolean; }) { return new Client({ url: import.meta.env.VITE_BASE_API_URL }) .onAuth(async (req) => { @@ -59,6 +61,7 @@ function initClient({ const resData: BASE_RESPONSE = res.data; if (resData.code !== 200 && resData.code !== 0) { if (resData.msg) Toast.show({ content: resData.msg, icon: "fail" }); + if (catchErr) return res; throw new Error(resData.msg || "client on response error"); } return res; @@ -69,12 +72,14 @@ export const POST =

({ url, requiresToken = true, requiresAddress = true, + catchErr = false, }: { url: string; requiresToken?: boolean; requiresAddress?: boolean; + catchErr?: boolean; }) => { - return initClient({ requiresToken, requiresAddress }).createRequest< + return initClient({ requiresToken, requiresAddress, catchErr }).createRequest< BASE_RESPONSE, P, any, @@ -89,12 +94,14 @@ export const GET =

({ url, requiresToken = true, requiresAddress = true, + catchErr = false, }: { url: string; requiresToken?: boolean; requiresAddress?: boolean; + catchErr?: boolean; }) => { - return initClient({ requiresToken, requiresAddress }).createRequest< + return initClient({ requiresToken, requiresAddress, catchErr }).createRequest< BASE_RESPONSE, any, any, diff --git a/src/style/ant-cover-m.css b/src/style/ant-cover-m.css index fa8a2f0..a1e1170 100644 --- a/src/style/ant-cover-m.css +++ b/src/style/ant-cover-m.css @@ -3,7 +3,7 @@ border-bottom: 0.25px solid #333333; .adm-tabs-tab-line { - background-color: #2dfcfc; + background-color: #ea6d28; } .adm-tabs-tab { @@ -51,7 +51,7 @@ opacity: 1; box-sizing: border-box; - border: 1px solid #2dfcfc; + border: 1px solid #ea6d28; z-index: 1; background-color: transparent; @@ -80,7 +80,7 @@ border-radius: 8px; opacity: 1; - background: #2dfcfc; + background: #ea6d28; z-index: 0; @@ -192,7 +192,7 @@ /* background: rgba(252, 135, 43, 0.5) !important; */ box-sizing: border-box !important; - border: 1px solid #2dfcfc !important; + border: 1px solid #ea6d28 !important; /* backdrop-filter: blur(10px); */ @@ -263,16 +263,16 @@ height: 42px; border-radius: 5px !important; opacity: 1; - background: rgba(37, 33, 39, 0.2); + background: rgba(204, 184, 214, 0.2); box-sizing: border-box !important; - border: 1px solid #2dfcfc !important; + border: 1px solid #ea6d28 !important; .adm-button { width: 42px; height: 42px; border-radius: 5px; opacity: 1; - background: #2dfcfc; + background: #ea6d28; svg { width: 23px; @@ -296,7 +296,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; } } } @@ -305,7 +305,7 @@ .adm-dialog { .adm-center-popup-body { box-sizing: border-box !important; - border: 1px solid #2dfcfc !important; + border: 1px solid #ea6d28 !important; border-radius: 10px !important; background-color: transparent !important; backdrop-filter: blur(10px); @@ -328,11 +328,11 @@ .adm-dialog-footer { .adm-dialog-action-row { - border-top: 1px solid #2dfcfc !important; + border-top: 1px solid #ea6d28 !important; .adm-dialog-button { span { - color: #2dfcfc; + color: #ea6d28; } } } diff --git a/src/style/react-data-table-component-cover-m.css b/src/style/react-data-table-component-cover-m.css index c3281b5..1b7216b 100644 --- a/src/style/react-data-table-component-cover-m.css +++ b/src/style/react-data-table-component-cover-m.css @@ -11,6 +11,7 @@ height: 16px !important; min-height: 16px !important; background-color: transparent !important; + border-bottom: none; .rdt_TableCol { div { @@ -24,7 +25,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #eaeaea; + color: #333333; } } } @@ -37,6 +38,8 @@ height: 18px !important; min-height: 18px !important; background-color: transparent !important; + border-bottom: none; + .rdt_TableCell { div { opacity: 1; @@ -49,7 +52,7 @@ font-variation-settings: "opsz" auto; font-feature-settings: "kern" on; - color: #ffffff; + color: #000000; } } } diff --git a/src/utils/wallet.ts b/src/utils/wallet.ts index 91807a5..4f9335f 100644 --- a/src/utils/wallet.ts +++ b/src/utils/wallet.ts @@ -1,7 +1,7 @@ /* * @LastEditors: John * @Date: 2024-06-19 15:55:07 - * @LastEditTime: 2024-06-27 15:09:45 + * @LastEditTime: 2024-07-01 14:21:08 * @Author: John */ import { config } from "@/components/WalletProvider"; @@ -139,7 +139,7 @@ export async function signAndLogin(address?: `0x${string}`): Promise { return loginOut(); } // 注册 - await api_signUp().send({ + const { data } = await api_signUp().send({ data: { account: address, publicKey, @@ -147,7 +147,11 @@ export async function signAndLogin(address?: `0x${string}`): Promise { chainType: 2, }, }); - await signAndLogin(address); + if (data?.code == 0) { + await signAndLogin(address); + } else { + return loginOut(); + } reslove(); loadingToast.close(); }