解决两个问题:
1、config.js中写错URL导致axios请求失败; 2、axios为CROS发送两次请求,第一次的method是options,在token过滤器中需要忽略。
This commit is contained in:
@@ -3,8 +3,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2022-12-14 15:23:54
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-03 15:46:55
|
||||
* @FilePath: \IT工具综合平台\src\views\account\Login32.vue
|
||||
* @LastEditTime: 2023-02-04 16:55:12
|
||||
* @FilePath: /IT工具综合平台/src/views/account/Login.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@@ -43,8 +43,8 @@
|
||||
</el-row>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" class="el-button-block" @click="login" :disabled="submit_btn_disable"
|
||||
:loading="submit_btn_loading">
|
||||
<el-button type="primary" class="el-button-block" @click="login" :disabled="ui.submit_btn_disable"
|
||||
:loading="ui.submit_btn_loading">
|
||||
{{ ui.current_menu === "login" ? "登录" : "注册" }}
|
||||
</el-button>
|
||||
</el-form-item>
|
||||
@@ -183,6 +183,8 @@ export default {
|
||||
//将获取到的用户信息和token保存到vuex和localStorage
|
||||
const saveUserInfo = (userInfo) =>
|
||||
{
|
||||
console.log("保存用户信息");
|
||||
console.log("保存用户信息", store);
|
||||
//保存到vuex
|
||||
store.commit("app/SET_USERINFO", userInfo);
|
||||
|
||||
|
@@ -2,8 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-06 15:30:12
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-01 16:07:55
|
||||
* @FilePath: \IT工具综合平台\src\views\overview\Desktop.vue
|
||||
* @LastEditTime: 2023-02-04 16:56:36
|
||||
* @FilePath: /IT工具综合平台/src/views/overview/Desktop.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
@@ -60,33 +60,52 @@
|
||||
<el-col :span="10"></el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<el-button type="danger" @click="test_1">测试</el-button>
|
||||
<el-button type="danger" @click="testRequest">测试</el-button>
|
||||
</template>
|
||||
|
||||
<script >
|
||||
import { reactive, onBeforeMount } from "vue";
|
||||
import { query_requirement_status } from "@/utils/api/requirement/requirement.js";
|
||||
|
||||
export default {
|
||||
name: "DeskTop",
|
||||
data()
|
||||
setup()
|
||||
{
|
||||
let start_date = reactive(new Date());
|
||||
let end_date = reactive(new Date());
|
||||
|
||||
onBeforeMount(() =>
|
||||
{
|
||||
end_date = new Date(Date.now());
|
||||
start_date = new Date();
|
||||
|
||||
start_date.setMonth(end_date.getMonth() - 1);
|
||||
});
|
||||
|
||||
const testRequest = () =>
|
||||
{
|
||||
//加载数据;
|
||||
query_requirement_status()
|
||||
.then((response) =>
|
||||
{
|
||||
// debugger;
|
||||
const data = response.data;
|
||||
|
||||
console.log(data);
|
||||
})
|
||||
.catch((error) =>
|
||||
{
|
||||
// debugger;
|
||||
console.log(error);
|
||||
});
|
||||
};
|
||||
|
||||
return {
|
||||
start_date: null,
|
||||
end_date: null,
|
||||
start_date,
|
||||
end_date,
|
||||
testRequest,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
test_1()
|
||||
{
|
||||
this.deleteConfirm();
|
||||
},
|
||||
},
|
||||
created()
|
||||
{
|
||||
this.end_date = new Date(Date.now());
|
||||
this.start_date = new Date();
|
||||
|
||||
this.start_date.setMonth(this.end_date.getMonth() - 1);
|
||||
//this.start_date.setMonth();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
@@ -2,18 +2,8 @@
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-25 23:16:29
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-02-03 11:07:02
|
||||
* @FilePath: \IT工具综合平台\src\views\requirement\RequirementEditing.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
-->
|
||||
<!--
|
||||
* @Author: Kane
|
||||
* @Date: 2023-01-25 23:13:47
|
||||
* @LastEditors: Kane
|
||||
* @LastEditTime: 2023-01-25 23:15:21
|
||||
* @FilePath: \admin_system\src\views\requirement\RequirementManager.vue
|
||||
* @LastEditTime: 2023-02-04 15:46:29
|
||||
* @FilePath: /IT工具综合平台/src/views/requirement/RequirementEditing.vue
|
||||
* @Description:
|
||||
*
|
||||
* Copyright (c) ${2022} by Kane, All Rights Reserved.
|
||||
|
Reference in New Issue
Block a user