From 74e6e4431b82fcd30e31f59b91bcdf2c8a5cf3f8 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 09 四月 2026 13:12:51 +0800
Subject: [PATCH] 升级app 1.部署修改

---
 src/pages/login.vue |   47 ++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 46 insertions(+), 1 deletions(-)

diff --git a/src/pages/login.vue b/src/pages/login.vue
index 806e964..29bc9bb 100644
--- a/src/pages/login.vue
+++ b/src/pages/login.vue
@@ -37,6 +37,9 @@
       </up-checkbox>
     </view>
   </view>
+  <view class="version-wrap">
+    <text class="version-text">鐗堟湰鍙凤細{{ versionName }}</text>
+  </view>
 </template>
 
 <script setup>
@@ -59,9 +62,11 @@
   import { wxLogin } from "@/api/oauth";
   import { setToken } from "@/utils/auth";
   import View from "@/pages/procurementManagement/procurementLedger/view.vue";
+  import config from "@/config";
   const userStore = useUserStore();
   const useWxLogin = ref(false); // 鏄惁浣跨敤寰俊鐧诲綍
   const rememberPassword = ref(false); // 璁颁綇瀵嗙爜
+  const versionName = ref(config?.appInfo?.version || "1.0.0");
   const loginForm = ref({
     userName: "",
     password: "",
@@ -178,7 +183,7 @@
       sendClientIdToServer();
       // 鍚姩瀹氭椂鑾峰彇鏈娑堟伅鏁伴噺鐨勫畾鏃跺櫒
       startNoticeCountTimer(userId);
-      uni.switchTab({ url: "/pages/works" });
+      uni.switchTab({ url: "/pages/index" });
     });
   }
 
@@ -243,6 +248,35 @@
   }
   // 椤甸潰鍔犺浇鏃舵鏌ユ槸鍚︽湁淇濆瓨鐨勫瘑鐮�
   onMounted(() => {
+    console.log("[login-version] 寮�濮嬭幏鍙栫櫥褰曢〉鐗堟湰锛岄粯璁ゅ��:", versionName.value);
+    // #ifdef MP-WEIXIN
+    try {
+      const accountInfo = uni.getAccountInfoSync();
+      if (accountInfo?.miniProgram?.version) {
+        versionName.value = accountInfo.miniProgram.version;
+        console.log("[login-version] 褰撳墠鐜=MP-WEIXIN锛岀増鏈�=", versionName.value);
+      }
+    } catch (e) {
+      // 鑾峰彇澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
+      console.log("[login-version] MP-WEIXIN 鑾峰彇鐗堟湰澶辫触:", e);
+    }
+    // #endif
+
+    // #ifdef APP-PLUS
+    try {
+      // @ts-ignore
+      if (plus?.runtime?.version) {
+        // @ts-ignore
+        versionName.value = plus.runtime.version;
+        console.log("[login-version] 褰撳墠鐜=APP-PLUS锛岀増鏈�=", versionName.value);
+      }
+    } catch (e) {
+      // 鑾峰彇澶辫触鏃朵娇鐢ㄩ粯璁ゅ��
+      console.log("[login-version] APP-PLUS 鑾峰彇鐗堟湰澶辫触:", e);
+    }
+    // #endif
+    console.log("[login-version] 鏈�缁堢増鏈彿:", versionName.value);
+
     loadPassword();
     getUserLoginFacotryList();
   });
@@ -346,4 +380,15 @@
       }
     }
   }
+
+  .version-wrap {
+    width: 100%;
+    text-align: center;
+    margin-top: 20px;
+  }
+
+  .version-text {
+    font-size: 12px;
+    color: #999;
+  }
 </style>

--
Gitblit v1.9.3