From e13624d53ce19ed506c81d835da4c76ff8966a06 Mon Sep 17 00:00:00 2001
From: 小小儁爺 <1694218219@qq.com>
Date: 星期三, 14 一月 2026 12:58:35 +0800
Subject: [PATCH] 1.递交

---
 pages/login/index.vue |  113 ++++++++++++++++++++++++++++++++++++++++----------------
 1 files changed, 80 insertions(+), 33 deletions(-)

diff --git a/pages/login/index.vue b/pages/login/index.vue
index 11526d0..51534e6 100644
--- a/pages/login/index.vue
+++ b/pages/login/index.vue
@@ -3,7 +3,7 @@
 
 		<view class="body">
 
-			<view class="headClass">鏂板嚡杩簯鍒堕��</view>
+			<view class="headClass">鏅鸿兘鍒堕�犱簯骞冲彴</view>
 			<view class="main">
 				<view class="circle">
 					<view class="circleBg"></view>
@@ -32,8 +32,22 @@
 						:disabled="!(usercode.trim().length>0&&userpassword.trim().length>0)" text="绔嬪嵆鐧诲綍"
 						:loading="isDisabledSubmitButton" loadingText="姝e湪鐧诲綍,璇风◢绛�..." class="loginClass"
 						@click="gotoIndex"></u-button>
+
+					<!-- 	<u--text :block='false' color='#0659ff' :size='14' @click="envConfigClick" class='envConfig'
+						text="鐜閰嶇疆"></u--text> -->
 				</view>
 
+				<u-modal :show="isShow" :showCancelButton="isShowCancelButton" :showConfirmButton='false' title=""
+					@confirm='isShowConfirm' @cancel='isShowCancel'>
+					<view>
+						<view>
+							<u--text type="info" :size='32' :block='false' text="褰撳墠鐗堟湰涓嶆槸鏈�鏂扮増鏈紝璇风偣鍑�"></u--text>
+						</view>
+						<view>
+							<u--text :block='false' mode="link" :size='50' text="閾炬帴涓嬭浇" :href="downloadUrl"></u--text>
+						</view>
+					</view>
+				</u-modal>
 
 			</view>
 
@@ -54,27 +68,28 @@
 	import {
 		LoginSave,
 		ForcedOffline,
+		AppUpgrade
 	} from '../../config/api.js';
+	import {
+		decode
+	} from 'jsonwebtoken';
 	export default {
 		data() {
 			return {
 				// #ifdef H5
-				usercode: '999',
+				usercode: '',
 				// #endif
 
 				// #ifdef APP-PLUS
-				usercode: '999',
+				usercode: '',
 				// #endif
 
-				userpassword: '123',
+				userpassword: '',
 				isView: false, //瀵嗙爜鏄惁鍙
-
-
 
 				isDisabledSubmitButton: false, //鎻愪氦鎸夐挳鏄惁澶勪簬鍔犺浇涓�
 
-
-				isShowCancelButton: false,
+				isShowCancelButton: true,
 				isShow: false,
 				downloadUrl: '', //涓嬭浇鍦板潃
 
@@ -86,12 +101,21 @@
 
 		},
 		created() {
-
+			this.getAppUpgrade()
 		},
 		mounted() {
-
+			console.log(this.$baseUrl)
 		},
 		methods: {
+			getAppUpgrade() {
+				AppUpgrade().then(res => {
+					this.isShow = res.data[0].version !== this.$appVersion
+					if (res.data[0].version !== this.$appVersion) { // 璇存槑涓庢渶鏂扮増鏈笉鍖归厤
+						this.downloadUrl = this.$baseUrl.substring(0, 25) + '/APK/JLAPP.apk'
+					}
+				})
+
+			},
 			//瀵嗙爜鏄惁鏌ョ湅  鏄剧ず鏄庢枃
 			isViewClick() {
 				this.isView = !this.isView
@@ -107,36 +131,45 @@
 				LoginSave({
 					params: data
 				}).then(result => {
-					console.log(result.data)
 					if (result.code === '200') {
 						uni.setStorageSync("Token", result.data)
-
-						// uni.setStorageSync("usercode", result.data.usercode)
-						// uni.setStorageSync("username", result.data.username)
-
+						const jwt = decode(result.data)
+						uni.setStorageSync("usercode", jwt.usercode)
+						uni.setStorageSync("username", jwt.username)
+						uni.setStorageSync("storg_code", jwt.storg_code)
+						uni.setStorageSync("storg_name", jwt.storg_name)
 						uni.redirectTo({
 							//鍏抽棴褰撳墠椤甸潰锛岃烦杞埌搴旂敤鍐呯殑鏌愪釜椤甸潰銆�
 							url: '../xtsy/index'
 						});
 						// uni.$u.toast(result.Message)
-					} else if (result.code === '302') {
-						const data2 = {
-							// token: uni.getStorageSync('Token'),
-							token: result.data,
-							rid: ''
-						}
-						ForcedOffline('', {
-							params: data2
-						}).then(res2 => {
-							if (res2.code === '200') {
-								console.log('鎴愬姛浜嗭紒')
-								uni.redirectTo({
-									//鍏抽棴褰撳墠椤甸潰锛岃烦杞埌搴旂敤鍐呯殑鏌愪釜椤甸潰銆�
-									url: '../xtsy/index'
-								});
-							}
-						})
-					} else {
+					}
+
+					// else if (result.code === '302') {
+					// 	const data2 = {
+					// 		// token: uni.getStorageSync('Token'),
+					// 		token: result.data,
+					// 		rid: ''
+					// 	}
+					// 	const jwt = decode(result.data)
+					// 	console.log(jwt, 2)
+					// 	uni.setStorageSync("usercode", jwt.usercode)
+					// 	uni.setStorageSync("username", jwt.username)
+					// 	uni.setStorageSync("storg_code", jwt.storg_code)
+					// 	uni.setStorageSync("storg_name", jwt.storg_name)
+
+					// 	ForcedOffline('', {
+					// 		params: data2
+					// 	}).then(res2 => {
+					// 		if (res2.code === '200') {
+					// 			uni.redirectTo({
+					// 				//鍏抽棴褰撳墠椤甸潰锛岃烦杞埌搴旂敤鍐呯殑鏌愪釜椤甸潰銆�
+					// 				url: '../xtsy/index'
+					// 			});
+					// 		}
+					// 	})
+					// }
+					else {
 						this.isDisabledSubmitButton = false
 					}
 				})
@@ -150,6 +183,14 @@
 			isShowCancel() {
 				this.isShow = false
 			},
+
+
+			// 鐜閰嶇疆鐐瑰嚮
+			envConfigClick() {
+				uni.navigateTo({
+					url: './hjpz'
+				});
+			}
 
 
 		}
@@ -235,6 +276,12 @@
 		font-size: 16px !important;
 		line-height: 20px !important;
 	}
+
+	.envConfig {
+		position: absolute;
+		right: 0rpx;
+		bottom: -120rpx;
+	}
 </style>
 <style>
 	page {

--
Gitblit v1.9.3