liuyu 4 years ago
parent
commit
91d3ab0cfe
1 changed files with 18 additions and 6 deletions
  1. 18 6
      app/service/dock.js

+ 18 - 6
app/service/dock.js

@@ -99,12 +99,24 @@ class ChatService extends CrudService {
     if (!vipuser) {
       throw new BusinessError('没有查询到vip用户');
     }
-    vipuser.vipname = info.vipname;
-    vipuser.vipphone = info.vipphone;
-    vipuser.role = info.role;
-    vipuser.company = info.company;
-    vipuser.email = info.email;
-    vipuser.content = info.content;
+    if (info.vipname) {
+      vipuser.vipname = info.vipname;
+    }
+    if (info.vipphone) {
+      vipuser.vipphone = info.vipphone;
+    }
+    if (info.role) {
+      vipuser.role = info.role;
+    }
+    if (info.company) {
+      vipuser.company = info.company;
+    }
+    if (info.email) {
+      vipuser.email = info.email;
+    }
+    if (info.content) {
+      vipuser.content = info.content;
+    }
     return await dock.save();
   }