Jelajahi Sumber

修改接口

zs 1 tahun lalu
induk
melakukan
c6ffb49918

+ 4 - 0
src/entity/Config.entity.ts

@@ -6,4 +6,8 @@ import { BaseModel } from 'free-midway-component';
 export class Config extends BaseModel {
   @prop({ required: false, index: false, zh: 'logo' })
   logo_url: Array<any>;
+  @prop({ required: false, index: false, zh: '男头像' })
+  boy_url: Array<any>;
+  @prop({ required: false, index: false, zh: '女头像' })
+  girl_url: Array<any>;
 }

+ 10 - 0
src/interface/Config.interface.ts

@@ -16,6 +16,10 @@ export class FVO_Config {
   _id: string = undefined;
   @ApiProperty({ description: 'logo' })
   'logo_url': Array<any> = undefined;
+  @ApiProperty({ description: '男头像' })
+  'boy_url': Array<any> = undefined;
+  @ApiProperty({ description: '女头像' })
+  'girl_url': Array<any> = undefined;
 }
 
 export class QDTO_Config extends SearchBase {
@@ -38,6 +42,12 @@ export class CDTO_Config {
   @ApiProperty({ description: 'logo' })
   @Rule(RuleType['array']().empty(''))
   'logo_url': Array<any> = undefined;
+  @ApiProperty({ description: '男头像' })
+  @Rule(RuleType['array']().empty(''))
+  'boy_url': Array<any> = undefined;
+  @ApiProperty({ description: '女头像' })
+  @Rule(RuleType['array']().empty(''))
+  'girl_url': Array<any> = undefined;
 }
 
 export class CVO_Config extends FVO_Config {

+ 22 - 4
src/service/user.service.ts

@@ -17,9 +17,7 @@ export class UserService extends BaseService<modelType> {
 
   async findUserToLogin(data: LoginDTO): Promise<object> {
     const { tel, password } = data;
-    const user = await this.model
-      .findOne({ tel, status: '1' }, '+password')
-      .lean();
+    const user = await this.model.findOne({ tel }, '+password').lean();
     if (!user)
       throw new ServiceError(
         '未找到用户信息',
@@ -27,15 +25,35 @@ export class UserService extends BaseService<modelType> {
       );
     if (!isEqual(user.password.secret, password))
       throw new ServiceError('密码错误', FrameworkErrorEnum.SERVICE_FAULT);
+    if (user.status === '0')
+      throw new ServiceError(
+        '账号审核中,请稍后再试',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (user.status === '-1')
+      throw new ServiceError(
+        '账号审核拒绝 请重新申请!',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
     return user;
   }
   async wxLogin(openid: any): Promise<object> {
-    const user = await this.model.findOne({ openid, status: '1' }).lean();
+    const user = await this.model.findOne({ openid }).lean();
     if (!user)
       throw new ServiceError(
         '未找到用户信息',
         FrameworkErrorEnum.NOT_FOUND_DATA
       );
+    if (user.status === '0')
+      throw new ServiceError(
+        '账号审核中,请稍后再试',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
+    if (user.status === '-1')
+      throw new ServiceError(
+        '账号审核拒绝 请重新申请!',
+        FrameworkErrorEnum.NOT_FOUND_DATA
+      );
     return user;
   }
 }