From c23977cf1e7761792f445eec9e6a67cc8f1665d2 Mon Sep 17 00:00:00 2001 From: al Date: Fri, 9 Aug 2024 21:02:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E5=9B=BE=E7=89=87=E5=AE=BD?= =?UTF-8?q?=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/login/page.js | 20 ++++++++++++++------ components/AddToHome/index.jsx | 6 +++--- components/Photos/index.js | 4 +++- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/app/login/page.js b/app/login/page.js index cf13426..3eedeab 100644 --- a/app/login/page.js +++ b/app/login/page.js @@ -155,11 +155,11 @@ function Login({ handleLogin }) { } ); if (data.ret === -1) { - // Toast.show({ - // icon: "fail", - // content: data.msg, - // position: "top", - // }); + Toast.show({ + icon: "fail", + content: data.msg, + position: "top", + }); return; } //登录 @@ -208,7 +208,7 @@ function Login({ handleLogin }) { const mobile_phone = encrypt.encrypt(mobilePhone); //发送短信验证码 try { - await fetch(`/api/veri_code/send`, { + const data = await fetch(`/api/veri_code/send`, { method: "POST", headers: { "Content-Type": "application/json", @@ -218,6 +218,14 @@ function Login({ handleLogin }) { region_code: regionCode, }), }); + if (data.ret === -1) { + Toast.show({ + icon: "fail", + content: data.msg, + position: "top", + }); + return; + } } catch (error) { console.error(error); } diff --git a/components/AddToHome/index.jsx b/components/AddToHome/index.jsx index 1f37e6b..eceaaa4 100644 --- a/components/AddToHome/index.jsx +++ b/components/AddToHome/index.jsx @@ -24,7 +24,7 @@ export default function AddToHome() { fit="cover" className="rounded-md mr-3" // src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/icons/nodata.png"} - src={"/images/icon.png"} + src={process.env.NEXT_PUBLIC_WEB_ASSETS_URL+"/images/icon.png"} placeholder="" width={46} height={46} @@ -66,7 +66,7 @@ export default function AddToHome() { ({ type: "img", url: item.urls?.[0], + fullwidth:item.w>item.h })); let videoArr = media.videos.map((item) => ({ type: "video", url: item.cover_urls?.[0], mp4: item.urls?.[0], + fullwidth:item.cover_w>item.cover_h })); let arr = [...imgArr, ...videoArr]; let newPhotos = [...arr]; @@ -249,7 +251,7 @@ export default function Photos({ placeholder={
} - width={currentPhotos.length > 1 ? "24vw" : "46vw"} + width={currentPhotos.length > 1 ? "24vw" : item.fullwidth?"100%":"46vw"} height={currentPhotos.length > 1 ? "24vw" : "100%"} className={`rounded max-w-full ${ item?.type == "hid" && type == "space" ? "imageBlur" : ""