xiaodai2022 2 éve
szülő
commit
ca4766ae5a

+ 52 - 0
src/components/global/tableAuth/index.vue

@@ -0,0 +1,52 @@
+<template>
+  <div class="tableAuth">
+    <template v-show="show">
+    <slot />
+    </template>
+
+    <NoAuth v-show="show" />
+  </div>
+</template>
+
+<script>
+export default {
+  name: "tableAuth",
+  props: ["show"],
+};
+</script>
+
+<style lang="scss" scoped>
+.noAuth {
+  width: 800px;
+  max-width: 100%;
+  margin: 100px auto;
+  text-align: left;
+  .pan-back-btn {
+    background: #008489;
+    color: #fff;
+    border: none !important;
+  }
+  .pan-gif {
+    margin: 0 auto;
+    display: block;
+  }
+  .pan-img {
+    display: block;
+    margin: 0 auto;
+    width: 100%;
+  }
+  .text-jumbo {
+    font-size: 60px;
+    font-weight: 700;
+    color: #484848;
+    padding-top: 45px;
+  }
+  .list-unstyled {
+    padding: 0 0 0 4px;
+    font-size: 14px;
+    li {
+      line-height: 30px;
+    }
+  }
+}
+</style>

+ 31 - 55
src/layout/components/Navbar.vue

@@ -1,20 +1,13 @@
 <template>
   <div class="navbar">
-
     <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
 
     <div class="right-menu">
       <template v-if="device !== 'mobile'">
-
         <screenfull id="screenfull" class="right-menu-item hover-effect" />
-
-       
       </template>
 
-      <el-dropdown
-        class="avatar-container right-menu-item hover-effect"
-        trigger="click"
-      >
+      <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">
         <div class="avatar-wrapper">
           <img :src="avatar" class="user-avatar" />
           <i class="el-icon-caret-bottom" />
@@ -69,9 +62,7 @@
                 >
                 <el-col :span="activeMsg.sys_type === 'VER' ? 12 : 24">
                   <el-form-item
-                    :label="
-                      activeMsg.sys_type === 'VER' ? '更新时间:' : '预计时间:'
-                    "
+                    :label="activeMsg.sys_type === 'VER' ? '更新时间:' : '预计时间:'"
                   >
                     <p style="margin: 0">
                       {{ activeMsg.addtime }}
@@ -80,21 +71,13 @@
                 >
                 <el-col :span="24"
                   ><el-form-item label="更新内容:">
-                    <p
-                      style="margin: 0"
-                      v-html="activeMsg.system"
-                    ></p></el-form-item
+                    <p style="margin: 0" v-html="activeMsg.system"></p></el-form-item
                 ></el-col>
                 <el-col :span="24" style="text-align: right">
-                  <el-checkbox
-                    v-model="checked"
-                    class="fl"
-                    style="padding-top: 5px"
+                  <el-checkbox v-model="checked" class="fl" style="padding-top: 5px"
                     >我已知晓,后续不再提示!</el-checkbox
                   >
-                  <el-button @click="submit" type="primary" plain
-                    >关闭
-                  </el-button>
+                  <el-button @click="submit" type="primary" plain>关闭 </el-button>
                 </el-col>
               </el-row>
             </el-form>
@@ -151,43 +134,40 @@ export default {
       }
       console.log(this.lastNotice);
       this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
-      if (
-        res &&
-        res.code === 0 &&
-        res.data &&
-        res.data.list &&
-        res.data.list.length > 0
-      ) {
-        this.activeMsg = res.data.list[0];
-        this.isShow = true;
-        if (this.lastNotice + "" !== "null") {
-          // console.log(this.lastNotice.addtime);
-          if (this.activeMsg.addtime === this.lastNotice.addtime) {
-            if (this.lastNotice.type === "1") {
-              this.checked = true;
+      const { code, data, message } = await asyncRequest.list(this.parmValue);
+      if (code === 0) {
+        const { list } = data || {};
+        if (list.length > 0) {
+          this.activeMsg = res.data.list[0];
+          this.isShow = true;
+          if (this.lastNotice + "" !== "null") {
+            // console.log(this.lastNotice.addtime);
+            if (this.activeMsg.addtime === this.lastNotice.addtime) {
+              if (this.lastNotice.type === "1") {
+                this.checked = true;
+              } else {
+                this.checked = false;
+              }
             } else {
               this.checked = false;
             }
           } else {
+            let model = {
+              type: this.checked ? "1" : "0",
+              addtime: this.activeMsg.addtime,
+            };
+            setNotice(JSON.stringify(model));
             this.checked = false;
           }
-        } else {
-          let model = {
-            type: this.checked ? "1" : "0",
-            addtime: this.activeMsg.addtime,
-          };
-          setNotice(JSON.stringify(model));
-          this.checked = false;
-        }
-        if (type === 1) {
-          this.typeShow();
-        } else {
-          this.showModel = true;
+          if (type === 1) {
+            this.typeShow();
+          } else {
+            this.showModel = true;
+          }
         }
 
         // console.log(this.activeMsg);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.activeMsg = null;
@@ -207,11 +187,7 @@ export default {
         //   nowtime < this.endTime,
         //   !this.checked
         // );
-        if (
-          nowtime > this.statsTime &&
-          nowtime < this.endTime &&
-          !this.checked
-        ) {
+        if (nowtime > this.statsTime && nowtime < this.endTime && !this.checked) {
           this.showModel = true;
         } else {
           this.showModel = false;

+ 139 - 144
src/store/modules/user.js

@@ -1,4 +1,11 @@
-import { login, logout, userinfo, menuList, dingdingdetail, logoutx } from '@/apis/user'
+import {
+  login,
+  logout,
+  userinfo,
+  menuList,
+  dingdingdetail,
+  logoutx,
+} from "@/apis/user";
 import {
   getToken,
   setToken,
@@ -12,162 +19,159 @@ import {
   getRoles,
   setRoles,
   removeRoles,
-} from '@/utils/auth'
+} from "@/utils/auth";
 
 const state = {
   token: getToken(),
-  name: '',
-  avatar: require('@/assets/sheji/user.png'),
-  introduction: '',
-  roles: getRoles() ? getRoles() : 'edit',
+  name: "",
+  avatar: require("@/assets/sheji/user.png"),
+  introduction: "",
+  roles: getRoles() ? getRoles() : "edit",
   btnList: getBtn(),
   navList: getMenu(),
-}
+};
 
 const mutations = {
   SET_TOKEN: (state, token) => {
-    state.token = token
+    state.token = token;
   },
   SET_MENU: (state, menu) => {
-    state.menu = menu
+    state.menu = menu;
   },
   SET_HAS: (state, has) => {
-    state.has = has
+    state.has = has;
   },
   SET_INTRODUCTION: (state, introduction) => {
-    state.introduction = introduction
+    state.introduction = introduction;
   },
   SET_NAME: (state, name) => {
-    state.name = name
+    state.name = name;
   },
   SET_AVATAR: (state, avatar) => {
-    state.avatar = avatar
+    state.avatar = avatar;
   },
   SET_ROLES: (state, roles) => {
-    state.roles = roles
+    state.roles = roles;
   },
   navListFn(state, val) {
     if (!val) {
       val = [];
     }
     state.navList = val;
-    setMenu(val)
+    setMenu(val);
   },
   btnListFn(state, val) {
     if (!val) {
       val = [];
     }
-    state.btnList = val
-    setBtn(val)
-
+    state.btnList = val;
+    setBtn(val);
   },
-}
+};
 
 const actions = {
   // user login
   login({ commit }, userInfo) {
-    const { username, password } = userInfo
+    const { username, password } = userInfo;
     return new Promise((resolve, reject) => {
       login({ username: username.trim(), password: password })
-        .then(response => {
-          const { data } = response
+        .then((response) => {
+          const { data } = response;
           if (response.code === 0) {
-            let ROLES = username === 'admin' ? 'admin' : "edit"
-            commit('SET_TOKEN', data.token)
-            commit('SET_ROLES', ROLES)
-            setRoles(ROLES)
-            setToken(data.token)
+            let ROLES = username === "admin" ? "admin" : "edit";
+            commit("SET_TOKEN", data.token);
+            commit("SET_ROLES", ROLES);
+            setRoles(ROLES);
+            setToken(data.token);
           }
-          resolve(response)
-        })
-        .catch(error => {
-          reject(error)
+          resolve(response);
         })
-    })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
 
   dingUserInfor({ commit }, code) {
     return new Promise(async (resolve, reject) => {
       dingdingdetail(code)
-        .then(response => {
-          const { data } = response
+        .then((response) => {
+          const { data } = response;
           if (response.code === 0) {
-            commit('SET_TOKEN', data.token)
-            setToken(data.token)
-            resolve("success")
+            commit("SET_TOKEN", data.token);
+            setToken(data.token);
+            resolve("success");
           } else {
-            resolve("error")
+            resolve("error");
           }
         })
-        .catch(error => {
-          reject(error)
-        })
-    })
+        .catch((error) => {
+          reject(error);
+        });
+    });
   },
   async getMenuList({ commit, that }) {
     return new Promise(async (resolve, reject) => {
       if (!getToken()) {
-        resolve("noToken")
+        resolve("noToken");
       } else {
-        let res = await menuList({})
-        if (res.code === 0) {
-          let list = res.data
-          list = list.filter((item) => item.child && item.child.length > 0)
-          let arrag = []
-          let btnList = []
-          console.log(list)
-          list.forEach(v1 => {
+        const { code, data, message } = await menuList({});
+        if (code === 0) {
+          let list = data;
+          list = list.filter((item) => item.child && item.child.length > 0);
+          let arrag = [];
+          let btnList = [];
+          console.log(list);
+          list.forEach((v1) => {
             // if(v1.menu_route!=="system" )
             let pItem = {
               name: v1.menu_route,
               path: `/${v1.menu_route}`,
               meta: {
                 title: v1.menu_name,
-                icon: v1.menu_img
+                icon: v1.menu_img,
               },
-              children: []
-            }
-            v1.child.forEach(v2 => {
-              if (v2.menu_route === 'menuOperator') {
+              children: [],
+            };
+            v1.child.forEach((v2) => {
+              if (v2.menu_route === "menuOperator") {
                 if (getRoles() === "admin") {
                   let item = {
                     path: v2.menu_route,
                     name: v2.menu_route,
                     meta: {
                       title: v2.menu_name,
-                      icon: v2.menu_img
+                      icon: v2.menu_img,
                     },
-                    url: v2.menu_url
-                  }
+                    url: v2.menu_url,
+                  };
                   let model = {
                     menu_route: v2.menu_route,
-                    action: v2.action
-                  }
-                  btnList.push(model)
-                  pItem.children.push(item)
+                    action: v2.action,
+                  };
+                  btnList.push(model);
+                  pItem.children.push(item);
                 }
               } else {
-
                 let item = {
                   path: v2.menu_route,
                   name: v2.menu_route,
                   meta: {
                     title: v2.menu_name,
-                    icon: v2.menu_img
+                    icon: v2.menu_img,
                   },
-                  url: v2.menu_url
-                }
+                  url: v2.menu_url,
+                };
                 let model = {
                   menu_route: v2.menu_route,
-                  action: v2.action
-                }
-                btnList.push(model)
-                pItem.children.push(item)
+                  action: v2.action,
+                };
+                btnList.push(model);
+                pItem.children.push(item);
               }
-
-            })
-            arrag.push(pItem)
-          })
+            });
+            arrag.push(pItem);
+          });
           console.log(arrag);
 
           // 生成页面权限
@@ -177,115 +181,106 @@ const actions = {
           // 生成路由
           initRouter(arrag, that);
           // state.commit("loginInfoCommit", res.data);
-          resolve("success")
-        } else if (res.code === 101 || res.code === 102) {
-          resolve("noToken")
+          resolve("success");
+        } else if (code === 101 || code === 102) {
+          resolve("noToken");
         } else {
-          resolve(res)
+          resolve({ code, data, message });
         }
       }
-    })
+    });
   },
 
-
-
   // user logout
   async logout({ commit, state, dispatch }) {
-
     return new Promise(async (resolve, reject) => {
       if (!getToken()) {
-        await resetAll({ commit, dispatch })
-        resolve()
+        await resetAll({ commit, dispatch });
+        resolve();
       } else {
-        let res = await logoutx({ token: getToken() })
-        if (res.code === 0) {
-          await resetAll({ commit, dispatch })
-          resolve()
+        const { code, data, message } = await logoutx({ token: getToken() });
+        if (code === 0) {
+          await resetAll({ commit, dispatch });
+          resolve();
         } else {
-          await resetAll({ commit, dispatch })
-          resolve()
+          await resetAll({ commit, dispatch });
+          resolve();
         }
       }
-    })
-
-
+    });
   },
 
-
-
   // remove token
   resetToken({ commit }) {
-    return new Promise(resolve => {
-      commit('SET_TOKEN', '')
-      commit('SET_ROLES', "")
-      removeToken()
-      resolve()
-      removeRoles()
-    })
+    return new Promise((resolve) => {
+      commit("SET_TOKEN", "");
+      commit("SET_ROLES", "");
+      removeToken();
+      resolve();
+      removeRoles();
+    });
   },
-
-
-}
+};
 
 async function resetAll({ commit, dispatch }) {
-  return new Promise(resolve => {
-    commit('SET_TOKEN', '')
-    commit('SET_ROLES', "")
-    commit('SET_MENU', '')
-    commit('SET_HAS', '')
+  return new Promise((resolve) => {
+    commit("SET_TOKEN", "");
+    commit("SET_ROLES", "");
+    commit("SET_MENU", "");
+    commit("SET_HAS", "");
 
-    removeMenu()
-    removeBtn()
-    removeToken()
-    removeRoles()
+    removeMenu();
+    removeBtn();
+    removeToken();
+    removeRoles();
     // reset visited views and cached views
     // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2485
-    dispatch('tagsView/delAllViews', null, { root: true })
-    resolve()
-  })
+    dispatch("tagsView/delAllViews", null, { root: true });
+    resolve();
+  });
 }
 
 function initRouter(arr) {
   const IndexRoute = [
     //欢迎页
     {
-      path: '/welcome',
-      component: () => import('@/layout/index'),
-      redirect: '/welcome/dashboard',
+      path: "/welcome",
+      component: () => import("@/layout/index"),
+      redirect: "/welcome/dashboard",
       children: [
         {
-          path: 'dashboard',
-          component: () => import('@/views/dashboard/index'),
-          name: 'Dashboard',
-          meta: { title: '首页', icon: 'dashboard', affix: true }
+          path: "dashboard",
+          component: () => import("@/views/dashboard/index"),
+          name: "Dashboard",
+          meta: { title: "首页", icon: "dashboard", affix: true },
         },
-      ]
+      ],
     },
   ];
 
-  arr.map(v1 => {
-    v1.component = (resolve) => require([`@/layout/index.vue`], resolve)
+  arr.map((v1) => {
+    v1.component = (resolve) => require([`@/layout/index.vue`], resolve);
     if (v1.children && v1.children.length > 0) {
-      v1.redirect = `/${v1.name}/${v1.children[0].name}`
-      v1.children.map(v2 => {
-        v2.component = (resolve) => require([`@/views/${v2.url}.vue`], resolve)
-        return v2
-      })
+      v1.redirect = `/${v1.name}/${v1.children[0].name}`;
+      v1.children.map((v2) => {
+        v2.component = (resolve) => require([`@/views/${v2.url}.vue`], resolve);
+        return v2;
+      });
     }
-    return v1
-  })
-  IndexRoute.push(...arr)
+    return v1;
+  });
+  IndexRoute.push(...arr);
   IndexRoute.push({
-    path: '404',
-    component: () => import('@/views/error-page/404'),
+    path: "404",
+    component: () => import("@/views/error-page/404"),
     hidden: false,
-    noCache: true
-  })
+    noCache: true,
+  });
 
   IndexRoute.push({
     path: "*",
-    redirect: '/404',
-  })
+    redirect: "/404",
+  });
   window.vm.$router.addRoutes(IndexRoute);
 }
 
@@ -293,5 +288,5 @@ export default {
   namespaced: true,
   state,
   mutations,
-  actions
-}
+  actions,
+};

+ 26 - 34
src/views/developing/index.vue

@@ -1,9 +1,6 @@
 <template>
   <div class="action pagePadding">
-    <div
-      class="action_show"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')"  class="action_show">
       <div class="action_show_box">
         <ul class="role-list">
           <p class="role-list__title">角色列表</p>
@@ -207,9 +204,7 @@
           >提 交</el-button
         >
       </div>
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
+    </tableAuth>
     </div>
   </div>
 </template>
@@ -240,15 +235,12 @@ export default {
   },
   computed: {
     powers() {
-      let tran =
+      const tran =
         this.$store.getters.btnList.find(
-          (item) => item.menu_route == "action"
-        ) || {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
+          (item) => item.menu_route === "action"
+        );
+        const {action}=tran|| {};
+        return action||[];
     },
     indeterminateCheck() {
       return (item) => {
@@ -424,16 +416,16 @@ export default {
         };
 
         const loadding = this.$loading();
-        const res = await asyncRequest.update(model);
-        if (res && res.code === 0 && res.data) {
+        const {code,data,message} = await asyncRequest.update(model);
+        if (code === 0 && data) {
           this.$notify.success({
             title: "保存成功!",
             message: "",
           });
-        } else if (res && res.code >= 100 && res.code <= 104) {
+        } else if (code >= 100 && code <= 104) {
           await this.logout();
         } else {
-          this.$message.warning(res.message);
+          this.$message.warning(message);
         }
         loadding.close();
       }
@@ -442,11 +434,11 @@ export default {
     async refreshRoleDetail(roleid) {
       this.isBtnDisabled = true;
 
-      const res = await asyncRequest.detail({ roleid: roleid });
+      const {code,data,message} = await asyncRequest.detail({ roleid: roleid });
 
-      if (res && res.code === 0 && res.data) {
-        let resD = res.data;
-        this.ruleForm = resD;
+      if (code === 0 ) {
+        let resD=data
+        this.ruleForm =data;
 
         if (resD.action && resD.action.length > 0) {
           this.action = resD.action;
@@ -469,36 +461,36 @@ export default {
         this.private_field = resD.private_field;
         console.log(this.private_field);
         this.refreshRoleCheckAllStatus();
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
-        this.$message.warning(res.message);
+        this.$message.warning(message);
       }
       this.isBtnDisabled = false;
     },
     // 初始化功能权限列表
     async initactionList() {
-      const res = await asyncRequest.actionList({});
-      if (res && res.code === 0 && res.data) {
-        this.rules = res.data;
+      const {code ,data,message} = await asyncRequest.actionList({});
+      if (code === 0) {
+        this.rules = data;
         await this.initRoleList();
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
-        this.$message.warning(res.message);
+        this.$message.warning(message);
       }
     },
     // 初始化角色列表
     async initRoleList() {
-      const res = await asyncRequest.getRole({});
-      if (res && res.code === 0 && res.data) {
+      const {code ,data,message}= await asyncRequest.getRole({});
+      if (code === 0 && data) {
         this.roleList = [].concat(res.data);
         if (this.roleList.length > 0) {
           await this.switchRoleHandle(this.roleList[0]);
-        } else if (res && res.code >= 100 && res.code <= 104) {
+        } else if (code >= 100 && code <= 104) {
           await this.logout();
         } else {
-          this.$message.warning(res.message);
+          this.$message.warning(message);
         }
       }
     },

+ 11 - 15
src/views/login/index.vue

@@ -118,12 +118,8 @@ export default {
         password: "",
       },
       loginRules: {
-        username: [
-          { required: true, trigger: "blur", validator: validateUsername },
-        ],
-        password: [
-          { required: true, trigger: "blur", validator: validatePassword },
-        ],
+        username: [{ required: true, trigger: "blur", validator: validateUsername }],
+        password: [{ required: true, trigger: "blur", validator: validatePassword }],
       },
       passwordType: "password",
       capsTooltip: false, //绑定在tooltip文字提示的属性。
@@ -156,11 +152,11 @@ export default {
   },
   methods: {
     async getversion() {
-      let res = await asyncRequest.version({});
-      if (res && res.code === 0) {
-        let data = res.data;
-        this.ver = data.version;
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const { code, data, message } = await asyncRequest.version({});
+      if (code === 0) {
+        const { version } = data;
+        this.ver = version;
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -195,11 +191,11 @@ export default {
           this.$store
             .dispatch("user/login", this.loginForm)
             .then((res) => {
-              if (res.code === 0) {
+              const { code, data, message } = res;
+              if (code === 0) {
                 this.getMenu();
               } else {
-                console.log(res);
-                this.$message.warning(res.msg);
+                this.$message.warning(message);
                 this.loading = false;
               }
             })
@@ -240,7 +236,7 @@ export default {
 };
 </script>
 
-<style lang="scss"  scoped>
+<style lang="scss" scoped>
 $bg: #283443;
 // $light_gray: #fff;
 $cursor: #fff;

+ 4 - 4
src/views/mobile/order/addEdit.vue

@@ -185,18 +185,18 @@ export default {
             post_company: obj.post_company,
             post_code: obj.post_code,
           };
-          const res = await asyncRequest.post(model);
-          if (res && res.code === 0) {
+          const {code ,data,message} = await asyncRequest.post(model);
+          if (code === 0) {
             this.$notify.success({
               title: `${this.title}提交成功!`,
               message: "",
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(message);
           }
         } else {
           console.log("error submit!!");

+ 8 - 7
src/views/mobile/order/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="order pagePadding">
+    <tableAuth :show="powers.some((item) => item == '001')" >
     <ex-table
       v-loading="loading"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
       :table="table"
       :data="tableData"
       :columns="columns"
@@ -167,7 +167,7 @@
         </el-tooltip>
       </template>
     </ex-table>
-    <no-auth v-else></no-auth>
+    </tableAuth>
     <!-- 弹窗 新增/修改 -->
     <add-edit
       :id="modelId"
@@ -373,9 +373,10 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0 && data) {
+        const {list,count}=data
+        this.tableData = list;
         this.tableData.forEach((v1) => {
           v1.order_goods_num =
             v1.order_num + v1.unit + "/" + v1.unit_weight + "kg";
@@ -385,8 +386,8 @@ export default {
           
         });
         console.log(this.tableData);
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 19 - 22
src/views/mobile/park/addEdit.vue

@@ -120,10 +120,7 @@
           </el-form>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button
-            v-if="isDetail !== '007'"
-            type="primary"
-            @click="submitForm"
+          <el-button v-if="isDetail !== '007'" type="primary" @click="submitForm"
             >保 存
           </el-button>
           <el-button @click="showModelThis = false">{{
@@ -160,10 +157,7 @@ export default {
         if (value.length > 10) {
           callback(new Error("账号不正确!"));
         } else {
-<<<<<<< HEAD
-=======
-          
->>>>>>> sit
+          callback();
         }
       }
     };
@@ -327,7 +321,7 @@ export default {
       }
     },
   },
-  
+
   methods: {
     restSearch() {
       this.select = "1";
@@ -366,16 +360,18 @@ export default {
     async remoteMethod(query) {
       this.videoForm.video_name = query;
       this.videoForm.size = 100;
-      const res = await asyncRequest.videoList(this.videoForm);
-      this.states = res.data.video;
-      if (res && res.code === 0 && res.data) {
+      const { code, data, message } = await asyncRequest.videoList(this.videoForm);
+
+      if (code === 0) {
+        const { video } = data;
+        this.states = video;
         if (query !== "") {
           this.loading_video_set = true;
-          this.options = res.data.video;
+          this.options = video;
         } else {
           this.options = [];
         }
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
       this.loading_video_set = false;
@@ -401,8 +397,9 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
+      const { code, data, message } = await asyncRequest.detail({ id: this.id });
+
+      if (code === 0) {
         const {
           username,
           info,
@@ -412,7 +409,7 @@ export default {
           nickname,
           mobile,
           remark,
-        } = res.data;
+        } = data;
         this.tags = info;
         let arr = [];
         this.tags.forEach((v1) => {
@@ -430,7 +427,7 @@ export default {
           video: arr,
           id: this.id,
         };
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -492,8 +489,9 @@ export default {
           } else {
             res = await asyncRequest.update(model);
           }
+          const { code, data, message } = res;
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -501,10 +499,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;
@@ -514,4 +512,3 @@ export default {
   },
 };
 </script>
-

+ 31 - 53
src/views/mobile/park/index.vue

@@ -1,13 +1,8 @@
 <template>
   <div class="park pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')">
       <ex-table
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -79,11 +74,7 @@
                   style="width: 80px; padding: 0 0 0 10px"
                   v-if="powers.some((item) => item == '008')"
                 >
-                  <el-button
-                    type="warning"
-                    :size="searchSize"
-                    @click="restSearch"
-                  >
+                  <el-button type="warning" :size="searchSize" @click="restSearch">
                     重置
                   </el-button>
                 </el-col>
@@ -131,8 +122,7 @@
                 : ''
             "
             v-text="
-              (statusList.find((item) => item.id == scope.row.status) || {})
-                .label || '--'
+              (statusList.find((item) => item.id == scope.row.status) || {}).label || '--'
             "
           ></el-tag>
         </template>
@@ -140,12 +130,8 @@
           <span>{{ scope.row.starttime }}~{{ scope.row.expiretime }}</span>
         </template>
         <template #operation="{ scope }">
-           <!-- v-if="roles === 'admin'" -->
-          <el-tooltip
-            effect="dark"
-            content="重置密码"
-            placement="top"
-          >
+          <!-- v-if="roles === 'admin'" -->
+          <el-tooltip effect="dark" content="重置密码" placement="top">
             <i
               class="el-icon-refresh-left tb-icon"
               @click="openPasswordModal(scope.row.id, false)"
@@ -177,26 +163,23 @@
           </el-tooltip>
         </template>
       </ex-table>
-      <add-edit
-        :id="modelId"
-        :sitem="sitem"
-        :show-model="showModel"
-        :is-detail="isDetail"
-        @refresh="searchList"
-        @cancel="showModel = false"
-      />
+    </tableAuth>
+    <add-edit
+      :id="modelId"
+      :sitem="sitem"
+      :show-model="showModel"
+      :is-detail="isDetail"
+      @refresh="searchList"
+      @cancel="showModel = false"
+    />
 
-      <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      />
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
+    <reset-password
+      :id="passwordModelId"
+      :show-model="passwordModel"
+      :is-detail="isPasswordDetail"
+      @refresh="searchList"
+      @cancel="passwordModel = false"
+    />
   </div>
 </template>
 <script>
@@ -218,14 +201,9 @@ export default {
   computed: {
     ...mapGetters(["tablebtnSize", "searchSize", "size", "roles"]),
     powers() {
-      let tran =
-        this.$store.getters.btnList.find((item) => item.menu_route == "park") ||
-        {};
-      if (tran && tran.action && tran.action.length > 0) {
-        return tran.action;
-      } else {
-        return [];
-      }
+      const tran = this.$store.getters.btnList.find((item) => item.menu_route === "park");
+      const { action } = tran || {};
+      return action || [];
     },
   },
   data() {
@@ -365,11 +343,12 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0 ) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];
@@ -380,5 +359,4 @@ export default {
   },
 };
 </script>
-<style lang="scss" scoped>
-</style>
+<style lang="scss" scoped></style>

+ 4 - 4
src/views/mobile/park/resetPassword.vue

@@ -166,9 +166,9 @@ export default {
           this.loading = true;
           let obj = JSON.parse(JSON.stringify(this.ruleForm));
           delete obj["confirmPassword"];
-          const res = await asyncRequest.setpwd(obj);
+          const {code,data,message} = await asyncRequest.setpwd(obj);
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             this.$notify.success({
               title: "密码修改成功!",
               message: "",
@@ -176,10 +176,10 @@ export default {
             this.showModelThis = false;
             // 刷新
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.message);
+            this.$message.warning(message);
           }
         } else {
           console.log("error submit!!");

+ 3 - 3
src/views/mobile/stock/addEdit.vue

@@ -186,9 +186,9 @@ export default {
             type: obj.type,
             stock: obj.stock,
           };
-          let res = await asyncRequest.update(model);
+          const {code,data,message} = await asyncRequest.update(model);
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             const title = "修改成功";
             this.$notify.success({
               title,
@@ -197,7 +197,7 @@ export default {
             this.showModelThis = false;
             // 刷新
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           }
         } else {

+ 6 - 5
src/views/mobile/stock/editRecord.vue

@@ -167,11 +167,12 @@ export default {
     async searchList() {
       this.loading = true;
       this.parmValue.id = this.id;
-      const res = await asyncRequest.log(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.log(this.parmValue);
+      if (code === 0 ) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 8 - 7
src/views/mobile/stock/index.vue

@@ -1,8 +1,8 @@
 <template>
   <div class="stock pagePadding">
+    <tableAuth :show="powers.some((item) => item == '001')" >
     <ex-table
       v-loading="loading"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
       :table="table"
       :data="tableData"
       :columns="columns"
@@ -150,7 +150,7 @@
         </el-tooltip>
       </template>
     </ex-table>
-    <no-auth v-else></no-auth>
+    </tableAuth>
     <!-- 弹窗 新增/修改 -->
     <add-edit
       :id="modelId"
@@ -340,14 +340,15 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0) {
+        const {list,count}=data
+        this.tableData = list;
         this.tableData.forEach((v1) => {
           v1.stock_balance += "kg";
         });
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 10 - 13
src/views/mobile/videos/addEdit.vue

@@ -79,8 +79,7 @@
               </div>
               <div class="txt-tips fl">
                 <p>
-                  <span>大小:小于5MB;</span
-                  ><span>尺寸:250*160,单位:px;</span
+                  <span>大小:小于5MB;</span><span>尺寸:250*160,单位:px;</span
                   ><span>类型:jpg.png.bmp.jpeg</span>
                 </p>
               </div>
@@ -88,10 +87,7 @@
           </el-form>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button
-            v-if="isDetail !== '007'"
-            type="primary"
-            @click="submitForm"
+          <el-button v-if="isDetail !== '007'" type="primary" @click="submitForm"
             >保 存
           </el-button>
           <el-button @click="showModelThis = false">{{
@@ -225,10 +221,10 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-        this.ruleForm = res.data;
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const { code, data, message } = await asyncRequest.detail({ id: this.id });
+      if (code === 0) {
+        this.ruleForm = data;
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -258,8 +254,9 @@ export default {
           } else {
             res = await asyncRequest.update(model);
           }
+          const { code, data, message } = res;
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -267,10 +264,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;

+ 20 - 32
src/views/mobile/videos/index.vue

@@ -1,8 +1,6 @@
 <template>
   <div class="videos pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')" >
       <ex-table
         v-loading="loading"
         :table="table"
@@ -183,6 +181,7 @@
           </el-tag>
         </template>
       </ex-table>
+      </tableAuth>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -192,9 +191,7 @@
         @cancel="showModel = false"
       />
     </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
+  
   </div>
 </template>
 <script>
@@ -312,17 +309,7 @@ export default {
         this.changeBtnStatus(staus, id);
       });
     },
-    msgPop() {
-      this.$alert(res.msg, {
-        confirmButtonText: "确定",
-        callback: (action) => {
-          this.$message({
-            type: "info",
-            message: `action: ${action}`,
-          });
-        },
-      });
-    },
+
     deletePop(id) {
       this.$alert("请确认要删除吗?", "提示", {
         confirmButtonText: "确定",
@@ -352,7 +339,6 @@ export default {
       };
       this.searchList(); //请求接口数据
     },
-    // 打开弹窗,添加-详情-修改-启/禁用-删除按钮
     openModal(id, isDetail, sitem) {
       this.showModel = true;
       this.modelId = id;
@@ -367,14 +353,15 @@ export default {
       };
       changeValue.status = status === "1" ? "0" : "1";
       changeValue.id = id;
-      var res = await asyncRequest.change(changeValue); //请求更新视频接口/admin/Change
-      if (res && res.code === 0 && res.data) {
+      const  {code,data,message} = await asyncRequest.change(changeValue); //请求更新视频接口/admin/Change
+      if (code === 0 ) {
         //正常响应的操作
-      } else if (res && res.code >= 100 && res.code <= 104) {
-        await this.logout(); //登出
+      } else if (code >= 100 && code <= 104) {
+        await this.logout(); 
       } else {
-        this.msgPop(); //警告弹窗,提示接口返回信息
+        this.$message.error(message);
       }
+      
       this.loading = false; //停止loading
       this.searchList();
     },
@@ -384,13 +371,13 @@ export default {
         id: "",
       };
       deleteValue.id = id; //入参
-      var res = await asyncRequest.delete(deleteValue); //调用/admin/Delete接口,
-      if (res && res.code === 0) {
+      const {code,data,message} = await asyncRequest.delete(deleteValue); //调用/admin/Delete接口,
+      if (code === 0) {
         //正常响应后的操作
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 &&code <= 104) {
         await this.logout();
       } else {
-        this.msgPop();
+        this.$message.error(message);
       }
       this.loading = false;
       this.searchList();
@@ -400,11 +387,12 @@ export default {
       this.parmValue.video_name = this.select === "1" ? this.input : ""; //把用户输入的name赋到video_name上
       this.parmValue.video_url = this.select === "2" ? this.input : ""; //赋url
       this.parmValue.video_sn = this.select === "3" ? this.input : ""; //赋video_sn
-      const res = await asyncRequest.list(this.parmValue); //调用视频列表接口/admin/video
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.video; //正常响应把响应数据存到tableData中。
-        this.pageInfo.total = Number(res.data.count); //存入总数据量
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.list(this.parmValue); //调用视频列表接口/admin/video
+      if (code === 0) {
+        const {video,count}=data
+        this.tableData = video; //正常响应把响应数据存到tableData中。
+        this.pageInfo.total = Number(count); //存入总数据量
+      } else if (code >= 100 &&code <= 104) {
         await this.logout(); //超时登出
       } else {
         this.tableData = []; //如果服务器未正常响应且不是登出状态,初始化数据

+ 8 - 7
src/views/superTube/batchAccount/addEdit.vue

@@ -274,9 +274,9 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-        const { testName, nickname, mobile, starttime,expiretime } = res.data;
+      const {code,data,message} = await asyncRequest.detail({ id: this.id });
+      if (code === 0) {
+        const { testName, nickname, mobile, starttime,expiretime } = data;
 
         this.ruleForm = {
           testName,
@@ -285,7 +285,7 @@ export default {
           starttime,
         expiretime,
         };
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -320,8 +320,9 @@ export default {
           } else {
             res = await asyncRequest.update(model);
           }
+          const {code,data,message}=res
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -329,10 +330,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;

+ 11 - 21
src/views/superTube/batchAccount/index.vue

@@ -1,13 +1,8 @@
 <template>
   <div class="batchAccount pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')" >
       <ex-table
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -168,6 +163,7 @@
           </el-tooltip>
         </template>
       </ex-table>
+      </tableAuth>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -177,17 +173,9 @@
         @cancel="showModel = false"
       />
 
-      <!-- <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      /> -->
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
+  
     </div>
+   
   </div>
 </template>
 <script>
@@ -357,11 +345,13 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 8 - 7
src/views/superTube/batchVideo/addEdit.vue

@@ -255,9 +255,9 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-        const { testName, nickname, mobile, remark } = res.data;
+      const {code,data,message} = await asyncRequest.detail({ id: this.id });
+      if (code === 0) {
+        const { testName, nickname, mobile, remark } = data;
 
         this.ruleForm = {
           testName,
@@ -265,7 +265,7 @@ export default {
           mobile,
           remark,
         };
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -300,7 +300,8 @@ export default {
             res = await asyncRequest.update(model);
           }
           this.loading = false;
-          if (res && res.code === 0) {
+          const {code,data,message}=res
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -308,10 +309,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;

+ 11 - 21
src/views/superTube/batchVideo/index.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="batchVideo pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')" >
       <ex-table
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
+       
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -218,6 +214,7 @@
           </el-tooltip>
         </template>
       </ex-table>
+    </tableAuth>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -227,17 +224,9 @@
         @cancel="showModel = false"
       />
 
-      <!-- <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      /> -->
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
+    
     </div>
+   
   </div>
 </template>
 <script>
@@ -418,11 +407,12 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 8 - 7
src/views/superTube/enterPrise/addEdit.vue

@@ -235,14 +235,14 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
+      const {code,data,message} = await asyncRequest.detail({ id: this.id });
+      if (code === 0) {
         const {
          testName,
           nickname,
           mobile,
           remark,
-        } = res.data;
+        } = data;
        
         this.ruleForm = {
 
@@ -251,7 +251,7 @@ export default {
           mobile,
           remark,
         };
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -287,8 +287,9 @@ export default {
           } else {
             res = await asyncRequest.update(model);
           }
+          const {code,data,message}=res
           this.loading = false;
-          if (res && res.code === 0) {
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -296,10 +297,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;

+ 12 - 22
src/views/superTube/enterPrise/index.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="enterPrise pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')" >
       <ex-table
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
+     
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -168,6 +164,7 @@
           </el-tooltip>
         </template>
       </ex-table>
+      </tableAuth>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -177,17 +174,9 @@
         @cancel="showModel = false"
       />
 
-      <!-- <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      /> -->
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
+   
+  
+   
   </div>
 </template>
 <script>
@@ -357,11 +346,12 @@ export default {
       this.parmValue.username = this.select === "1" ? this.input : "";
       this.parmValue.nickname = this.select === "2" ? this.input : "";
       this.parmValue.mobile = this.select === "3" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0 ) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 24 - 18
src/views/superTube/role/addEdit.vue

@@ -25,7 +25,12 @@
             class="demo-ruleForm"
           >
             <el-form-item label="业务企业" prop="testName">
-              <exSelect :type="isDetail" :dataList="test" :seleValue="ruleForm.testName" @selectFn = "selectFn" />
+              <exSelect
+                :type="isDetail"
+                :dataList="test"
+                :seleValue="ruleForm.testName"
+                @selectFn="selectFn"
+              />
             </el-form-item>
             <!-- <el-form-item label="企业名称" prop="testName">
               <el-input
@@ -35,7 +40,12 @@
               />
             </el-form-item> -->
             <el-form-item label="联系人" prop="nickname">
-              <exSelect :type="isDetail" :dataList="test" :seleValue="ruleForm.nickname" @selectFn = "selectFn1" />
+              <exSelect
+                :type="isDetail"
+                :dataList="test"
+                :seleValue="ruleForm.nickname"
+                @selectFn="selectFn1"
+              />
             </el-form-item>
             <el-form-item label="手机号" prop="mobile">
               <el-input
@@ -58,10 +68,7 @@
           </el-form>
         </el-col>
         <el-col :span="24" style="text-align: right">
-          <el-button
-            v-if="isDetail !== '007'"
-            type="primary"
-            @click="submitForm"
+          <el-button v-if="isDetail !== '007'" type="primary" @click="submitForm"
             >保 存
           </el-button>
           <el-button @click="showModelThis = false">{{
@@ -126,7 +133,7 @@ export default {
       }
     };
     return {
-      seleValue:"2",
+      seleValue: "2",
       test: [
         { value: "1", label: "哈哈" },
         { value: "2", label: "AG" },
@@ -164,7 +171,6 @@ export default {
             validator: validatetestName,
             // trigger: "change",
             trigger: "blur",
-
           },
         ],
         nickname: [
@@ -206,11 +212,11 @@ export default {
   },
 
   methods: {
-    selectFn(val){
+    selectFn(val) {
       this.ruleForm.testName = val;
       this.$refs.ruleForm.validateField("testName");
     },
-    selectFn1(val){
+    selectFn1(val) {
       this.ruleForm.nickname = val;
       this.$refs.ruleForm.validateField("nickname");
     },
@@ -253,9 +259,9 @@ export default {
       this.loading = false;
     },
     async initData() {
-      const res = await asyncRequest.detail({ id: this.id });
-      if (res && res.code === 0 && res.data) {
-        const { testName, nickname, mobile, remark } = res.data;
+      const { code, data, message } = await asyncRequest.detail({ id: this.id });
+      if (code === 0) {
+        const { testName, nickname, mobile, remark } = data;
 
         this.ruleForm = {
           testName,
@@ -263,7 +269,7 @@ export default {
           mobile,
           remark,
         };
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
     },
@@ -298,7 +304,8 @@ export default {
             res = await asyncRequest.update(model);
           }
           this.loading = false;
-          if (res && res.code === 0) {
+          const { code, data, message } = res;
+          if (code === 0) {
             const title = this.id === "add" ? "添加成功" : "修改成功";
             this.$notify.success({
               title,
@@ -306,10 +313,10 @@ export default {
             });
             this.showModelThis = false;
             this.$emit("refresh");
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
-            this.$message.warning(res.msg);
+            this.$message.warning(message);
           }
         } else {
           return false;
@@ -319,4 +326,3 @@ export default {
   },
 };
 </script>
-

+ 12 - 22
src/views/superTube/role/index.vue

@@ -1,13 +1,9 @@
 <template>
   <div class="batchVideo pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')" >
       <ex-table
         v-loading="loading"
-        v-if="
-          powers && powers.length > 0 && powers.some((item) => item == '001')
-        "
+      
         :table="table"
         :data="tableData"
         :columns="columns"
@@ -224,6 +220,7 @@
           </el-tooltip>
         </template>
       </ex-table>
+    </tableAuth>
       <add-edit
         :id="modelId"
         :sitem="sitem"
@@ -233,17 +230,9 @@
         @cancel="showModel = false"
       />
 
-      <!-- <reset-password
-        :id="passwordModelId"
-        :show-model="passwordModel"
-        :is-detail="isPasswordDetail"
-        @refresh="searchList"
-        @cancel="passwordModel = false"
-      /> -->
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
+    
+    
+    
   </div>
 </template>
 <script>
@@ -424,11 +413,12 @@ export default {
     async searchList() {
       this.loading = true;
       this.parmValue.username = this.select === "1" ? this.input : "";
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const {code,data,message} = await asyncRequest.list(this.parmValue);
+      if (code === 0 ) {
+        const {list,count}=data
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 4 - 7
src/views/system/menuOperator/addEdit.vue

@@ -378,7 +378,6 @@ export default {
         };
       }
       console.log(this.ruleForm);
-      // // let res = await asyncRequest.detail({ id });
       this.loading = false;
       await this.$nextTick(() => {
         if (this.$refs.ruleForm) {
@@ -386,9 +385,6 @@ export default {
           this.$refs.ruleForm.clearValidate();
         }
       });
-      // if (res.code === 0) {
-      //   this.ruleForm = res.data;
-      // }
     },
     async resetForm() {
       let parentIds = "";
@@ -484,7 +480,8 @@ export default {
             }
           }
           this.loading = false;
-          if (res && res.code === 0) {
+          const {code,data,message}=res
+          if (code === 0) {
             this.ruleForm = {};
             const title = this.isAdd ? "添加成功" : "修改成功";
             this.$notify.success({
@@ -499,13 +496,13 @@ export default {
               pids = "0";
             }
             this.$emit("refresh", this.id, pids, this.level);
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           } else {
             const title = this.isAdd ? "添加失败" : "修改失败";
             this.$notify.warning({
               title,
-              message: res.message,
+              message: message,
             });
           }
         } else {

+ 41 - 53
src/views/system/menuOperator/index.vue

@@ -1,8 +1,6 @@
 <template>
   <div class="box pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')">
       <el-row :gutter="10">
         <el-col :span="24" style="padding: 5px">
           <el-col :span="3" style="width: 195px; float: right">
@@ -16,7 +14,7 @@
               刷新
             </el-button>
             <el-button
-              v-if="powers.some((item) => item == '003')&&roles==='admin'"
+              v-if="powers.some((item) => item == '003') && roles === 'admin'"
               type="success"
               :size="searchSize"
               style="float: right"
@@ -42,23 +40,19 @@
           />
         </el-col>
       </el-row>
-
-      <add-edit
-        :id="modelId"
-        :show-model="showModel"
-        :level="level"
-        :parent-ids="parentIds"
-        :is-add="isAdd"
-        :form-data="formData"
-        :type="parmValue.type"
-        :is-detail="isDetail"
-        @refresh="submitRefresh"
-        @cancel="showModel = false"
-      />
-    </div>
-    <div v-else>
-      <no-auth></no-auth>
-    </div>
+    </tableAuth>
+    <add-edit
+      :id="modelId"
+      :show-model="showModel"
+      :level="level"
+      :parent-ids="parentIds"
+      :is-add="isAdd"
+      :form-data="formData"
+      :type="parmValue.type"
+      :is-detail="isDetail"
+      @refresh="submitRefresh"
+      @cancel="showModel = false"
+    />
   </div>
 </template>
 
@@ -75,12 +69,11 @@ export default {
   },
   mixins: [mixinPage, resToken],
   computed: {
-    ...mapGetters(["tablebtnSize", "searchSize", "size","roles"]),
+    ...mapGetters(["tablebtnSize", "searchSize", "size", "roles"]),
     powers() {
       let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "menuOperator"
-        ) || {};
+        this.$store.getters.btnList.find((item) => item.menu_route == "menuOperator") ||
+        {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
       } else {
@@ -134,13 +127,10 @@ export default {
       this.formData = formData;
     },
     submitRefresh(id, parentIds, level) {
-      console.log(
-        `openChildren-id, parentIds, level:${id}-${parentIds}-${level}`
-      );
+      console.log(`openChildren-id, parentIds, level:${id}-${parentIds}-${level}`);
       if (level < 3) {
         this.restSearch();
-      }
-      else {
+      } else {
         this.getchildList(parentIds);
       }
     },
@@ -164,8 +154,8 @@ export default {
           } else {
             res = await asyncRequest.menustatus(model);
           }
-
-          if (res && res.code === 0) {
+          const { code, data, message } = res;
+          if (code === 0) {
             this.$notify.success({
               title: "修改成功!",
               message: "",
@@ -175,7 +165,7 @@ export default {
             } else {
               this.restSearch();
             }
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           }
         })
@@ -194,7 +184,7 @@ export default {
       })
         .then(async () => {
           const model = {
-            id: id
+            id: id,
           };
           let res = {};
           if (level === 3) {
@@ -202,8 +192,8 @@ export default {
           } else {
             res = await asyncRequest.menudel(model);
           }
-
-          if (res && res.code === 0) {
+          const { code, data, message } = res;
+          if (code === 0) {
             this.$notify.success({
               title: "删除成功!",
               message: "",
@@ -213,7 +203,7 @@ export default {
             } else {
               this.restSearch();
             }
-          } else if (res && res.code >= 100 && res.code <= 104) {
+          } else if (code >= 100 && code <= 104) {
             await this.logout();
           }
         })
@@ -223,9 +213,7 @@ export default {
     },
     openChildren(id, parentIds, level, isOpen) {
       if (isOpen) {
-        console.log(
-          `openChildren-id, parentIds, level:${id}-${parentIds}-${level}`
-        );
+        console.log(`openChildren-id, parentIds, level:${id}-${parentIds}-${level}`);
         if (level === 1) {
           this.tableData = this.tableData.map((v) => {
             if (v.id === id) {
@@ -254,11 +242,11 @@ export default {
     },
     async getchildList(id) {
       this.loading = true;
-      const res = await asyncRequest.actionList({ id: id });
+      const { code, data, message } = await asyncRequest.actionList({ id: id });
       let tableData = [];
-      if (res && res.code === 0 && res.data) {
-        tableData = res.data;
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      if (code === 0) {
+        tableData = data;
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
       let arr = JSON.parse(JSON.stringify(this.tableData));
@@ -277,13 +265,13 @@ export default {
       this.loading = false;
     },
     async concatData(id, parentIds, level) {
-      console.log(id, parentIds, level);
+      // console.log(id, parentIds, level);
       this.loading = true;
-      const res = await asyncRequest.list({});
+      const { code, data, message } = await asyncRequest.list({});
       let tableData = [];
-      if (res && res.code === 0 && res.data) {
-        tableData = res.data;
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      if (code === 0) {
+        tableData = data;
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       }
       let arr = JSON.parse(JSON.stringify(this.tableData));
@@ -299,11 +287,11 @@ export default {
     },
     async searchList() {
       this.loading = true;
-      const res = await asyncRequest.list({});
+      const {code,data,message} = await asyncRequest.list({});
       this.tableData = [];
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data;
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      if (code === 0 ) {
+        this.tableData = data;
+      } else if (code >= 100 &&code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];

+ 119 - 122
src/views/system/oplog/index.vue

@@ -1,119 +1,119 @@
 <template>
   <div class="oplog pagePadding">
-    <ex-table
-      v-loading="loading"
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-      :table="table"
-      :data="tableData"
-      :columns="columns"
-      :page="pageInfo"
-      :size="size"
-      @page-curr-change="handlePageChange"
-      @page-size-change="handleSizeChange"
-      @screen-reset="
-        pageInfo.curr = 1;
-        searchList();
-      "
-      @screen-submit="
-        pageInfo.curr = 1;
-        searchList();
-      "
-    >
-      <template #table-header="{}">
-        <div style="width: 100%">
-          <el-row>
-            <el-col :span="24" style="padding: 0 0 10px 0">
-              <el-col :span="6" style="width: 302px; padding: 0 0 0 0px">
-                <period-date-picker
-                  :start="parmValue.lowtime"
-                  :end="parmValue.uptime"
-                  :type="1"
-                  :width="'140px'"
-                  :size="searchSize"
-                  @timeReturned="timeReturned($event)"
-                />
-              </el-col>
-              <el-col :span="6" style="width: 320px; padding: 0 0 0 10px">
-                <el-cascader
-                  clearable
-                  @change="searchList()"
-                  style="width: 100%"
-                  :size="searchSize"
-                  placeholder="请选择操作模块/功能"
-                  v-model="parmValue.moudel"
-                  :options="options"
-                  :props="{ checkStrictly: true }"
-                ></el-cascader>
-              </el-col>
-
-              <el-col
-                :span="3"
-                v-if="powers.some((item) => item == '008')"
-                style="width: 80px; float: right; padding: 0 0 0 0"
-              >
-                <el-button
-                  class="fr"
-                  type="warning"
-                  :size="searchSize"
-                  @click="restSearch"
-                >
-                  重置
-                </el-button>
-              </el-col>
-            </el-col>
-            <el-col :span="24">
-              <el-col :span="4" style="width: 150px">
-                <el-select
-                  :size="searchSize"
-                  v-model="parmValue.role"
-                  filterable
-                  clearable
-                  placeholder="角色类型"
-                  style="width: 100%"
-                >
-                  <el-option
-                    v-for="item in statusList"
-                    :key="'status' + item.id"
-                    :label="item.label"
-                    :value="item.id"
+    <tableAuth :show="powers.some((item) => item == '001')">
+      <ex-table
+        v-loading="loading"
+        :table="table"
+        :data="tableData"
+        :columns="columns"
+        :page="pageInfo"
+        :size="size"
+        @page-curr-change="handlePageChange"
+        @page-size-change="handleSizeChange"
+        @screen-reset="
+          pageInfo.curr = 1;
+          searchList();
+        "
+        @screen-submit="
+          pageInfo.curr = 1;
+          searchList();
+        "
+      >
+        <template #table-header="{}">
+          <div style="width: 100%">
+            <el-row>
+              <el-col :span="24" style="padding: 0 0 10px 0">
+                <el-col :span="6" style="width: 302px; padding: 0 0 0 0px">
+                  <period-date-picker
+                    :start="parmValue.lowtime"
+                    :end="parmValue.uptime"
+                    :type="1"
+                    :width="'140px'"
+                    :size="searchSize"
+                    @timeReturned="timeReturned($event)"
                   />
-                </el-select>
-              </el-col>
-              <el-col :span="6" style="width: 350px; padding: 0 0 0 10px">
-                <el-input
-                  :size="searchSize"
-                  placeholder="请输入账户名"
-                  v-model="parmValue.username"
-                  class="input-with-select"
+                </el-col>
+                <el-col :span="6" style="width: 320px; padding: 0 0 0 10px">
+                  <el-cascader
+                    clearable
+                    @change="searchList()"
+                    style="width: 100%"
+                    :size="searchSize"
+                    placeholder="请选择操作模块/功能"
+                    v-model="parmValue.moudel"
+                    :options="options"
+                    :props="{ checkStrictly: true }"
+                  ></el-cascader>
+                </el-col>
+
+                <el-col
+                  :span="3"
+                  v-if="powers.some((item) => item == '008')"
+                  style="width: 80px; float: right; padding: 0 0 0 0"
                 >
                   <el-button
-                    slot="append"
-                    @click.native="searchList"
-                    icon="el-icon-search"
-                  ></el-button>
-                </el-input>
+                    class="fr"
+                    type="warning"
+                    :size="searchSize"
+                    @click="restSearch"
+                  >
+                    重置
+                  </el-button>
+                </el-col>
               </el-col>
+              <el-col :span="24">
+                <el-col :span="4" style="width: 150px">
+                  <el-select
+                    :size="searchSize"
+                    v-model="parmValue.role"
+                    filterable
+                    clearable
+                    placeholder="角色类型"
+                    style="width: 100%"
+                  >
+                    <el-option
+                      v-for="item in statusList"
+                      :key="'status' + item.id"
+                      :label="item.label"
+                      :value="item.id"
+                    />
+                  </el-select>
+                </el-col>
+                <el-col :span="6" style="width: 350px; padding: 0 0 0 10px">
+                  <el-input
+                    :size="searchSize"
+                    placeholder="请输入账户名"
+                    v-model="parmValue.username"
+                    class="input-with-select"
+                  >
+                    <el-button
+                      slot="append"
+                      @click.native="searchList"
+                      icon="el-icon-search"
+                    ></el-button>
+                  </el-input>
+                </el-col>
 
-              <el-col
-                :span="3"
-                v-if="powers.some((item) => item == '002')"
-                style="width: 80px; float: right; padding: 0 0 0 0"
-              >
-                <el-button
-                  :size="searchSize"
-                  type="primary"
-                  style="float: right; margin: 0"
-                  @click="searchList"
+                <el-col
+                  :span="3"
+                  v-if="powers.some((item) => item == '002')"
+                  style="width: 80px; float: right; padding: 0 0 0 0"
                 >
-                  刷新
-                </el-button>
+                  <el-button
+                    :size="searchSize"
+                    type="primary"
+                    style="float: right; margin: 0"
+                    @click="searchList"
+                  >
+                    刷新
+                  </el-button>
+                </el-col>
               </el-col>
-            </el-col>
-          </el-row>
-        </div>
-      </template>
-    </ex-table>
-    <no-auth v-else></no-auth>
+            </el-row>
+          </div>
+        </template>
+      </ex-table>
+    </tableAuth>
   </div>
 </template>
 <script>
@@ -135,9 +135,7 @@ export default {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "oplog"
-        ) || {};
+        this.$store.getters.btnList.find((item) => item.menu_route == "oplog") || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
       } else {
@@ -264,9 +262,9 @@ export default {
      * 获取模块列表
      */
     async getmoudel() {
-      const res = await asyncRequest.moudel({});
-      if (res && res.code === 0 && res.data) {
-        let list = res.data;
+      const { code, data, message } = await asyncRequest.moudel({});
+      if (code === 0) {
+        let list = data;
         list.forEach((v1) => {
           let model = Object.assign({}, v1);
           if (model.children && model.children.length === 0) {
@@ -275,7 +273,7 @@ export default {
           this.options.push(model);
         });
         this.searchList();
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.options = [];
@@ -290,11 +288,12 @@ export default {
       item.moudel = list.length > 0 ? list[0] : "";
       item.action = list.length > 1 ? list[1] : "";
       console.log(item);
-      const res = await asyncRequest.list(item);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.pageInfo.total = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const { code, data, message } = await asyncRequest.list(item);
+      if (code === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.pageInfo.total = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];
@@ -306,6 +305,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
-</style>
-
+<style lang="scss" scoped></style>

+ 11 - 27
src/views/system/updates/index.vue

@@ -1,8 +1,6 @@
 <template>
   <div class="updates pagePadding">
-    <div
-      v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
-    >
+    <tableAuth :show="powers.some((item) => item == '001')">
       <el-table
         :data="tableData"
         v-loading="loading"
@@ -13,12 +11,7 @@
       >
         <el-table-column type="expand">
           <template slot-scope="props">
-            <el-form
-              :size="size"
-              label-position="top"
-              inline
-              class="demo-table-expand"
-            >
+            <el-form :size="size" label-position="top" inline class="demo-table-expand">
               <el-form-item label="更新内容">
                 <p v-html="props.row.content"></p>
               </el-form-item>
@@ -45,8 +38,7 @@
           :total="count"
         ></el-pagination>
       </div>
-    </div>
-    <no-auth v-else></no-auth>
+    </tableAuth>
   </div>
 </template>
 <script>
@@ -66,9 +58,7 @@ export default {
     ...mapGetters(["tablebtnSize", "searchSize", "size"]),
     powers() {
       let tran =
-        this.$store.getters.btnList.find(
-          (item) => item.menu_route == "updates"
-        ) || {};
+        this.$store.getters.btnList.find((item) => item.menu_route == "updates") || {};
       if (tran && tran.action && tran.action.length > 0) {
         return tran.action;
       } else {
@@ -110,11 +100,12 @@ export default {
     // 刷新表格
     async searchList() {
       this.loading = true;
-      const res = await asyncRequest.list(this.parmValue);
-      if (res && res.code === 0 && res.data) {
-        this.tableData = res.data.list;
-        this.count = Number(res.data.count);
-      } else if (res && res.code >= 100 && res.code <= 104) {
+      const { code, data, message } = await asyncRequest.list(this.parmValue);
+      if (code === 0) {
+        const { list, count } = data;
+        this.tableData = list;
+        this.count = Number(count);
+      } else if (code >= 100 && code <= 104) {
         await this.logout();
       } else {
         this.tableData = [];
@@ -126,11 +117,4 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped>
-</style>
-
-
-
-
-
-
+<style lang="scss" scoped></style>