release: update 3.6.0

This commit is contained in:
xiaoxian521
2022-10-25 17:51:21 +08:00
parent 1003a31b4d
commit f14077bc6f
37 changed files with 555 additions and 321 deletions

View File

@@ -7,9 +7,9 @@ import { initRouter } from "/@/router/utils";
import { useNav } from "/@/layout/hooks/useNav";
import { message } from "@pureadmin/components";
import type { FormInstance } from "element-plus";
import { storageSession } from "@pureadmin/utils";
import { $t, transformI18n } from "/@/plugins/i18n";
import { useLayout } from "/@/layout/hooks/useLayout";
import { useUserStoreHook } from "/@/store/modules/user";
import { bg, avatar, illustration } from "./utils/static";
import { useRenderIcon } from "/@/components/ReIcon/src/hooks";
import { ref, reactive, toRaw, onMounted, onBeforeUnmount } from "vue";
@@ -32,6 +32,7 @@ initStorage();
const { t } = useI18n();
const { dataTheme, dataThemeChange } = useDataThemeChange();
dataThemeChange();
const { title, getDropdownItemStyle, getDropdownItemClass } = useNav();
const { locale, translationCh, translationEn } = useTranslationLang();
@@ -45,17 +46,17 @@ const onLogin = async (formEl: FormInstance | undefined) => {
if (!formEl) return;
await formEl.validate((valid, fields) => {
if (valid) {
// 模拟请求,需根据实际开发进行修改
setTimeout(() => {
loading.value = false;
storageSession.setItem("info", {
username: "admin",
accessToken: "eyJhbGciOiJIUzUxMiJ9.test"
useUserStoreHook()
.loginByUsername({ username: ruleForm.username })
.then(res => {
if (res.success) {
// 获取后端路由
initRouter().then(() => {
message.success("登录成功");
router.push("/");
});
}
});
initRouter("admin").then(() => {});
message.success("登录成功");
router.push("/");
}, 2000);
} else {
loading.value = false;
return fields;
@@ -63,8 +64,6 @@ const onLogin = async (formEl: FormInstance | undefined) => {
});
};
dataThemeChange();
/** 使用公共函数,避免`removeEventListener`失效 */
function onkeypress({ code }: KeyboardEvent) {
if (code === "Enter") {