Browse Source

chore: 同步完整版代码

i18n
xiaoxian521 7 months ago
parent
commit
b4893be543
  1. 2
      src/store/modules/app.ts
  2. 2
      src/store/modules/epTheme.ts
  3. 2
      src/store/modules/multiTags.ts
  4. 2
      src/store/modules/permission.ts
  5. 3
      src/store/modules/settings.ts
  6. 2
      src/store/modules/user.ts
  7. 1
      src/store/utils.ts
  8. 15
      src/views/login/index.vue

2
src/store/modules/app.ts

@ -1,8 +1,8 @@
import { defineStore } from "pinia";
import { import {
type appType, type appType,
store, store,
getConfig, getConfig,
defineStore,
storageLocal, storageLocal,
deviceDetection, deviceDetection,
responsiveStorageNameSpace responsiveStorageNameSpace

2
src/store/modules/epTheme.ts

@ -1,7 +1,7 @@
import { defineStore } from "pinia";
import { import {
store, store,
getConfig, getConfig,
defineStore,
storageLocal, storageLocal,
responsiveStorageNameSpace responsiveStorageNameSpace
} from "../utils"; } from "../utils";

2
src/store/modules/multiTags.ts

@ -1,3 +1,4 @@
import { defineStore } from "pinia";
import { import {
type multiType, type multiType,
type positionType, type positionType,
@ -7,7 +8,6 @@ import {
isNumber, isNumber,
isBoolean, isBoolean,
getConfig, getConfig,
defineStore,
routerArrays, routerArrays,
storageLocal, storageLocal,
responsiveStorageNameSpace responsiveStorageNameSpace

2
src/store/modules/permission.ts

@ -1,3 +1,4 @@
import { defineStore } from "pinia";
import { import {
type cacheType, type cacheType,
store, store,
@ -5,7 +6,6 @@ import {
ascending, ascending,
getKeyList, getKeyList,
filterTree, filterTree,
defineStore,
constantMenus, constantMenus,
filterNoPermissionTree, filterNoPermissionTree,
formatFlatteningRoutes formatFlatteningRoutes

3
src/store/modules/settings.ts

@ -1,4 +1,5 @@
import { type setType, store, defineStore, getConfig } from "../utils";
import { defineStore } from "pinia";
import { type setType, store, getConfig } from "../utils";
export const useSettingStore = defineStore({ export const useSettingStore = defineStore({
id: "pure-setting", id: "pure-setting",

2
src/store/modules/user.ts

@ -1,8 +1,8 @@
import { defineStore } from "pinia";
import { import {
type userType, type userType,
store, store,
router, router,
defineStore,
resetRouter, resetRouter,
routerArrays, routerArrays,
storageLocal storageLocal

1
src/store/utils.ts

@ -1,5 +1,4 @@
export { store } from "@/store"; export { store } from "@/store";
export { defineStore } from "pinia";
export { routerArrays } from "@/layout/types"; export { routerArrays } from "@/layout/types";
export { router, resetRouter, constantMenus } from "@/router"; export { router, resetRouter, constantMenus } from "@/router";
export { getConfig, responsiveStorageNameSpace } from "@/config"; export { getConfig, responsiveStorageNameSpace } from "@/config";

15
src/views/login/index.vue

@ -45,23 +45,26 @@ const ruleForm = reactive({
}); });
const onLogin = async (formEl: FormInstance | undefined) => { const onLogin = async (formEl: FormInstance | undefined) => {
loading.value = true;
if (!formEl) return; if (!formEl) return;
await formEl.validate((valid, fields) => { await formEl.validate((valid, fields) => {
if (valid) { if (valid) {
loading.value = true;
useUserStoreHook() useUserStoreHook()
.loginByUsername({ username: ruleForm.username, password: "admin123" }) .loginByUsername({ username: ruleForm.username, password: "admin123" })
.then(res => { .then(res => {
if (res.success) { if (res.success) {
// //
initRouter().then(() => {
router.push(getTopMenu(true).path);
message("登录成功", { type: "success" });
return initRouter().then(() => {
router.push(getTopMenu(true).path).then(() => {
message(t("login.pureLoginSuccess"), { type: "success" });
}); });
}
}); });
} else { } else {
loading.value = false;
message(t("login.pureLoginFail"), { type: "error" });
}
})
.finally(() => (loading.value = false));
} else {
return fields; return fields;
} }
}); });

Loading…
Cancel
Save