|
@@ -118,10 +118,11 @@ import { getCaptchaApi, getOrgListApi, getUserDicts } from "@/api/auth";
|
|
import { LoginData } from "@/api/auth/types";
|
|
import { LoginData } from "@/api/auth/types";
|
|
import { Sunny, Moon } from "@element-plus/icons-vue";
|
|
import { Sunny, Moon } from "@element-plus/icons-vue";
|
|
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
|
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
|
-import router from "@/router";
|
|
|
|
|
|
+
|
|
import defaultSettings from "@/settings";
|
|
import defaultSettings from "@/settings";
|
|
import { ThemeEnum } from "@/enums/ThemeEnum";
|
|
import { ThemeEnum } from "@/enums/ThemeEnum";
|
|
import { usePermissionStore } from "@/store/modules/permission";
|
|
import { usePermissionStore } from "@/store/modules/permission";
|
|
|
|
+
|
|
// Stores
|
|
// Stores
|
|
const userStore = useUserStore();
|
|
const userStore = useUserStore();
|
|
const settingsStore = useSettingsStore();
|
|
const settingsStore = useSettingsStore();
|
|
@@ -200,6 +201,7 @@ function getOrgList() {
|
|
* 登录
|
|
* 登录
|
|
*/
|
|
*/
|
|
const route = useRoute();
|
|
const route = useRoute();
|
|
|
|
+const router = useRouter();
|
|
|
|
|
|
function handleLogin() {
|
|
function handleLogin() {
|
|
loginFormRef.value.validate((valid: boolean) => {
|
|
loginFormRef.value.validate((valid: boolean) => {
|
|
@@ -223,12 +225,13 @@ function handleLogin() {
|
|
},
|
|
},
|
|
{}
|
|
{}
|
|
);
|
|
);
|
|
|
|
+
|
|
// 获取字典
|
|
// 获取字典
|
|
- getUserDicts(dictStore.types).then((res) => {
|
|
|
|
- if (res.data) {
|
|
|
|
- dictStore.dicts = res?.data ?? [];
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ const dictStore = useDictionaryStore();
|
|
|
|
+ let res = await getUserDicts(dictStore.types);
|
|
|
|
+ if (res?.data) {
|
|
|
|
+ dictStore.dicts = res?.data ?? {};
|
|
|
|
+ }
|
|
|
|
|
|
// router.push({ path: redirect, query: otherQueryParams });
|
|
// router.push({ path: redirect, query: otherQueryParams });
|
|
router.push("/welcome");
|
|
router.push("/welcome");
|