Browse Source

去掉debugger

zhaojijng 2 years ago
parent
commit
82830d0e5f
3 changed files with 10 additions and 9 deletions
  1. 1 2
      src/app.tsx
  2. 1 1
      src/components/map/index.tsx
  3. 8 6
      src/pages/Equipment/equipmentControl.js

+ 1 - 2
src/app.tsx

@@ -19,7 +19,6 @@ export async function getInitialState(): Promise<{
   //loading?: boolean;
   //fetchUserInfo?: () => Promise<API.CurrentUser | undefined>;
 }> {
-  debugger;
   const { location } = history;
 
   let access_token: any = location.query.access_token;
@@ -41,7 +40,6 @@ export async function getInitialState(): Promise<{
 
   const fetchUser = async () => {
     try {
-      debugger;
       access_token = localStorage.getItem('access_token');
       const res = await checkToken({ token: access_token });
       var resUser = res.data;
@@ -71,6 +69,7 @@ export async function getInitialState(): Promise<{
     if (res.refresh_token) {
       console.log('refresh_token', res.refresh_token);
       localStorage.setItem('refresh_token', res.refresh_token);
+      localStorage.setItem('access_token', res.access_token);
     } else {
       //如果刷新token失败
       //history.push(loginPath);

+ 1 - 1
src/components/map/index.tsx

@@ -172,7 +172,7 @@ const Map: React.FC<MapProps> = ({ type, selFloorId, render, mapList, mapSize })
       var mapWrapHeight = (mapRef.current || {}).clientHeight || 0;
       //   left = left * mscale + mapWrapWidth / 2;
       //   top = top * mscale + mapWrapHeight / 2;
-      debugger;
+
       setTranslateX(left * mscale + mapWrapWidth / 2);
       setTranslateY(top * mscale + mapWrapHeight / 2);
       changeSearchBuildId(''); //清空搜索记录  以防两次搜索一样的建筑的 没反应

+ 8 - 6
src/pages/Equipment/equipmentControl.js

@@ -15,6 +15,8 @@ import { setallLamps } from '@/pages/Equipment/checLampStatus.js';
 
 //开关 单个或者全部灯
 export const changeLight = (type, itemarr, getDeviceStatus, status) => {
+    //const { initialState } = useModel('@@initialState');//这里面不能这么用
+
     const setType = status === '打开' ? true : false; // 10关闭 12开启
     var paramsArr = [];
     itemarr.forEach((citem) => {
@@ -28,7 +30,7 @@ export const changeLight = (type, itemarr, getDeviceStatus, status) => {
         });
     });
 
-    setallLamps(paramsArr, getDeviceStatus);
+      setallLamps(paramsArr, getDeviceStatus);
 };
 
 //开关 单个或者全部窗帘      0是关闭 1 是开启  2 是部分开启
@@ -118,12 +120,12 @@ export const getLamp = (sitem, callback, num) => {
         //说明状态改变
         if (sitem.light !== totalIsOpen) {
             callback(totalIsOpen);
-          
+
             return;
         } else if (num == 0) {
             return;
         }
-      
+
         getLamp(sitem, callback, num);
 
 
@@ -132,7 +134,7 @@ export const getLamp = (sitem, callback, num) => {
 };
 //查询 单个空调的状态
 export const getAirInfo = (sitem, callback, num, projectId) => {
-    debugger;
+ 
     num = num - 1;
     const paramsObj = {
         objectId: sitem.id,
@@ -145,12 +147,12 @@ export const getAirInfo = (sitem, callback, num, projectId) => {
         //说明状态改变
         if (sitem.airConditioner !== totalIsOpen) {
             callback(totalIsOpen);
-            debugger;
+            //debugger;
             return;
         } else if (num == 0) {
             return;
         }
-        debugger;
+       // debugger;
         getAirInfo(sitem, callback, num, projectId);
 
     });