瀏覽代碼

容错处理

zhouna 4 年之前
父節點
當前提交
f7b51156df
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/js/login.js

+ 2 - 2
src/js/login.js

@@ -72,8 +72,8 @@ function sureLogin(){
 //核查权限数据保存
 function cacheCheckDatas(data){
   delCookie("checkAuth")
-  const arr = data.map((it)=>{
+  const arr = data&&data.map((it)=>{
     return it.id;
-  });
+  })||[];
   setCookie("checkAuth",arr.join(","));
 }