From 6448ec15bfe0b65fb822a662105bceddc23b58d8 Mon Sep 17 00:00:00 2001
From: yubo <autumnal_wind@yeah.net>
Date: 星期一, 06 四月 2026 21:34:44 +0800
Subject: [PATCH] feat(user): 新增员工档案管理视图组件

---
 src/views/login/index.vue |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 0ef50e2..df7e7ad 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -351,23 +351,26 @@
       const expireTime = current.setTime(current.getTime() + 1000 * data.expires_in)
       this.$store.commit('account/setExpireTime', expireTime)
     },
-    getUserDetailInfo() {
-      this.$get('auth/user').then((r) => {
+    async getUserDetailInfo() {
+      try {
+        const r = await this.$get('auth/user')
         this.$store.commit('account/setUser', r.data.principal)
+        // 预加载字典数据到缓存
+        await this.$store.dispatch('dict/LoadAllDicts')
         this.$message({
           message: this.$t('tips.loginSuccess'),
           type: 'success'
         })
         this.loading = false
         this.$router.push('/')
-      }).catch((error) => {
+      } catch (error) {
         this.$message({
           message: this.$t('tips.loginFail'),
           type: 'error'
         })
         console.error(error)
         this.loading = false
-      })
+      }
     },
     loginSuccessCallback() {
       this.$get('system/user/success').catch((e) => { console.log(e) })

--
Gitblit v1.8.0