|
@@ -110,8 +110,8 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
-import { useSettingsStore, useUserStore } from "@/store";
|
|
|
-import { getCaptchaApi, getOrgListApi } from "@/api/auth";
|
|
|
+import { useSettingsStore, useUserStore, useDictionaryStore } from "@/store";
|
|
|
+import { getCaptchaApi, getOrgListApi, getUserDicts } from "@/api/auth";
|
|
|
import { LoginData } from "@/api/auth/types";
|
|
|
import { Sunny, Moon } from "@element-plus/icons-vue";
|
|
|
import { LocationQuery, LocationQueryValue, useRoute } from "vue-router";
|
|
@@ -122,6 +122,8 @@ import { usePermissionStore } from "@/store/modules/permission";
|
|
|
// Stores
|
|
|
const userStore = useUserStore();
|
|
|
const settingsStore = useSettingsStore();
|
|
|
+// 数据字典相关
|
|
|
+const dictStore = useDictionaryStore();
|
|
|
|
|
|
// Internationalization
|
|
|
const { t } = useI18n();
|
|
@@ -129,14 +131,14 @@ const { t } = useI18n();
|
|
|
// Reactive states
|
|
|
const isDark = ref(settingsStore.theme === ThemeEnum.DARK);
|
|
|
const icpVisible = ref(true);
|
|
|
-const orgList = ref([]);
|
|
|
+const orgList = ref<any>([]);
|
|
|
const loading = ref(false); // 按钮loading
|
|
|
const isCapslock = ref(false); // 是否大写锁定
|
|
|
const captchaBase64 = ref(); // 验证码图片Base64字符串
|
|
|
const loginFormRef = ref(ElForm); // 登录表单ref
|
|
|
const { height } = useWindowSize();
|
|
|
|
|
|
-const loginData = ref<LoginData>({
|
|
|
+const loginData = ref<any>({
|
|
|
userName: "admin",
|
|
|
password: "admin@123",
|
|
|
});
|
|
@@ -212,6 +214,13 @@ function handleLogin() {
|
|
|
},
|
|
|
{}
|
|
|
);
|
|
|
+ // 获取字典
|
|
|
+ getUserDicts(dictStore.types).then((res) => {
|
|
|
+ if (res.data) {
|
|
|
+ dictStore.dicts = res?.data ?? [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
router.push({ path: redirect, query: otherQueryParams });
|
|
|
})
|
|
|
.catch(() => {
|