解决两个问题:
1、config.js中写错URL导致axios请求失败; 2、axios为CROS发送两次请求,第一次的method是options,在token过滤器中需要忽略。
This commit is contained in:
@@ -2,14 +2,14 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-04 11:05:44
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-04 01:02:13
|
||||
* @FilePath: \IT工具综合平台\src\layout\Index.vue
|
||||
* @LastEditTime: 2023-02-04 16:35:20
|
||||
* @FilePath: /IT工具综合平台/src/layout/Index.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<template>
|
||||
<el-container id="layout-container" v-loading="pageVisible" element-loading-text="载入应用数据…">
|
||||
<el-container id="layout-container" v-loading="ui.ageVisible" element-loading-text="载入应用数据…">
|
||||
<el-header id="layout-header">
|
||||
<LayoutHeader />
|
||||
</el-header>
|
||||
@@ -28,35 +28,57 @@
|
||||
import LayoutAside from "./components/Aside.vue";
|
||||
import LayoutHeader from "./components/Header.vue";
|
||||
import LayoutMain from "./components/Main.vue";
|
||||
import { useStore } from "vuex";
|
||||
import { onMounted, computed, reactive } from "vue";
|
||||
// import { query_requirement_status } from "@/utils/api/requirement/requirement.js";
|
||||
|
||||
export default {
|
||||
name: "layoutPage",
|
||||
setup()
|
||||
{
|
||||
const store = useStore();
|
||||
|
||||
const ui = reactive(
|
||||
{
|
||||
pageVisible: true,
|
||||
});
|
||||
|
||||
const asideWidth = computed(() =>
|
||||
{
|
||||
const collapse = store.state.app.asideBarCollapse;
|
||||
|
||||
return collapse === true ? "65px" : "180px";
|
||||
});
|
||||
|
||||
onMounted(() =>
|
||||
{
|
||||
|
||||
//加载数据
|
||||
// query_requirement_status()
|
||||
// .then((response) =>
|
||||
// {
|
||||
// // debugger;
|
||||
// const data = response.data;
|
||||
|
||||
// console.log(data);
|
||||
// })
|
||||
// .catch((error) =>
|
||||
// {
|
||||
// // debugger;
|
||||
// console.log(error);
|
||||
// });
|
||||
});
|
||||
|
||||
return {
|
||||
ui,
|
||||
asideWidth,
|
||||
};
|
||||
},
|
||||
components: {
|
||||
LayoutAside,
|
||||
LayoutHeader,
|
||||
LayoutMain,
|
||||
},
|
||||
data()
|
||||
{
|
||||
return {
|
||||
pageVisible: true,
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
asideWidth()
|
||||
{
|
||||
const collapse = this.$store.state.app.asideBarCollapse;
|
||||
|
||||
return collapse === true ? "65px" : "180px";
|
||||
},
|
||||
},
|
||||
mounted()
|
||||
{
|
||||
setTimeout(() =>
|
||||
{
|
||||
this.pageVisible = false;
|
||||
}, 3000);
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user