username 1 سال پیش
والد
کامیت
fcdb252d2a

+ 2 - 14
src/app/[locale]/layout.tsx

@@ -25,7 +25,7 @@ export const metadata = {
     keywords: ["Next.js"],
     description: ["Next.js"],
     appleWebApp: {
-        statusBarStyle: 'black',
+        statusBarStyle: "black",
     },
     formatDetection: {
         email: false,
@@ -33,7 +33,7 @@ export const metadata = {
         telephone: false,
     },
     other: {
-        viewport: ['width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover'],
+        viewport: ["width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover"],
     },
 }
 
@@ -48,18 +48,6 @@ export default async function LocaleLayout({
 
     return (
         <html lang={locale} suppressHydrationWarning>
-            {/* <Head>
-                <meta http-equiv="X-UA-Compatible" content="IE=edge" />
-                <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, viewport-fit=cover" />
-                <meta name="keywords" content=""/>
-                <meta name="description" content=""/>
-                <meta name="apple-mobile-web-app-capable" content="yes" />
-                <meta name="apple-mobile-web-app-status-bar-style" content="black" />
-                <meta name="format-detection" content="telphone=no, email=no" />
-                <meta http-equiv="Cache-control" content="no-cache, no-store, must-revalidate"/>
-                <meta http-equiv="Pragma" content="no-cache"/>
-                <meta http-equiv="Expires" content="0"/>
-            </Head> */}
             <body className={clsx("font-sans", fontSans.variable)}>
                 <Providers themeProps={{ defaultTheme: "dark", attribute: "class" }}>
                     <NextIntlClientProvider messages={messages}>

+ 2 - 1
src/app/[locale]/login/page.tsx

@@ -43,10 +43,11 @@ const Login: FC<Props> = () => {
                     setTimeout(() => {
                         router.replace("/" + redirect);
                     }, 1000);
+                    setMsgError(res.msg || "");
                 }
             });
+            setMsgError(res.msg || "");
         }
-        setMsgError(res.msg || "");
     };
 
     return (

+ 1 - 2
src/app/[locale]/register/page.tsx

@@ -26,8 +26,7 @@ const Register: FC<Props> = () => {
             setTimeout(() => {
                 router.replace("/login");
             }, 1000);
-        } else {
-            setMsgError(msg);
+            setMsgError(msg || "");
         }
     };
     return (

+ 6 - 4
src/app/[locale]/resetPhone/page.tsx

@@ -34,11 +34,13 @@ const ResetPhone: FC<Props> = () => {
     const checkUserPhoneRequest = async () => {
         if (!phoneRegex(userPhone)) return;
         let { code, msg, data } = await getCheckUserPhoneExistApi({ user_phone: userPhone });
-        if (code == 200 && data) {
-            router.push(`/verification?userPhone=${userPhone}`);
-            return;
+        if (code == 200) {
+            if(data) {
+                router.push(`/verification?userPhone=${userPhone}`);
+                return;
+            }
+            setMsgError(msg);
         }
-        setMsgError(msg);
     };
     return (
         <div className="resetPhone-box">

+ 0 - 7
src/app/[locale]/verification/page.scss

@@ -69,13 +69,6 @@
       }
     }
 
-    .tips {
-      width: 100%;
-      color: #e53535;
-      font-size: 0.12rem;
-      margin-top: .02rem;
-    }
-
     .btnContent {
       margin: .29rem 0 .19rem;
     }

+ 1 - 6
src/app/[locale]/verification/page.tsx

@@ -21,16 +21,13 @@ const ResetPhone: FC<Props> = () => {
 
     let searchParams = useSearchParams();
     let user_phone = searchParams.get("userPhone");
-    let [msgError, setMsgError] = useState("");
     const sendCodeRequest = () => {
         if (!user_phone) return;
         getSendCodeApi({ user_phone }).then((res) => {
             if (res.code == 200) {
                 setTime(60);
                 setIsNote(true);
-                return;
             }
-            setMsgError(res.msg);
         });
     };
     useEffect(() => {
@@ -82,11 +79,9 @@ const ResetPhone: FC<Props> = () => {
                         maxLength={6}
                     />
                     <span className="after" onClick={sendCodeFun}>
-                        {" "}
-                        {isNote ? `${time}s` : t("Envie")}{" "}
+                        {isNote ? `${time}s` : t("Envie")}
                     </span>
                 </div>
-                {msgError && <div className="tips"> {msgError} </div>}
                 <div className="btnContent">
                     <ButtonOwn active={code.length == 6} callbackFun={goPage}>
                         {t("Completar")}