Pārlūkot izejas kodu

app新增登录日志

李书文 1 gadu atpakaļ
vecāks
revīzija
08702bf209
1 mainītis faili ar 15 papildinājumiem un 1 dzēšanām
  1. 15 1
      pages/login/login.vue

+ 15 - 1
pages/login/login.vue

@@ -45,12 +45,26 @@ export default {
 			uni.switchTab({ url: '/pages/index/index' });
 			return;
 		}
+		//获取版本号和设备信息
+		uni.getSystemInfo({
+			success: res => {
+				this.item.deviceMode = res.model + ' ' + res.system;
+				// #ifdef APP-PLUS
+				plus.runtime.getProperty(plus.runtime.appid, wgtinfo => {
+					this.item.appVersion = wgtinfo.versionCode;
+				});
+				// #endif
+				// #ifdef H5
+				this.item.appVersion = '1.0.0';
+				// #endif
+			}
+		});
 	},
 	methods: {
 		submit() {
 			let rule = [
 				{ name: 'phone', checkType: 'notnull', errorMsg: '手机号不能为空' },
-			/* 	{ name: 'phone', checkType: 'phoneno', errorMsg: '请输入正确的手机号' }, */
+				/* 	{ name: 'phone', checkType: 'phoneno', errorMsg: '请输入正确的手机号' }, */
 				{ name: 'password', checkType: 'notnull', errorMsg: '请输入密码' },
 				{ name: 'checked', checkType: 'notnull', errorMsg: '请同意并勾选协议' }
 			];