feat: 添加部门管理

This commit is contained in:
2025-02-11 04:34:29 +08:00
parent a5f04356ee
commit 74cc990645
97 changed files with 5218 additions and 990 deletions

View File

@@ -9,6 +9,10 @@ import { useAppStoreHook } from "@/store/modules/app";
import { useEpThemeStoreHook } from "@/store/modules/epTheme";
import { useMultiTagsStoreHook } from "@/store/modules/multiTags";
import { darken, lighten, useGlobal, storageLocal } from "@pureadmin/utils";
import { ElMessageBox } from "element-plus";
import { transformI18n } from "@/plugins/i18n";
import { logoutAPI } from "@/api/login";
import { message } from "@/utils/message";
export function useDataThemeChange() {
const { layoutTheme, layout } = useLayout();
@@ -110,17 +114,48 @@ export function useDataThemeChange() {
/** 清空缓存并返回登录页 */
function onReset() {
removeToken();
storageLocal().clear();
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } = getConfig();
useAppStoreHook().setLayout(Layout);
setEpThemeColor(EpThemeColor);
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
toggleClass(Grey, "html-grey", document.querySelector("html"));
toggleClass(Weak, "html-weakness", document.querySelector("html"));
router.push("/login");
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
resetRouter();
ElMessageBox.confirm(
transformI18n("logout:message"),
transformI18n("buttons:LoginOut"),
{
confirmButtonText: transformI18n("buttons:Confirm"),
cancelButtonText: transformI18n("buttons:Cancel"),
type: "warning",
center: true
}
)
.then(async () => {
const res = await logoutAPI();
if (!res.success) {
removeToken();
storageLocal().clear();
const { Grey, Weak, MultiTagsCache, EpThemeColor, Layout } =
getConfig();
useAppStoreHook().setLayout(Layout);
setEpThemeColor(EpThemeColor);
useMultiTagsStoreHook().multiTagsCacheChange(MultiTagsCache);
toggleClass(Grey, "html-grey", document.querySelector("html"));
toggleClass(Weak, "html-weakness", document.querySelector("html"));
router.push("/login");
useMultiTagsStoreHook().handleTags("equal", [...routerArrays]);
resetRouter();
message(transformI18n("logout:success"), {
type: "success",
duration: 1000
});
} else {
message(transformI18n("logout:fail"), {
type: "error",
duration: 1000
});
}
})
.catch(() => {
message(transformI18n("logout:cancel"), {
type: "info",
duration: 1000
});
});
}
return {