diff --git a/src/components/CreateProjectDialog.vue b/src/components/CreateProjectDialog.vue index dff1a6e..53793c6 100644 --- a/src/components/CreateProjectDialog.vue +++ b/src/components/CreateProjectDialog.vue @@ -354,10 +354,11 @@ export default { }, //提交方法 submitForm(formName) { - + const that = this + //this.$emit("created"); //对表单进行提交验证 this.$refs[formName].validate((valid) => { - const that = this + if (valid) { console.log('submit') let { ...form} = this.ruleForm @@ -374,7 +375,7 @@ export default { console.log(response) if (response.data.code === 200) { //console.log(response.data.data.records) - that.dialogFormVisible = false + //that.dialogFormVisible = false that.$emit("created"); ElMessage({ message: '新增项目成功', diff --git a/src/utils/request.js b/src/utils/request.js index 3100588..7b260d2 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,6 +1,7 @@ import router from '@/router' import store from '@/store' import baseUrl from "@/utils/baseUrl" +import {ElMessage} from "element-plus"; const axios = require('axios').default const request = axios.create({ @@ -32,6 +33,10 @@ request.interceptors.response.use( console.log(error.response) if(error.response.status===401) { + ElMessage({ + message: '登录过期,请重新登录', + type: 'error', + }) store.commit('clearStaff') router.push({path: '/login'}) } diff --git a/src/views/Home.vue b/src/views/Home.vue index f57c964..73a85a0 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -30,15 +30,15 @@ display: flex; flex-direction: row-reverse; align-items: center">