mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/fe-student.git
synced 2025-12-11 11:56:48 +08:00
fix -- bug
This commit is contained in:
20
src/App.vue
20
src/App.vue
@@ -36,22 +36,30 @@ import {useStore} from "vuex";
|
||||
import {onMounted} from "vue";
|
||||
import {useRoute} from "vue-router/dist/vue-router";
|
||||
import {USER_INFO} from "@/api/api";
|
||||
import {IsPhone} from "@/api/utils";
|
||||
|
||||
console.log("版本2.1.6------------");
|
||||
const store = useStore();
|
||||
const {path} = useRoute();
|
||||
const { path } = useRoute();
|
||||
onMounted(() => {
|
||||
path === '/login' || getUserInfo();
|
||||
path === "/login" || getUserInfo();
|
||||
if (IsPhone()) {
|
||||
if (import.meta.env.MODE === "development") {
|
||||
window.location.href = window.location.href.replace(import.meta.env.VITE_BASE, import.meta.env.VITE_BASE_H5).replace('5173','5174');
|
||||
} else {
|
||||
window.location.href = window.location.href.replace(import.meta.env.VITE_BASE, import.meta.env.VITE_BASE_H5)
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function getUserInfo() {
|
||||
if (import.meta.env.MODE === 'development' || import.meta.env.MODE === 'test') {
|
||||
if (import.meta.env.MODE === "development" || import.meta.env.MODE === "test") {
|
||||
request(USER_INFO, {}).then(res => {
|
||||
store.commit("SET_USER", res.data);
|
||||
})
|
||||
});
|
||||
} else {
|
||||
boeRequest(GET_USER_INFO).then((res) => {
|
||||
res.result.avatar = res.result.avatar || '/800e23f7-b58c-4192-820d-0c6a2b7544cc.png'
|
||||
res.result.avatar = res.result.avatar || "/800e23f7-b58c-4192-820d-0c6a2b7544cc.png";
|
||||
store.commit("SET_USER", res.result);
|
||||
});
|
||||
}
|
||||
@@ -75,7 +83,7 @@ function getUserInfo() {
|
||||
|
||||
.preNext {
|
||||
right: 115px !important;
|
||||
margin-top:4px;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
#container {
|
||||
|
||||
Reference in New Issue
Block a user