max 7 月之前
父节点
当前提交
3b4f40edf7
共有 4 个文件被更改,包括 20 次插入17 次删除
  1. 二进制
      dist.zip
  2. 7 7
      src/config/config.max.ts
  3. 1 1
      src/configuration.ts
  4. 12 9
      src/modules/base/service/sys/user.ts

二进制
dist.zip


+ 7 - 7
src/config/config.max.ts

@@ -9,14 +9,14 @@ export default {
     dataSource: {
       default: {
         type: 'mysql',
-        // host: '192.168.2.101',
-        // port: 6806,
-        // username: 'root',
-        // password: 'admin',
-        host: '127.0.0.1',
-        port: 3306,
+        host: '192.168.2.101',
+        port: 6806,
         username: 'root',
-        password: '12345678',
+        password: 'admin',
+        // host: '127.0.0.1',
+        // port: 3306,
+        // username: 'root',
+        // password: '12345678',
         database: 'va',
         // 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
         synchronize: true,

+ 1 - 1
src/configuration.ts

@@ -43,7 +43,7 @@ import * as swagger from '@midwayjs/swagger';
     // swagger 文档  http://www.midwayjs.org/docs/extensions/swagger
     {
       component: swagger,
-      enabledEnvironment: ['local', 'max']
+      enabledEnvironment: ['local', 'max', 'prod', 'production']
     },
     {
       component: info,

+ 12 - 9
src/modules/base/service/sys/user.ts

@@ -124,6 +124,7 @@ export class BaseSysUserService extends BaseService {
       },
     });
 
+    console.log(128, merchant)
     // 如果需要获取关联信息,可以分别查询
     let individualInfo = null;
     let businessInfo = null;
@@ -135,15 +136,17 @@ export class BaseSysUserService extends BaseService {
           merchantId: merchant.mchId
         }
       })
-      if(customer.type === 'COMPANY') {
-        businessInfo = await this.businessEntity.findOneBy({
-          customer_id: customer.customer_id,
-        });
-      } else {
-        // 分别查询个人或企业信息
-        individualInfo = await this.individualEntity.findOneBy({
-          customer_id: customer.customer_id,
-        });
+      if(customer) {
+        if(customer.type === 'COMPANY') {
+          businessInfo = await this.businessEntity.findOneBy({
+            customer_id: customer.customer_id,
+          });
+        } else {
+          // 分别查询个人或企业信息
+          individualInfo = await this.individualEntity.findOneBy({
+            customer_id: customer.customer_id,
+          });
+        }
       }
     }