wuhb пре 1 месец
родитељ
комит
d59473c899
3 измењених фајлова са 25 додато и 24 уклоњено
  1. 2 2
      manifest.json
  2. 21 20
      pages/login/index.uvue
  3. 2 2
      utils/request.uts

+ 2 - 2
manifest.json

@@ -2,8 +2,8 @@
 	"name": "EMCS",
 	"appid": "__UNI__5577A7F",
 	"description": "进销存管理",
-	"versionName": "1.0.8",
-	"versionCode": "8",
+	"versionName": "1.0.9",
+	"versionCode": "9",
 	"uni-app-x": {
 		"vapor": true,
 		"styleIsolationVersion": "2"

+ 21 - 20
pages/login/index.uvue

@@ -122,6 +122,7 @@
 	const isDownload = ref<boolean>(false)
 	const downloadProgress = ref<number>(0)
 	const showPasswordPicker = ref<boolean>(false)
+	const isAutoLogin = ref<boolean>(false) // 添加自动登录标志
 
     // 版本号
     const manifestVersion = manifest?.versionName as string | null
@@ -415,29 +416,29 @@
 	}
 	
 	onLoad((options: UTSJSONObject | null) => {
-	    console.log('URL参数:', options)
-		 // 延迟一点执行,确保App.vue已保存到缓存
-		setTimeout(() => {
-			// 2. 从页面参数获取
-			if (options != null) {
-				const ticketValue = options['ticket']
-				const nextUrl = options['next']
-				if (ticketValue != null) {
-					if (typeof ticketValue == 'string') {
-						if(ticketValue.length > 0){
-							const ticket = ticketValue as string
-							console.log('获取到自动登录ticket:', ticket)
-							handleLoginSSO(ticket, nextUrl);
-						}
-					}
-				}
-			}
-		}, 500)
-	})
+    console.log('URL参数:', options)
+    // 直接检查是否有ticket参数,立即执行自动登录
+    if (options != null) {
+        const ticketValue = options['ticket']
+        const nextUrl = options['next']
+        if (ticketValue != null && typeof ticketValue == 'string' && ticketValue.length > 0) {
+            const ticket = ticketValue as string
+            console.log('获取到自动登录ticket:', ticket)
+            isAutoLogin.value = true // 设置自动登录标志
+            handleLoginSSO(ticket, nextUrl);
+            return; // 立即返回,不显示登录页
+        }
+    }
+})
 
     // 初始化:加载记住的账号密码
     onMounted(() => {
-		checkVersion()
+        // 如果正在进行自动登录,跳过记住密码的逻辑
+        if (isAutoLogin.value) {
+            return;
+        }
+        
+        checkVersion()
         const remembered = getRememberedAccount()
         if (remembered != null) {
             username.value = remembered['username'] as string

+ 2 - 2
utils/request.uts

@@ -13,8 +13,8 @@ export type RequestConfig = {
 };
 
 // 基础 URL
-// const BASE_URL = "http://192.168.2.17:83";
-// const BASE_URL = "http://192.168.189.43:83";
+// const BASE_URL = "http://192.168.2.17:8300";
+// const BASE_URL = "http://192.168.189.43:8300";
 // const BASE_URL = "http://222.243.138.146:8150/prod-api" //测试服务器;
 const BASE_URL = "http://222.243.138.146:880/prod-api" //正式服务器;