Explorar o código

feat(setting): 登录后同步线上系统配置- 在登录后同步系统配置的基础上,新增线上数据同步到本地的功能
- 调整代码结构,确保同步逻辑清晰可维护
- 添加必要的日志记录以追踪同步状态

panqiuyao hai 2 meses
pai
achega
2f86677652
Modificáronse 1 ficheiros con 8 adicións e 2 borrados
  1. 8 2
      frontend/src/apis/setting.ts

+ 8 - 2
frontend/src/apis/setting.ts

@@ -182,12 +182,12 @@ export async function syncAfterLogin() {
         const clientStore = client();
         const tokenInfoStore = tokenInfo();
         const token = tokenInfoStore.getToken;
-        
+
         if (!token) {
             console.warn('没有token,跳过数据同步');
             return;
         }
-        
+
         // 同步系统配置
         await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
             token: token
@@ -199,6 +199,12 @@ export async function syncAfterLogin() {
             action: 'sync_all'
         });
 
+
+        // 线上数据同步到本地
+        await clientStore.ipc.invoke(icpList.setting.syncSysConfigs, {
+            token: token
+        });
+
         console.log('登录后数据同步成功');
     } catch (error) {
         console.error('登录后数据同步失败:', error);