测试:增加一个测试用接口;修改 config.json 中的默认环境
This commit is contained in:
@@ -263,4 +263,23 @@ export class EntryHandler {
|
||||
const token = await UserModel.findTokenByTel(tel);
|
||||
return resResult(STATUS.SUCCESS, { token });
|
||||
}
|
||||
|
||||
/**
|
||||
* ! 仅用于测试
|
||||
* @description 测试接口,用于查询和返回 token
|
||||
* @param {{ seqId: string, magicWord: string }} msg 要查询的手机号;需要验证的密码
|
||||
* @param {FrontendSession} session
|
||||
* @returns
|
||||
* @memberof EntryHandler
|
||||
*/
|
||||
async debugQueryTokenById(msg: { uid: number, magicWord: string }, session: FrontendSession) {
|
||||
const { uid, magicWord } = msg;
|
||||
console.log('debugQueryTokenById msg:', msg);
|
||||
if (magicWord !== DEBUG_MAGIC_WORD) {
|
||||
return resResult(STATUS.TOKEN_ERR);
|
||||
}
|
||||
const user = await UserModel.findTokenByUid(uid);
|
||||
console.log('debugQueryTokenById got user:', user);
|
||||
return resResult(STATUS.SUCCESS, { user });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user