Ver Fonte

importPhone

wuyi há 1 ano atrás
pai
commit
ad76a4428b
1 ficheiros alterados com 6 adições e 8 exclusões
  1. 6 8
      src/phone-list/phone-list.controller.ts

+ 6 - 8
src/phone-list/phone-list.controller.ts

@@ -81,8 +81,7 @@ export class PhoneListController {
     async importPhoneList(
         @Param('id') id: string,
         @Param('flag') flag: number,
-        @UploadedFile() file: Express.Multer.File,
-        @Req() req
+        @UploadedFile() file: Express.Multer.File
     ) {
         const { buffer } = file
         let phones = buffer
@@ -96,14 +95,13 @@ export class PhoneListController {
             throw new InternalServerErrorException('导入失败,导入条数不能少于100条!')
         }
 
-        console.log('user:', req.user)
         if (flag === 1) {
+            // if (req.user.roles.includes('user')) {
+            //     if (!(await this.balanceService.changeScreenBalance(req.user.id, phones.length))) {
+            //         throw new InternalServerErrorException('筛号余额不足请充值!')
+            //     }
+            // }
             try {
-                if (req.user.roles.includes('user')) {
-                    if (!(await this.balanceService.changeScreenBalance(req.user.id, phones.length))) {
-                        throw new InternalServerErrorException('筛号余额不足请充值!')
-                    }
-                }
                 console.log('进入筛号')
                 const finalPhones = await this.phoneListService.screenPhoneNumber(file, parseInt(id))
                 if (finalPhones && finalPhones.length > 0) {