Ver código fonte

解开token注释

zhaojijng 2 anos atrás
pai
commit
0aa0ee86ba

+ 2 - 2
src/app.tsx

@@ -41,7 +41,7 @@ export async function getInitialState(): Promise<{
   const fetchUser = async () => {
     try {
       access_token = localStorage.getItem('access_token');
-      if (!access_token) return; //随后去掉
+      //if (!access_token) return; //随后去掉
       const res = await checkToken({ token: access_token });
       var resUser = res.data;
     } catch (err) {
@@ -76,7 +76,7 @@ export async function getInitialState(): Promise<{
     //20分钟后再执行
     setTimeout(() => {
       reFreshUser();
-    }, 12000);
+    }, 1200000);
   };
 
   await reFreshUser();

+ 2 - 2
src/config/api.js

@@ -1,3 +1,3 @@
 export const BASE_PATH = '/api';
- export const projectId = 'Pj3301100002';//之江
-//export  const projectId = 'Pj1101080259';
+export const projectId = 'Pj3301100002';//之江
+//export const projectId = 'Pj1101080259';

+ 2 - 2
src/pages/Equipment/checLampStatus.js

@@ -63,9 +63,9 @@ export const judgeChangeResponeseSuccess = (response, paramsArr, fn) => {
 
 //  开关
 export const setallLamps = (paramsArr, fn, waitSetResultFlag) => {
-    debugger;
+    //debugger;
     setallLampHttp(paramsArr).then((res) => {
-        debugger;
+        //debugger;
         waitSetResultFlag && (waitSetResultFlag.current = false);
         judgeChangeResponeseSuccess(res, paramsArr, fn);
     });

+ 14 - 14
src/pages/Equipment/components/topNavRight/index.tsx

@@ -46,10 +46,10 @@ const TopNavRight: React.FC<topNavRightProps> = ({
         var filterSpaceArr = mapList.filter((item) => {
           return item[selNavObj.id] !== 1;
         });
-        var filterSpaceArr2 = filterSpaceArr.filter((item) => {
-          return item.localName == '图书休闲区' || item.localName == '上格云3';
-        });
-        console.log('开启filterSpaceArr', filterSpaceArr2);
+        // var filterSpaceArr2 = filterSpaceArr.filter((item) => {
+        //   return item.localName == '图书休闲区' || item.localName == '上格云3';
+        // });
+        console.log('开启filterSpaceArr', filterSpaceArr);
         function getDeviceStatus() {
           var interval = setInterval(() => {
             queryDeviceManage();
@@ -62,13 +62,13 @@ const TopNavRight: React.FC<topNavRightProps> = ({
         //如果是空调
         if (filterSpaceArr.length == 0) return;
         if (selNavObj.id == 'airConditioner') {
-          changeAllAir(filterSpaceArr2, getDeviceStatus, '打开', projectId);
+          changeAllAir(filterSpaceArr, getDeviceStatus, '打开', projectId);
         }
         if (selNavObj.id == 'light') {
-          changeLight('all', filterSpaceArr2, getDeviceStatus, '打开');
+          changeLight('all', filterSpaceArr, getDeviceStatus, '打开');
         }
         if (selNavObj.id == 'curtain') {
-          changeCurtain('all', filterSpaceArr2, getDeviceStatus, '打开'); // '关闭' : '打开';
+          changeCurtain('all', filterSpaceArr, getDeviceStatus, '打开'); // '关闭' : '打开';
         }
       },
       onCancel() {
@@ -90,10 +90,10 @@ const TopNavRight: React.FC<topNavRightProps> = ({
         var filterSpaceArr = mapList.filter((item) => {
           return item[selNavObj.id] !== 0;
         });
-        var filterSpaceArr2 = filterSpaceArr.filter((item) => {
-          return item.localName == '图书休闲区' || item.localName == '上格云3';
-        });
-        console.log('关闭filterSpaceArr', filterSpaceArr2);
+        // var filterSpaceArr2 = filterSpaceArr.filter((item) => {
+        //   return item.localName == '图书休闲区' || item.localName == '上格云3';
+        // });
+        console.log('关闭filterSpaceArr', filterSpaceArr);
         //return;
         function getDeviceStatus() {
           var interval = setInterval(() => {
@@ -106,13 +106,13 @@ const TopNavRight: React.FC<topNavRightProps> = ({
         }
         //如果是空调
         if (selNavObj.id == 'airConditioner') {
-          changeAllAir(filterSpaceArr2, getDeviceStatus, '打开', projectId);
+          changeAllAir(filterSpaceArr, getDeviceStatus, '关闭', projectId);
         }
         if (selNavObj.id == 'light') {
-          changeLight('all', filterSpaceArr2, getDeviceStatus, '关闭');
+          changeLight('all', filterSpaceArr, getDeviceStatus, '关闭');
         }
         if (selNavObj.id == 'curtain') {
-          changeCurtain('all', filterSpaceArr2, getDeviceStatus, '关闭');
+          changeCurtain('all', filterSpaceArr, getDeviceStatus, '关闭');
         }
       },
       onCancel() {

+ 1 - 1
src/pages/Equipment/equipmentControl.js

@@ -16,7 +16,7 @@ import { setallLamps } from '@/pages/Equipment/checLampStatus.js';
 //开关 单个或者全部灯
 export const changeLight = (type, itemarr, getDeviceStatus, status) => {
     //const { initialState } = useModel('@@initialState');//这里面不能这么用
-    debugger;
+    //debugger;
     const setType = status === '打开' ? true : false; // 10关闭 12开启
     var paramsArr = [];
     itemarr.forEach((citem) => {