shenwu 2 лет назад
Родитель
Сommit
92cd912a8f

+ 3 - 3
config/routerConfig.ts

@@ -54,18 +54,18 @@ function getMyMenu(code: any, data: any,) {
     if (code === 200) {
         let new_data: any[] = []
         // 循环判断不为空的主菜单加入
-        Object.keys(data).reverse().map((key) => {
+        Object.keys(data)?.reverse()?.map((key) => {
             if (Array.isArray(data[key]) && data[key]?.length > 0) {
                 new_data.push(data[key][0])
             }
         })
         // 处理顺序
-        new_data = new_data.sort((a, b) => {
+        new_data = new_data?.sort((a, b) => {
             let v1 = a.orderNum
             let v2 = b.orderNum
             return v1 - v2
         })
-        new_data.forEach((items: any) => {
+        new_data?.forEach((items: any) => {
             if (items?.children?.length === 0) {//假如路由的子路由只有一个代表当前组件没有子路由,将children中的component组件路径给外层component
                 newData.push({ path: items.children[0].path, name: items.meta.title, icon: items.meta.icon, component: items.children[0].component, key: items.menuId })  // roles: roles
             }

+ 9 - 9
src/models/useOperating/useExamine.ts

@@ -48,15 +48,15 @@ export default function useWxGroupList() {
     const putReviewInteract = useAjax((params) => reviewInteract(params))
     const lookInteract = useAjax((params) => seeInteract(params))
     /**设置公众号列表*/
-    useEffect(() => {
-        if (state?.userList?.length === 0 && sessionStorage.getItem('Admin-Token')) {
-            ajaxUserList.run().then((data: any[]) => {
-                if (data?.length > 0) {
-                    dispatch({ type: 'set', params: { userList: data } })
-                }
-            })
-        }
-    }, [state.userList])
+    // useEffect(() => {
+    //     if (state?.userList?.length === 0 && sessionStorage.getItem('Admin-Token')) {
+    //         ajaxUserList.run().then((data: any[]) => {
+    //             if (data?.length > 0) {
+    //                 dispatch({ type: 'set', params: { userList: data } })
+    //             }
+    //         })
+    //     }
+    // }, [state.userList])
     return {
         state,
         dispatch,

+ 41 - 41
src/models/useOperating/useWxGroupList.ts

@@ -144,47 +144,47 @@ export default function useWxGroupList() {
         console.log('请求版本号对比!');
       }, 1000 * 60 * 5); //5分钟请求一次
       ///
-      getDataList.run().then((res: any) => {
-        if (res && res?.length > 0) {
-          let allWx: any[] = [];
-          res?.forEach((item: any, index: number) => {
-            if (ok && item?.mpAccounts?.length > 0) {
-              ok = false;
-              actionWx(item?.mpAccounts[0]);
-            }
-            item?.mpAccounts?.forEach((list: any) => {
-              if (allWx.every((wx: { id: number }) => wx.id !== list.id)) {
-                allWx.push(list);
-              }
-            });
-          });
-          dispatch({
-            type: 'myallOfUser',
-            params: { myallOfUser: [{ key: res[0]?.operUserInfo, value: res[0]?.mpAccounts }] },
-          });
-          dispatch({ type: 'allWx', params: { allWx } });
-        }
-      });
-      getAllZhMemBer.run()
-      getAllOfMember.run().then((res) => {
-        let groupAllWx: any[] = [];
-        res?.forEach((item: any) => {
-          if (ok && item?.value?.length > 0) {
-            //假如自己没有绑定公众号,那就从组员中寻找
-            ok = false;
-            actionWx(item?.value[0]);
-            dispatch({ type: 'setTabsKey', params: { tabsKey: '组员' } });
-          }
-          item?.value?.filter((v: any) => !!v)?.forEach((list: any) => {
-            if (groupAllWx?.every((wx: { id: number }) => wx.id !== list.id)) {
-              groupAllWx.push(list);
-            }
-          });
-        });
-        // console.log('getAllOfMember',groupAllWx)
-        dispatch({ type: 'allOfMember', params: { allOfMember: res } });
-        dispatch({ type: 'groupAllWx', params: { groupAllWx } });
-      });
+      // getDataList.run().then((res: any) => {
+      //   if (res && res?.length > 0) {
+      //     let allWx: any[] = [];
+      //     res?.forEach((item: any, index: number) => {
+      //       if (ok && item?.mpAccounts?.length > 0) {
+      //         ok = false;
+      //         actionWx(item?.mpAccounts[0]);
+      //       }
+      //       item?.mpAccounts?.forEach((list: any) => {
+      //         if (allWx.every((wx: { id: number }) => wx.id !== list.id)) {
+      //           allWx.push(list);
+      //         }
+      //       });
+      //     });
+      //     dispatch({
+      //       type: 'myallOfUser',
+      //       params: { myallOfUser: [{ key: res[0]?.operUserInfo, value: res[0]?.mpAccounts }] },
+      //     });
+      //     dispatch({ type: 'allWx', params: { allWx } });
+      //   }
+      // });
+      // getAllZhMemBer.run()
+      // getAllOfMember.run().then((res) => {
+      //   let groupAllWx: any[] = [];
+      //   res?.forEach((item: any) => {
+      //     if (ok && item?.value?.length > 0) {
+      //       //假如自己没有绑定公众号,那就从组员中寻找
+      //       ok = false;
+      //       actionWx(item?.value[0]);
+      //       dispatch({ type: 'setTabsKey', params: { tabsKey: '组员' } });
+      //     }
+      //     item?.value?.filter((v: any) => !!v)?.forEach((list: any) => {
+      //       if (groupAllWx?.every((wx: { id: number }) => wx.id !== list.id)) {
+      //         groupAllWx.push(list);
+      //       }
+      //     });
+      //   });
+      //   // console.log('getAllOfMember',groupAllWx)
+      //   dispatch({ type: 'allOfMember', params: { allOfMember: res } });
+      //   dispatch({ type: 'groupAllWx', params: { groupAllWx } });
+      // });
       function canvas(dom: any, txt: any) {
         if (!dom) return false;
         let length = txt.length * 50 > 247 ? txt.length * 50 : 247; // 根据内容生成画布大小,20代表比例