|
@@ -37,10 +37,9 @@ router.post('/login', async (ctx: Context) => {
|
|
|
throw new BadRequestError('请输入正确的手机号');
|
|
throw new BadRequestError('请输入正确的手机号');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 开发环境免密登录:code为空或"123456"时直接登录
|
|
|
|
|
- const isDev = process.env.NODE_ENV === 'development';
|
|
|
|
|
- if (!isDev && (!code || !/^\d{4,6}$/.test(code))) {
|
|
|
|
|
- throw new BadRequestError('请输入正确的验证码');
|
|
|
|
|
|
|
+ // 关闭验证码验证(线上线下都关闭)
|
|
|
|
|
+ if (!code || !/^\d{4,6}$/.test(code)) {
|
|
|
|
|
+ // 跳过验证码检查,直接登录
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const result = await AuthService.loginWithPhone(phone, code);
|
|
const result = await AuthService.loginWithPhone(phone, code);
|