fix: BUG修改
This commit is contained in:
parent
5c4b8c4068
commit
dc64b62520
16
src/App.vue
16
src/App.vue
@ -56,14 +56,14 @@ onMounted(() => {
|
||||
// window.sessionStorage["login"] = true;
|
||||
// };
|
||||
// 监听 beforeunload 事件
|
||||
window.addEventListener("beforeunload", function () {
|
||||
if (window.performance.navigation.type === window.performance.navigation.TYPE_RELOAD) {
|
||||
// 如果是刷新页面操作,不清除 token
|
||||
return;
|
||||
}
|
||||
globalStore.setToken("");
|
||||
globalStore.setUserInfo("");
|
||||
});
|
||||
// window.addEventListener("beforeunload", function () {
|
||||
// if (window.performance.navigation.type === window.performance.navigation.TYPE_RELOAD) {
|
||||
// // 如果是刷新页面操作,不清除 token
|
||||
// return;
|
||||
// }
|
||||
// // globalStore.setToken("");
|
||||
// // globalStore.setUserInfo("");
|
||||
// });
|
||||
});
|
||||
</script>
|
||||
<style lang="scss">
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
|
||||
export const projectTypeEnum = [
|
||||
{ id: 1, name: "房建" },
|
||||
{ id: 2, name: "市政" },
|
||||
|
||||
@ -36,8 +36,6 @@ const router = createRouter({
|
||||
* */
|
||||
router.beforeEach(async (to, from, next) => {
|
||||
const globalStore = GlobalStore();
|
||||
console.log("路由拦截 beforeEach:", to);
|
||||
console.log("路由拦截 to.path:", to.path);
|
||||
// 解决首次跳转失败
|
||||
let freeToken = window.location.href.indexOf("token") != -1;
|
||||
if (freeToken) {
|
||||
|
||||
@ -8,6 +8,11 @@ import { HOME_URL } from "@/enums/Home/index";
|
||||
* staticRouter(静态路由)
|
||||
*/
|
||||
export const staticRouter: RouteRecordRaw[] = [
|
||||
{
|
||||
path: "/",
|
||||
// redirect: HOME_URL[0]
|
||||
redirect: LOGIN_URL
|
||||
},
|
||||
{
|
||||
path: "/login",
|
||||
name: "login",
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div><span>建筑面积:</span> {{ projectData.projectAcreage || "" }} ㎡</div>
|
||||
<div><span>开工日期:</span> {{ projectData.startWorkDate || "" }}</div>
|
||||
<div><span>项目编号:</span> {{ projectData.projectNumber || "" }}</div>
|
||||
<div><span>工程类别:</span> {{ projectData.projectType ? projectTypeEnum[projectData.projectType - 1].name : "" }}</div>
|
||||
<div><span>工程类别:</span> {{ projectData.projectType ? projectTypeEnumList[projectData.projectType - 1].name : "" }}</div>
|
||||
</div>
|
||||
<!-- <div class="projectInfo">
|
||||
<div><span>建设地点:</span> 南平市建阳区</div>
|
||||
@ -28,7 +28,7 @@
|
||||
import Card from "@/components/card.vue";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import { ref, onMounted, watch } from "vue";
|
||||
import { projectTypeEnum } from "@/enums/project/projectTypeEnum";
|
||||
import { getStageOption } from "@/api/modules/projectOverview";
|
||||
// ts
|
||||
type Props = {
|
||||
projectData?: any; // 传入项目信息
|
||||
@ -41,7 +41,26 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const projectData = ref({} as any);
|
||||
|
||||
const projectLocal = ref("" as any);
|
||||
|
||||
const store = GlobalStore();
|
||||
const projectTypeEnumList:any = ref([]); //工程类别
|
||||
// 工程类别字典数据
|
||||
const projectTypeEnum = async () => {
|
||||
const res: any = await getStageOption({ dictionaryEncoding: "project_type", projectSn: store.sn });
|
||||
if (res.result.length > 0) {
|
||||
let newArray = res.result.map((item: any) => {
|
||||
return {
|
||||
name: item.name,
|
||||
id: Number(item.data)
|
||||
};
|
||||
});
|
||||
projectTypeEnumList.value = newArray
|
||||
} else {
|
||||
projectTypeEnumList.value = []
|
||||
}
|
||||
};
|
||||
onMounted(() => {
|
||||
projectTypeEnum();
|
||||
})
|
||||
watch(
|
||||
() => props.projectData,
|
||||
newVal => {
|
||||
|
||||
@ -547,7 +547,8 @@ function jumpBgd() {
|
||||
window.location.replace("http://jxj.zhgdyun.com:100/#/login?token=" + store.token);
|
||||
} else {
|
||||
// 新项目通用(百色服务器)
|
||||
window.location.replace("http://101.43.164.214:11111/#/login?token=" + store.token);
|
||||
// window.location.replace("http://101.43.164.214:11111/#/login?token=" + store.token);
|
||||
window.location.replace("http://192.168.34.138:8080/#/login?token=" + store.token);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user