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 {
type appType,
store,
getConfig,
defineStore,
storageLocal,
deviceDetection,
responsiveStorageNameSpace

2
src/store/modules/epTheme.ts

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

2
src/store/modules/multiTags.ts

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

2
src/store/modules/permission.ts

@ -1,3 +1,4 @@
import { defineStore } from "pinia";
import {
type cacheType,
store,
@ -5,7 +6,6 @@ import {
ascending,
getKeyList,
filterTree,
defineStore,
constantMenus,
filterNoPermissionTree,
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({
id: "pure-setting",

2
src/store/modules/user.ts

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

1
src/store/utils.ts

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

15
src/views/login/index.vue

@ -45,23 +45,26 @@ const ruleForm = reactive({
});
const onLogin = async (formEl: FormInstance | undefined) => {
loading.value = true;
if (!formEl) return;
await formEl.validate((valid, fields) => {
if (valid) {
loading.value = true;
useUserStoreHook()
.loginByUsername({ username: ruleForm.username, password: "admin123" })
.then(res => {
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 {
message(t("login.pureLoginFail"), { type: "error" });
}
});
})
.finally(() => (loading.value = false));
} else {
loading.value = false;
return fields;
}
});

Loading…
Cancel
Save