From 8ddaad2138a054677142a8c4a84caf8397d6a76e Mon Sep 17 00:00:00 2001 From: glj Date: Mon, 10 Jul 2023 16:44:30 +0800 Subject: [PATCH] =?UTF-8?q?glj-=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/response/administrator.js | 3 +- .../navBars/breadcrumb/updatePassword.vue | 2 +- src/utils/request.js | 14 +++++- .../visualData/component/editHotspotForm.vue | 2 +- .../visualData/component/hotspotForm.vue | 2 +- src/views/login/component/forgotPassword.vue | 2 +- .../chiefAdministrator/index.vue | 44 +++++++++---------- 7 files changed, 40 insertions(+), 29 deletions(-) diff --git a/src/api/response/administrator.js b/src/api/response/administrator.js index aac24ad..32d46c3 100644 --- a/src/api/response/administrator.js +++ b/src/api/response/administrator.js @@ -50,12 +50,13 @@ export const updateAdmin = (data) => { * @param ids * @returns {Promise>} */ -export const remove = (ids) => { +export const remove = (ids,email) => { return request({ url: '/api/' + moduleName + '/ui/administrator/delete', method: 'delete', params: { ids, + email } }) } diff --git a/src/layout/navBars/breadcrumb/updatePassword.vue b/src/layout/navBars/breadcrumb/updatePassword.vue index 0d78d87..f68bc64 100644 --- a/src/layout/navBars/breadcrumb/updatePassword.vue +++ b/src/layout/navBars/breadcrumb/updatePassword.vue @@ -87,7 +87,7 @@ const state = reactive({ //租户ID tenantId: website.value.tenantId, //用户名 - userName: "792163605@qq.com", + userName: "", //密码 password: "", //账号类型 diff --git a/src/utils/request.js b/src/utils/request.js index a952728..12f4bff 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -61,12 +61,22 @@ service.interceptors.response.use( } else if (error.response && error.response.data.code == '500') { ElMessage.error(error.response.data.msg); } else { - if (error.response.data.error_description) ElMessage.error(error.response.data.error_description); + + if (error.response.data.error == "access_denied") { + ElMessage.error("Incorrect verification code"); + return; + } + if (error.response.data.error == "invalid_grant") { + ElMessage.error("Incorrect username or password"); + return; + } + if (error.response.data.error_description) + ElMessage.error(error.response.data.error_description); else { //if (error.response.data) ElMessage.error(error.response.statusText); //Session.clear(); // 清除浏览器全部临时缓存 //window.location.href = '/'; // 去登录页 - ElMessage.error('接口路径找不到'); + ElMessage.error('Interface path not found'); } } return Promise.reject(error); diff --git a/src/views/dataService/visualData/component/editHotspotForm.vue b/src/views/dataService/visualData/component/editHotspotForm.vue index 58a7bb8..9ff13d9 100644 --- a/src/views/dataService/visualData/component/editHotspotForm.vue +++ b/src/views/dataService/visualData/component/editHotspotForm.vue @@ -7,7 +7,7 @@ - + diff --git a/src/views/dataService/visualData/component/hotspotForm.vue b/src/views/dataService/visualData/component/hotspotForm.vue index 5e46f0c..fe8c0ec 100644 --- a/src/views/dataService/visualData/component/hotspotForm.vue +++ b/src/views/dataService/visualData/component/hotspotForm.vue @@ -7,7 +7,7 @@ - + diff --git a/src/views/login/component/forgotPassword.vue b/src/views/login/component/forgotPassword.vue index 49a3a96..d253ff5 100644 --- a/src/views/login/component/forgotPassword.vue +++ b/src/views/login/component/forgotPassword.vue @@ -78,7 +78,7 @@ const state = reactive({ //租户ID tenantId: website.value.tenantId, //用户名 - userName: "792163605@qq.com", + userName: "", //密码 password: "", //账号类型 diff --git a/src/views/systemManagement/chiefAdministrator/index.vue b/src/views/systemManagement/chiefAdministrator/index.vue index 024921c..408b8d0 100644 --- a/src/views/systemManagement/chiefAdministrator/index.vue +++ b/src/views/systemManagement/chiefAdministrator/index.vue @@ -17,12 +17,12 @@ add - + { editAdministratorRef.value.openDialog(row); }; //批量删除chief管理员数据 -const batchDel = () => { - if(state.multipleSelection.length == 0){ - ElMessage.warning("Select the data to be operated first"); - return false; - } - ElMessageBox.confirm(`This action batch deletes the chief data,Whether to continue?`, 'tip', { - confirmButtonText: 'confirm', - cancelButtonText: 'cancel', - type: 'warning', - }) - .then(() => { - let id = state.multipleSelection.map(item=>item.id) - remove(id.join()).then(res=>{ - getTableData(); - ElMessage.success('delete successfully'); - }) - }) - .catch(() => {}); -} +// const batchDel = () => { +// if(state.multipleSelection.length == 0){ +// ElMessage.warning("Select the data to be operated first"); +// return false; +// } +// ElMessageBox.confirm(`This action batch deletes the chief data,Whether to continue?`, 'tip', { +// confirmButtonText: 'confirm', +// cancelButtonText: 'cancel', +// type: 'warning', +// }) +// .then(() => { +// let id = state.multipleSelection.map(item=>item.id) +// remove(id.join()).then(res=>{ +// getTableData(); +// ElMessage.success('delete successfully'); +// }) +// }) +// .catch(() => {}); +// } // 删除chief管理员数据 const deleteUser = (row) => { ElMessageBox.confirm(`This operation will delete the user:“${row.name}”,Whether to continue?`, 'tip', { @@ -186,7 +186,7 @@ const deleteUser = (row) => { type: 'warning', }) .then(() => { - remove(row.id).then(res=>{ + remove(row.id,row.email).then(res=>{ getTableData(); ElMessage.success('Deleted successfully'); })