上线前支持不填验证码直接登录

This commit is contained in:
liangtongchuan
2021-02-04 16:09:45 +08:00
parent 86c8cbc2f1
commit a4f2ed7380
+5
View File
@@ -92,6 +92,10 @@ export default class Auth extends Service {
if (telVerify.status !== 0) { if (telVerify.status !== 0) {
return telVerify; return telVerify;
} }
// ! 测试阶段允许客户端不传验证码,此时不做验证码验证,直接注册或登录账号
// TODO 上线前改掉或仅保留在测试服
if (code !== '') {
if (!isString(code) || code.length !== 6) { if (!isString(code) || code.length !== 6) {
return ctx.service.utils.resResult(STATUS.WRONG_PARMS); return ctx.service.utils.resResult(STATUS.WRONG_PARMS);
} }
@@ -108,6 +112,7 @@ export default class Auth extends Service {
return ctx.service.utils.resResult(STATUS.SMS_INVALID); return ctx.service.utils.resResult(STATUS.SMS_INVALID);
} }
} }
}
// 用户注册登录 // 用户注册登录
const token = ctx.service.utils.generateStr(256); const token = ctx.service.utils.generateStr(256);