@@ -223,11 +223,11 @@ export class Manager {
223223
224224 /**
225225 * 校验密码是否正确
226- * @param nickname 昵称
226+ * @param username 昵称
227227 * @param password 密码
228228 */
229- public verify ( nickname : string , password : string ) {
230- return this . userModel . verify ( nickname , password ) ;
229+ public verify ( username : string , password : string ) {
230+ return this . userModel . verify ( username , password ) ;
231231 }
232232
233233 /**
@@ -252,7 +252,7 @@ export class Manager {
252252 */
253253export class User extends Model {
254254 public id ! : number ;
255- public nickname ! : string ;
255+ public username ! : string ;
256256 public admin ! : number ;
257257 public active ! : number ;
258258 public email ! : string ;
@@ -268,9 +268,9 @@ export class User extends Model {
268268 // tslint:disable-next-line:variable-name
269269 public delete_time ! : Date ;
270270
271- static async verify ( nickname : string , password : string ) : Promise < User > {
271+ static async verify ( username : string , password : string ) : Promise < User > {
272272 // tslint:disable-next-line: await-promise
273- const user = await this . findOne ( { where : { nickname , delete_time : null } } ) ;
273+ const user = await this . findOne ( { where : { username , delete_time : null } } ) ;
274274 if ( ! user ) {
275275 throw new NotFound ( { msg : '用户不存在' } ) ;
276276 }
@@ -302,7 +302,7 @@ export class User extends Model {
302302 toJSON ( ) {
303303 const origin = {
304304 id : this . id ,
305- nickname : this . nickname ,
305+ username : this . username ,
306306 admin : this . admin ,
307307 active : this . active ,
308308 email : this . email ,
0 commit comments