后台:权限
This commit is contained in:
+2
-2
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user