Update App.vue

修改生产环境权限认证
This commit is contained in:
joshen
2024-02-21 14:14:33 +08:00
parent d76ff4aca3
commit 1869226fca

View File

@@ -33,6 +33,7 @@ onMounted(() => {
window.location.href.includes("/login") || getUserInfo(); window.location.href.includes("/login") || getUserInfo();
}); });
function getUserInfo() { function getUserInfo() {
if ( if (
import.meta.env.MODE === "development" || import.meta.env.MODE === "development" ||
@@ -42,10 +43,15 @@ function getUserInfo() {
store.commit("SET_USER", res.data); store.commit("SET_USER", res.data);
}); });
} else { } else {
boeRequest(GET_USER_INFO).then((res) => { // 修改生产环境验证 GET_USER_INFO 接口不存在 选择GET_USER_LIST
res.result.avatar = // boeRequest(GET_USER_INFO).then((res) => {
res.result.avatar || "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png"; // res.result.avatar =
store.commit("SET_USER", res.result); // res.result.avatar || "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
// store.commit("SET_USER", res.result);
// });
boeRequest(GET_USER_LIST, {}).then((res) => {
store.commit("SET_USER", res.data);
}); });
} }
} }