后台:权限

This commit is contained in:
luying
2021-12-21 19:42:37 +08:00
parent 151ac33b91
commit 7d0808a9dc
26 changed files with 1009 additions and 818 deletions
+2 -2
View File
@@ -1,5 +1,5 @@
import { COUNTER } from './../consts';
import { CounterModel } from './Counter';
import { CounterAllModal } from './CounterAll';
import BaseModel from './BaseModel';
import { index, getModelForClass, prop, DocumentType, mongoose, ReturnModelType } from '@typegoose/typegoose';
const bcrypt = require('bcrypt');
@@ -72,7 +72,7 @@ export default class GMUser extends BaseModel {
}
public static async createGmAccount(username: string, password: string, name: string, token: string, lean = true) {
const uid = await CounterModel.getNewCounter(COUNTER.GMUID);
const uid = await CounterAllModal.getNewCounter(COUNTER.GMUID);
let r = await this.encryptPass(password);
const user: GMUserType = await GMUserModel.findOneAndUpdate({ username }, { uid, password: r.npassword, salt: r.salt, name, token }, { upsert: true, new: true }).select('uid username name').lean(lean);
return user;