add user db

This commit is contained in:
maojindao55
2025-03-26 20:00:31 +08:00
parent 051a7da4c6
commit 04d6a2f9af
8 changed files with 157 additions and 8 deletions

View File

@@ -28,11 +28,10 @@ export const onRequestPost: PagesFunction<Env> = async (context) => {
}
// 开发环境使用固定验证码
const verificationCode = env.CF_PAGES_ENVIRONMENT === 'preview'
const verificationCode = env.CF_PAGES_ENVIRONMENT !== 'production'
? '123456'
: Math.random().toString().slice(-6);
if (env.CF_PAGES_ENVIRONMENT !== 'preview') {
if (env.CF_PAGES_ENVIRONMENT === 'production') {
try {
await sendSMS(phone, verificationCode, {
accessKeyId: env.ALIYUN_ACCESS_KEY_ID,