From e00da17ae2adaecf1cdf2d5128e357a50607bc90 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Fri, 27 Feb 2026 08:40:37 +0800
Subject: [PATCH] feat: 权限获取调整

---
 applications/task-work-order/src/App.vue |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/applications/task-work-order/src/App.vue b/applications/task-work-order/src/App.vue
index 50a0be4..fd0e405 100644
--- a/applications/task-work-order/src/App.vue
+++ b/applications/task-work-order/src/App.vue
@@ -1,27 +1,33 @@
 <template>
-  <router-view />
+	<router-view />
 </template>
 
 <script setup>
 import { loginWithMiniProgramApi } from '@/api/zkxt'
+import { useStore } from 'vuex'
 
+const store = useStore()
+const authToken = window.localStorage?.authToken
 
-function getToken() {
-	loginWithMiniProgramApi({username: 'admin'}).then(res => {
-		console.log(res)
-	})
+store.commit('setXtToken', authToken)
+const { VITE_APP_ENV } = import.meta.env
+
+if (VITE_APP_ENV === 'development') {
+	function getXTToken() {
+		loginWithMiniProgramApi({ username: '13007280672' }).then(res => {
+			store.commit('setXtToken', res.data.data.access_token)
+		})
+	}
+	getXTToken()
+	setInterval(getXTToken, 600000)
 }
-getToken()
-setInterval(() => {
-	getToken()
-}, 600000)
 </script>
 
 <style>
 html,
 body,
 #app {
-  width: 100%;
-  height: 100%;
+	width: 100%;
+	height: 100%;
 }
 </style>

--
Gitblit v1.9.3