This commit is contained in:
duanxiaohai 2024-07-31 09:28:03 +08:00
parent 584700303b
commit 4008d2d301
5 changed files with 34 additions and 9 deletions

BIN
dist.zip

Binary file not shown.

View File

@ -22,11 +22,13 @@ axios.interceptors.request.use(
// HTTP response 拦截器
axios.interceptors.response.use(
(response) => {
// console.log(response,"响应拦截器成功")
return response;
},
(error) => {
if (error.response) {
if (error.response.status == 401) {
// console.log(error.response,"响应拦截器失败")
ElMessage.error("请重新登录!");
// window.location.href = '/#/login?returnURL=' + window.location.href
window.location.href =

View File

@ -78,6 +78,9 @@ import png5 from "@/assets/guide/Dp/5.png";
import png6 from "@/assets/guide/Dp/6.png";
import png7 from "@/assets/guide/Dp/7.png";
import png8 from "@/assets/guide/Dp/8.png";
import { ElMessage } from "element-plus";
import tools from "@/utils/tools";
const router = useRouter();
const routers = useRoute();
@ -134,6 +137,13 @@ const reset_font = () => {
"scale(" + width / 1920 + "," + height / 1080 + ")";
};
onMounted(() => {
let token = tools.data.get("token");
console.log(token, "token");
if (token == null) {
ElMessage.error("请重新登录!");
window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" + window.location.href;
}
reset_font();
reset_font();
});

View File

@ -6,7 +6,7 @@
<div class="menuBar">
<div class="tabPosition" v-for="(item, index) in data.tabPosition">
<div class="tabPositionBox" @click="toggleVisibility(item)">
<div style="display: flex;text-align: center;" >
<div style="display: flex; text-align: center">
<div class="img"><img :src="item.img" alt="" /></div>
<div class="tabsItem">
{{ item.name }}
@ -143,7 +143,7 @@
</template>
<script setup>
import { ref, reactive } from "vue";
import { ref, reactive, onMounted } from "vue";
import icon1 from "@/assets/sy-table/sy-table9.png";
import icon2 from "@/assets/sy-table/sy-table10.png";
import icon3 from "@/assets/sy-table/sy-table11.png";
@ -162,6 +162,19 @@ import Bj3 from "@/assets/sy-table/sy-table5.png";
import Bj4 from "@/assets/sy-table/sy-table6.png";
import { useRouter, useRoute } from "vue-router";
import { ElMessage } from "element-plus";
import tools from "@/utils/tools";
onMounted(() => {
let token = tools.data.get("token");
console.log(token, "token");
if (token == null) {
ElMessage.error("请重新登录!");
window.location.href =
"http://220.191.238.50:996/api/login?returnURL=" + window.location.href;
}
});
const router = useRouter();
const routers = useRoute();
//
@ -549,11 +562,11 @@ const rowState = (row) => {
}
.tabPosition .img1 {
img {
width: 20px;
height: 10px;
margin-right: 24px;
vertical-align: middle;
}
width: 20px;
height: 10px;
margin-right: 24px;
vertical-align: middle;
}
}
.tabPositionBox {
display: flex;

View File

@ -15,8 +15,8 @@ export default defineConfig({
// 第一个代理
"/api": {
// 匹配到啥来进行方向代理
target: "http://192.168.2.17:8095/", //刘进
// target: "http://220.191.238.50:996/", //线上
// target: "http://192.168.2.17:8095/", //刘进
target: "http://220.191.238.50:996/", //线上
changeOrigin: true, //是否支持跨域
//rewrite: (path) => path.replace(/^\/api/, '') // 如果不需要api 直接把路径上的api 替换成空,这个
},