fix: BUG修改

This commit is contained in:
kun 2024-04-01 18:54:18 +08:00
parent 5c4b8c4068
commit dc64b62520
6 changed files with 38 additions and 14 deletions

View File

@ -56,14 +56,14 @@ onMounted(() => {
// window.sessionStorage["login"] = true; // window.sessionStorage["login"] = true;
// }; // };
// beforeunload // beforeunload
window.addEventListener("beforeunload", function () { // window.addEventListener("beforeunload", function () {
if (window.performance.navigation.type === window.performance.navigation.TYPE_RELOAD) { // if (window.performance.navigation.type === window.performance.navigation.TYPE_RELOAD) {
// token // // token
return; // return;
} // }
globalStore.setToken(""); // // globalStore.setToken("");
globalStore.setUserInfo(""); // // globalStore.setUserInfo("");
}); // });
}); });
</script> </script>
<style lang="scss"> <style lang="scss">

View File

@ -1,3 +1,4 @@
export const projectTypeEnum = [ export const projectTypeEnum = [
{ id: 1, name: "房建" }, { id: 1, name: "房建" },
{ id: 2, name: "市政" }, { id: 2, name: "市政" },

View File

@ -36,8 +36,6 @@ const router = createRouter({
* */ * */
router.beforeEach(async (to, from, next) => { router.beforeEach(async (to, from, next) => {
const globalStore = GlobalStore(); const globalStore = GlobalStore();
console.log("路由拦截 beforeEach:", to);
console.log("路由拦截 to.path:", to.path);
// 解决首次跳转失败 // 解决首次跳转失败
let freeToken = window.location.href.indexOf("token") != -1; let freeToken = window.location.href.indexOf("token") != -1;
if (freeToken) { if (freeToken) {

View File

@ -8,6 +8,11 @@ import { HOME_URL } from "@/enums/Home/index";
* staticRouter() * staticRouter()
*/ */
export const staticRouter: RouteRecordRaw[] = [ export const staticRouter: RouteRecordRaw[] = [
{
path: "/",
// redirect: HOME_URL[0]
redirect: LOGIN_URL
},
{ {
path: "/login", path: "/login",
name: "login", name: "login",

View File

@ -9,7 +9,7 @@
<div><span>建筑面积</span> {{ projectData.projectAcreage || "" }} </div> <div><span>建筑面积</span> {{ projectData.projectAcreage || "" }} </div>
<div><span>开工日期</span> {{ projectData.startWorkDate || "" }}</div> <div><span>开工日期</span> {{ projectData.startWorkDate || "" }}</div>
<div><span>项目编号</span> {{ projectData.projectNumber || "" }}</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>
<!-- <div class="projectInfo"> <!-- <div class="projectInfo">
<div><span>建设地点</span> 南平市建阳区</div> <div><span>建设地点</span> 南平市建阳区</div>
@ -28,7 +28,7 @@
import Card from "@/components/card.vue"; import Card from "@/components/card.vue";
import { GlobalStore } from "@/stores"; import { GlobalStore } from "@/stores";
import { ref, onMounted, watch } from "vue"; import { ref, onMounted, watch } from "vue";
import { projectTypeEnum } from "@/enums/project/projectTypeEnum"; import { getStageOption } from "@/api/modules/projectOverview";
// ts // ts
type Props = { type Props = {
projectData?: any; // projectData?: any; //
@ -41,7 +41,26 @@ const props = withDefaults(defineProps<Props>(), {
const projectData = ref({} as any); const projectData = ref({} as any);
const projectLocal = 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( watch(
() => props.projectData, () => props.projectData,
newVal => { newVal => {

View File

@ -547,7 +547,8 @@ function jumpBgd() {
window.location.replace("http://jxj.zhgdyun.com:100/#/login?token=" + store.token); window.location.replace("http://jxj.zhgdyun.com:100/#/login?token=" + store.token);
} else { } 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> </script>