From e5bcc0d850c08f909d3f9d2bc235c2e6e6cd5047 Mon Sep 17 00:00:00 2001 From: maojindao55 Date: Wed, 2 Apr 2025 11:37:03 +0800 Subject: [PATCH] fix cf_pages --- functions/api/sendCode.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/functions/api/sendCode.ts b/functions/api/sendCode.ts index 2cca299..d6fdd24 100644 --- a/functions/api/sendCode.ts +++ b/functions/api/sendCode.ts @@ -28,10 +28,10 @@ export const onRequestPost: PagesFunction = async (context) => { } // 开发环境使用固定验证码 - const verificationCode = env.CF_PAGES_ENVIRONMENT !== 'production' + const verificationCode = env.CF_PAGES !== '1' ? '123456' : Math.random().toString().slice(-6); - if (env.CF_PAGES_ENVIRONMENT === 'production') { + if (env.CF_PAGES === '1') { try { await sendSMS(phone, verificationCode, { accessKeyId: env.ALIYUN_ACCESS_KEY_ID,