高敬炎 2 anos atrás
pai
commit
b2561f9e86
2 arquivos alterados com 17 adições e 7 exclusões
  1. 14 2
      src/views/lessee/lesseeEdit.vue
  2. 3 5
      vue.config.js

+ 14 - 2
src/views/lessee/lesseeEdit.vue

@@ -580,9 +580,12 @@ export default {
     },
     // 获取租户已购买的插件列表
     async getPayedServices (compare = true) {
+      // debugger
       const response = await plugins({ tenantId: this.tenantId });
+      console.log(response)
       this.pageTreeData = response.data.map(plugin => {
-        return {
+        if(plugin.activatedServices){
+          return {
           ...plugin,
           activatedServices: plugin.activatedServices.map(service => {
             return {
@@ -594,12 +597,19 @@ export default {
             };
           })
         };
+        }else{
+          return {
+          ...plugin,
+          }
+        }
+        
       });
       // 如果dialog里有值,就对比勾选服务
       if (compare && this.dialogTreeData.length > 0) {
         this.pageTreeData.forEach(plugin => {
           let serviceCodes = [];
-          plugin.activatedServices.forEach(service => {
+          if(plugin.activatedServices){
+            plugin.activatedServices.forEach(service => {
             if (
               !service.tenantServiceItems ||
               service.tenantServiceItems.length === 0
@@ -611,6 +621,8 @@ export default {
               );
             }
           });
+          }
+          
           this.dialogDefaultCheckedKeyObj[plugin.pluginCode] = serviceCodes;
         });
       }

+ 3 - 5
vue.config.js

@@ -26,9 +26,9 @@ module.exports = {
   devServer: {
     port: port,
     open: false,
-    overlay: {
-      warnings: false,
-      errors: true
+        overlay: {
+          warnings: false,
+          errors: true
     },
     proxy: {
       // change xxx-api/login => mock/login
@@ -59,12 +59,10 @@ module.exports = {
         changeOrigin: true,
         secure: false
       },
-
     },
     after(app) {
       require('@babel/register')
       const bodyParser = require('body-parser')
-
       // parse app.body
       // http://expressjs.com/en/4x/api.html#req.body
       app.use(bodyParser.json())