diff --git a/api/public.js b/api/public.js index 8f6233a..2057ac0 100644 --- a/api/public.js +++ b/api/public.js @@ -247,8 +247,11 @@ export const createOrder = async (type = "alipay_h5") => { }; //点击获取验证码 -export const handleVerification = async (mobilePhone = "", regionCode) => { - // console.log("mobilePhone",mobilePhone.toString()) +export const handleVerification = async ( + mobilePhone = "", + regionCode, + callback +) => { //手机号校验 if (!mobilePhone.toString().match(/^1[3456789]\d{9}$/)) { Toast.show({ @@ -260,16 +263,25 @@ export const handleVerification = async (mobilePhone = "", regionCode) => { } //对手机号进行RSA加密 const encrypt = new JSEncrypt(); - encrypt.setPublicKey(process.env.EXPO_PUBLIC_RSA_KEY); + encrypt.setPublicKey(process.env.NEXT_PUBLIC_RSA_KEY); const mobile_phone = encrypt.encrypt(mobilePhone); //发送短信验证码 try { - await requireAPI("POST", `/api/veri_code/send`, { + const data = await requireAPI("POST", `/api/veri_code/send`, { body: { mobile_phone: mobile_phone, region_code: regionCode, }, }); + if (data.ret === -1) { + Toast.show({ + icon: "fail", + content: data.msg, + position: "top", + }); + return; + } + callback && callback(); } catch (error) { // console.error(error); } diff --git a/app/messageDetail/page.js b/app/messageDetail/page.js index 31219b9..7804da4 100644 --- a/app/messageDetail/page.js +++ b/app/messageDetail/page.js @@ -377,7 +377,7 @@ export default function MessageDetail({}) { }; return (
+ *{priceFilters[1]?.desc} +