File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -224,7 +224,7 @@ export class User extends Model {
224224
225225 static async verify ( nickname : string , password : string ) : Promise < User > {
226226 // tslint:disable-next-line: await-promise
227- const user = await this . findOne ( { where : { nickname } } ) ;
227+ const user = await this . findOne ( { where : { nickname, delete_time : null } } ) ;
228228 if ( ! user ) {
229229 throw new NotFound ( { msg : "用户不存在" } ) ;
230230 }
Original file line number Diff line number Diff line change @@ -53,8 +53,16 @@ function transform(obj: any, data: any) {
5353 * @param app app实例
5454 */
5555export const success = ( app : Application ) => {
56- app . context . json = function ( ex ?: Exception ) {
57- throw new Success ( ex ) ;
56+ app . context . success = function ( ex ?: Exception ) {
57+ this . type = "application/json" ;
58+ const suc = new Success ( ex ) ;
59+ let data = {
60+ error_code : suc . errorCode ,
61+ msg : suc . msg ,
62+ url : this . req . url
63+ } ;
64+ this . status = suc . code ;
65+ this . body = JSON . stringify ( data ) ;
5866 } ;
5967} ;
6068
Original file line number Diff line number Diff line change 11{
22 "name" : " lin-mizar" ,
3- "version" : " 0.0.1-alpha.19 " ,
3+ "version" : " 0.0.1-alpha.22 " ,
44 "description" : " The core library of Lin CMS" ,
55 "main" : " lin/index.js" ,
66 "scripts" : {
You can’t perform that action at this time.
0 commit comments