🐞 fix(账号登录): 密码登录返回设备id

This commit is contained in:
luying
2022-10-24 20:21:54 +08:00
parent 81863e33ee
commit f56fd371e7
2 changed files with 2 additions and 2 deletions

View File

@@ -337,7 +337,7 @@ export class EntryHandler {
if(!token) { if(!token) {
// 用户注册登录 // 用户注册登录
token = generateStr(256); token = generateStr(256);
let user = await UserModel.createOrUpdate(false, tel, token, 'pc', ' ', pinus.app.get('env'), '', ''); let {user} = await UserModel.createOrUpdate(false, tel, token, 'pc', ' ', pinus.app.get('env'), '', '');
const roleId = genCode(10); const roleId = genCode(10);
const code = genCode(6); const code = genCode(6);
const seqId = await Counter.getNewCounter(COUNTER.ROLE) || -1; const seqId = await Counter.getNewCounter(COUNTER.ROLE) || -1;

View File

@@ -227,7 +227,7 @@ export default class User extends BaseModel {
public static async checkPass(tel: string, password: string, token: string, deviceId: string) { public static async checkPass(tel: string, password: string, token: string, deviceId: string) {
const user: UserType = await UserModel.findOne({ tel }).select('salt').lean({ getters: true }); const user: UserType = await UserModel.findOne({ tel }).select('salt deviceId').lean({ getters: true });
if (user) { if (user) {
const curTime: Date = new Date(); const curTime: Date = new Date();
let { salt } = user; let { salt } = user;