diff --git a/src/api/v1/emailUsers.ts b/src/api/v1/emailUsers.ts index 9221bf7..8cccf0c 100644 --- a/src/api/v1/emailUsers.ts +++ b/src/api/v1/emailUsers.ts @@ -1,30 +1,27 @@ import { http } from '@/api/service/request'; import type { BaseResult, ResultTable } from '@/api/service/types'; -/** - * 邮箱用户发送配置管理---获取邮箱用户发送配置管理列表 - */ +/** 邮箱用户发送配置管理---获取邮箱用户发送配置管理列表 */ export const fetchGetEmailUsersList = (data: any) => { return http.request>('get', `emailUsers/getEmailUsersList/${data.currentPage}/${data.pageSize}`, { params: data }); }; -/** - * 邮箱用户发送配置管理---添加邮箱用户发送配置管理 - */ +/** 邮箱用户发送配置管理---添加邮箱用户发送配置管理 */ export const fetchAddEmailUsers = (data: any) => { return http.request>('post', 'emailUsers/addEmailUsers', { data }); }; -/** - * 邮箱用户发送配置管理---更新邮箱用户发送配置管理 - */ +/** 邮箱用户发送配置管理---更新邮箱用户发送配置管理 */ export const fetchUpdateEmailUsers = (data: any) => { return http.request>('put', 'emailUsers/updateEmailUsers', { data }); }; -/** - * 邮箱用户发送配置管理---删除邮箱用户发送配置管理 - */ +/** 邮箱用户发送配置管理---更新邮箱用户状态 */ +export const fetchUpdateEmailUserStatus = (data: any) => { + return http.request>('put', 'emailUsers/updateEmailUserStatus', { data }); +}; + +/** 邮箱用户发送配置管理---删除邮箱用户发送配置管理 */ export const fetchDeleteEmailUsers = (data: any) => { return http.request>('delete', 'emailUsers/deleteEmailUsers', { data }); }; diff --git a/src/api/v1/menu.ts b/src/api/v1/menu.ts index a0e1c26..d856fda 100644 --- a/src/api/v1/menu.ts +++ b/src/api/v1/menu.ts @@ -1,9 +1,9 @@ import { http } from '@/api/service/request'; -import type { BaseResult, ResultTable } from '@/api/service/types'; +import type { BaseResult } from '@/api/service/types'; /** 菜单管理-列表 */ export const fetchGetMenusList = (data?: any) => { - return http.request>('get', `router/getMenusList`, { params: data }); + return http.request>('get', `router/getMenusList`, { params: data }); }; /** 菜单管理-添加菜单 */ diff --git a/src/store/i18n/i18n.ts b/src/store/i18n/i18n.ts index a2a587a..a145b57 100644 --- a/src/store/i18n/i18n.ts +++ b/src/store/i18n/i18n.ts @@ -29,9 +29,7 @@ export const userI18nStore = defineStore('i18nStore', { }, getters: {}, actions: { - /** - * * 获取多语言 - */ + /** 获取多语言 */ async fetchI18n() { const result = await fetchGetI18n(); @@ -46,9 +44,8 @@ export const userI18nStore = defineStore('i18nStore', { this.i18n = data; } }, - /** - * * 获取多语言列表 - */ + + /** 获取多语言列表 */ async getI18nMangeList() { const data = { ...this.pagination, ...this.form }; delete data.pageSizes; @@ -61,25 +58,19 @@ export const userI18nStore = defineStore('i18nStore', { return pagination(result); }, - /** - * * 添加多语言 - */ + /** 添加多语言 */ async addI18n(data: any) { const result = await fetchAddI18n(data); return storeMessage(result); }, - /** - * * 更新多语言 - */ + /** 更新多语言 */ async updateI18n(data: any) { const result = await fetchUpdateI18n(data); return storeMessage(result); }, - /** - * * 删除多语言 - */ + /** 删除多语言 */ async deleteI18n(data: any) { const result = await fetchDeleteI18n(data); return storeMessage(result); diff --git a/src/store/system/adminUser.ts b/src/store/system/adminUser.ts index c751e3a..17d035f 100644 --- a/src/store/system/adminUser.ts +++ b/src/store/system/adminUser.ts @@ -44,9 +44,7 @@ export const useAdminUserStore = defineStore('adminUserStore', { }, getters: {}, actions: { - /** - * * 获取用户信息 - */ + /** 获取用户信息 */ getAdminUserList: async function () { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -68,43 +66,31 @@ export const useAdminUserStore = defineStore('adminUserStore', { return result.data; }, - /** - * * 添加用户信息 - */ + /** 添加用户信息 */ async addAdminUser(data: any) { const result = await fetchAddAdminUser(data); return storeMessage(result); }, - /** - * * 修改用户信息 - */ + /** 修改用户信息 */ async updateAdminUser(data: any) { const result = await fetchUpdateAdminUser(data); return storeMessage(result); }, - /** - * * 删除用户信息 - */ + /** 删除用户信息 */ async deleteAdminUser(data: any) { const result = await fetchDeleteAdminUser(data); return storeMessage(result); }, - /** - * * 更新用户密码 - * @param data - */ + /** 更新用户密码 */ async updateAdminUserPasswordByManager(data: any) { const result: any = await fetchUpdateUserPasswordByAdmin(data); return storeMessage(result); }, - /** - * * 修改用户状态 - * @param data - */ + /** 修改用户状态 */ async updateUserStatusByAdmin(data: any) { const result = await fetchUpdateUserStatusByAdmin(data); return storeMessage(result); diff --git a/src/store/system/dept.ts b/src/store/system/dept.ts index 7f64b5b..6eee5a7 100644 --- a/src/store/system/dept.ts +++ b/src/store/system/dept.ts @@ -36,9 +36,7 @@ export const useDeptStore = defineStore('deptStore', { }, getters: {}, actions: { - /** - * * 获取部门 - */ + /** 获取部门 */ async getDeptList() { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -54,34 +52,26 @@ export const useDeptStore = defineStore('deptStore', { return pagination(result); }, - /** - * * 获取所有部门列表 - */ + /** 获取所有部门列表 */ async getAllDeptList() { const result = await fetchGetAllDeptList(); if (result.code !== 200) return; this.allDeptList = result.data; }, - /** - * * 添加部门 - */ + /** 添加部门 */ async addDept(data: any) { const result = await fetchAddDept(data); return storeMessage(result); }, - /** - * * 修改部门 - */ + /** 修改部门 */ async updateDept(data: any) { const result = await fetchUpdateDept(data); return storeMessage(result); }, - /** - * * 删除部门 - */ + /** 删除部门 */ async deleteDept(data: any) { const result = await fetchDeleteDept(data); return storeMessage(result); diff --git a/src/store/system/emailTemplate.ts b/src/store/system/emailTemplate.ts index 5d1de43..8bc322f 100644 --- a/src/store/system/emailTemplate.ts +++ b/src/store/system/emailTemplate.ts @@ -36,9 +36,7 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', { }, getters: {}, actions: { - /** - * * 获取邮件模板表 - */ + /** 获取邮件模板表 */ async getEmailTemplateList() { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -54,25 +52,19 @@ export const useEmailTemplateStore = defineStore('emailTemplateStore', { return pagination(result); }, - /** - * * 添加邮件模板表 - */ + /** 添加邮件模板表 */ async addEmailTemplate(data: any) { const result = await fetchAddEmailTemplate(data); return storeMessage(result); }, - /** - * * 修改邮件模板表 - */ + /** 修改邮件模板表 */ async updateEmailTemplate(data: any) { const result = await fetchUpdateEmailTemplate(data); return storeMessage(result); }, - /** - * * 删除邮件模板表 - */ + /** 删除邮件模板表 */ async deleteEmailTemplate(data: any) { const result = await fetchDeleteEmailTemplate(data); return storeMessage(result); diff --git a/src/store/system/emailUsers.ts b/src/store/system/emailUsers.ts index a98ec6b..f75aba0 100644 --- a/src/store/system/emailUsers.ts +++ b/src/store/system/emailUsers.ts @@ -1,5 +1,5 @@ import { defineStore } from 'pinia'; -import { fetchAddEmailUsers, fetchDeleteEmailUsers, fetchGetEmailUsersList, fetchUpdateEmailUsers } from '@/api/v1/emailUsers'; +import { fetchAddEmailUsers, fetchDeleteEmailUsers, fetchGetEmailUsersList, fetchUpdateEmailUsers, fetchUpdateEmailUserStatus } from '@/api/v1/emailUsers'; import { pageSizes } from '@/enums/baseConstant'; import { storeMessage } from '@/utils/message'; import { storePagination } from '@/store/useStorePagination'; @@ -56,25 +56,25 @@ export const useEmailUsersStore = defineStore('emailUsersStore', { return pagination(result); }, - /** - * * 添加邮箱用户发送配置 - */ + /** 添加邮箱用户发送配置 */ async addEmailUsers(data: any) { const result = await fetchAddEmailUsers(data); return storeMessage(result); }, - /** - * * 修改邮箱用户发送配置 - */ + /** 修改邮箱用户发送配置 */ async updateEmailUsers(data: any) { const result = await fetchUpdateEmailUsers(data); return storeMessage(result); }, - /** - * * 删除邮箱用户发送配置 - */ + /** 更新邮箱用户状态 */ + async updateEmailUserStatus(data: any) { + const result = await fetchUpdateEmailUserStatus(data); + return storeMessage(result); + }, + + /** 删除邮箱用户发送配置 */ async deleteEmailUsers(data: any) { const result = await fetchDeleteEmailUsers(data); return storeMessage(result); diff --git a/src/store/system/files.ts b/src/store/system/files.ts index 44e6358..9d83e98 100644 --- a/src/store/system/files.ts +++ b/src/store/system/files.ts @@ -36,9 +36,7 @@ export const useFilesStore = defineStore('filesStore', { }, getters: {}, actions: { - /** - * * 获取系统文件表 - */ + /** 获取系统文件表 */ async getFilesList() { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -54,25 +52,19 @@ export const useFilesStore = defineStore('filesStore', { return pagination(result); }, - /** - * * 添加系统文件表 - */ + /** 添加系统文件表 */ async addFiles(data: any) { const result = await fetchAddFiles(data); return storeMessage(result); }, - /** - * * 修改系统文件表 - */ + /** 修改系统文件表 */ async updateFiles(data: any) { const result = await fetchUpdateFiles(data); return storeMessage(result); }, - /** - * * 删除系统文件表 - */ + /** 删除系统文件表 */ async deleteFiles(data: any) { const result = await fetchDeleteFiles(data); return storeMessage(result); diff --git a/src/store/system/menu.ts b/src/store/system/menu.ts index 48f9fc8..84c208f 100644 --- a/src/store/system/menu.ts +++ b/src/store/system/menu.ts @@ -15,16 +15,14 @@ export const userMenuStore = defineStore('menuStore', { }, getters: {}, actions: { - /** - * * 获取菜单列表 - */ + /** 获取菜单列表 */ async getMenuList() { const result = await fetchGetMenusList({ ...this.pagination }); if (result.code !== 200) return false; // 前端搜索菜单名称 const title = this.form.title; - let newData = result.data; + let newData: Array = result.data; if (!isAllEmpty(title)) { newData = newData.filter(item => $t(item.title).includes(title)); } @@ -32,47 +30,32 @@ export const userMenuStore = defineStore('menuStore', { return true; }, - /** - * * 添加菜单 - * @param data - */ + /** 添加菜单 */ async addMenu(data: object) { const result = await fetchAddMenu(data); return storeMessage(result); }, - /** - * * 更新菜单 - * @param data - */ + /** 更新菜单 */ async updateMenu(data: object) { const result = await fetchUpdateMenu(data); return storeMessage(result); }, - /** - * * 删除菜单 - * @param data - */ + /** 删除菜单 */ async deletedMenuByIds(data: object) { const result = await fetchDeletedMenuByIds(data); return storeMessage(result); }, - /** - * * 根据路由id获取角色列表 - * @param data - */ + /** 根据路由id获取角色列表 */ async getRoleListByRouterId(data: any) { const result = await fetchGetRoleListByRouterId(data); if (result.code !== 200) return; return result.data; }, - /** - * * 为路由分配角色 - * @param data - */ + /** 为路由分配角色 */ async assignRolesToRouter(data: any) { const result = await fetchAssignRolesToRouter(data); return storeMessage(result); diff --git a/src/store/system/power.ts b/src/store/system/power.ts index f70439c..cec13c2 100644 --- a/src/store/system/power.ts +++ b/src/store/system/power.ts @@ -36,9 +36,7 @@ export const usePowerStore = defineStore('powerStore', { }, getters: {}, actions: { - /** - * * 获取权限 - */ + /** 获取权限 */ async getPowerList() { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -54,42 +52,31 @@ export const usePowerStore = defineStore('powerStore', { return pagination(result); }, - /** - * * 添加权限 - */ + /** 添加权限 */ async addPower(data: any) { const result = await fetchAddPower(data); return storeMessage(result); }, - /** - * * 修改权限 - */ + /** 修改权限 */ async updatePower(data: any) { const result = await fetchUpdatePower(data); return storeMessage(result); }, - /** - * 批量修改权限父级 - * @param data - */ + /** 批量修改权限父级 */ async updateBatchByPowerWithParentId(data: any) { const result = await fetchUpdateBatchByPowerWithParentId(data); return storeMessage(result); }, - /** - * * 删除权限 - */ + /** 删除权限 */ async deletePower(data: any) { const result = await fetchDeletePower(data); return storeMessage(result); }, - /** - * 获取所有权限 - */ + /** 获取所有权限 */ async getAllPowers() { const result = await fetchGetAllPowers(); if (result.code !== 200) return; diff --git a/src/store/system/role.ts b/src/store/system/role.ts index 6327f08..2418ebf 100644 --- a/src/store/system/role.ts +++ b/src/store/system/role.ts @@ -34,9 +34,7 @@ export const useRoleStore = defineStore('roleStore', { }, getters: {}, actions: { - /** - * * 获取角色 - */ + /** 获取角色 */ async getRoleList() { // 整理请求参数 const data = { ...this.pagination, ...this.form }; @@ -52,9 +50,7 @@ export const useRoleStore = defineStore('roleStore', { return pagination(result); }, - /** - * * 获取所有角色 - */ + /** 获取所有角色 */ async getAllRoles() { const result = await fetchGetAllRoles(); if (result.code !== 200) return; @@ -62,34 +58,25 @@ export const useRoleStore = defineStore('roleStore', { this.allRoleList = result.data.map(role => ({ key: role.id, label: role.description })); }, - /** - * * 添加角色 - */ + /** 添加角色 */ async addRole(data: any) { const result = await fetchAddRole(data); return storeMessage(result); }, - /** - * * 为角色分配权限 - * @param data - */ + /** 为角色分配权限 */ async assignPowersToRole(data: any) { const result = await fetchAssignPowersToRole(data); return storeMessage(result); }, - /** - * * 修改角色 - */ + /** 修改角色 */ async updateRole(data: any) { const result = await fetchUpdateRole(data); return storeMessage(result); }, - /** - * * 删除角色 - */ + /** 删除角色 */ async deleteRole(data: any) { const result = await fetchDeleteRole(data); return storeMessage(result); diff --git a/src/store/system/user.ts b/src/store/system/user.ts index b905120..d442be4 100644 --- a/src/store/system/user.ts +++ b/src/store/system/user.ts @@ -37,10 +37,7 @@ export const useUserStore = defineStore({ return false; }, - /** - * * 发送邮箱验证码 - * @param email - */ + /** 发送邮箱验证码 */ async postEmailCode(email: string) { const response = await fetchPostEmailCode({ email }); if (response.code === 200) { @@ -52,9 +49,7 @@ export const useUserStore = defineStore({ return false; }, - /** - * 前端登出(不调用接口) - */ + /** 前端登出(不调用接口) */ async logOut() { // 登出 const result = await fetchLogout(); @@ -73,9 +68,7 @@ export const useUserStore = defineStore({ message(result.message, { type: 'error' }); }, - /** - * 刷新`token` - */ + /** 刷新`token` */ async handRefreshToken(data: any) { const result = await refreshTokenApi({ ...data, readMeDay: this.readMeDay }); if (result.code === 200) { @@ -86,20 +79,14 @@ export const useUserStore = defineStore({ return false; }, - /** - * * 根据用户id获取角色列表 - * @param data - */ + /** 根据用户id获取角色列表 */ async getRoleListByUserId(data: any) { const result = await fetchGetRoleListByUserId(data); if (result.code !== 200) return; return result.data; }, - /** - * * 为用户分配角色 - * @param data - */ + /** 为用户分配角色 */ async assignRolesToUsers(data: any) { const result = await fetchAssignRolesToUsers(data); return storeMessage(result); diff --git a/src/views/system/adminUser/index.vue b/src/views/system/adminUser/index.vue index bc5ff25..e4339cd 100644 --- a/src/views/system/adminUser/index.vue +++ b/src/views/system/adminUser/index.vue @@ -148,7 +148,7 @@ onMounted(() => { - +