mirror of
https://gitee.com/java110/PropertyApp.git
synced 2026-02-23 21:36:39 +08:00
优化下代码
This commit is contained in:
parent
a962ab339f
commit
52f8d90af7
@ -116,6 +116,13 @@ export function getUserInfo() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let _userInfo = JSON.parse(desDecrypt(userInfo));
|
let _userInfo = JSON.parse(desDecrypt(userInfo));
|
||||||
|
if (isNull(userInfo)) {
|
||||||
|
uni.redirectTo({
|
||||||
|
url: "/pages/login/login"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return _userInfo;
|
return _userInfo;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
* @param {Object} _obj 判断对象
|
* @param {Object} _obj 判断对象
|
||||||
*/
|
*/
|
||||||
const isNull = function(_obj){
|
const isNull = function(_obj){
|
||||||
if(_obj == null || _obj == undefined || _obj == ''){
|
if(!_obj || _obj == null || _obj == undefined || _obj == ''){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user