Explorar el Código

修改安卓弹出权限异常

wangxy hace 1 semana
padre
commit
2491cffb9c
Se han modificado 1 ficheros con 16 adiciones y 13 borrados
  1. 16 13
      pages/login/index.vue

+ 16 - 13
pages/login/index.vue

@@ -249,17 +249,20 @@
 		agreeContentDialogRef.value.handleShow();
 	};
 	const getUUid = (data) => {
-    plus.device.getInfo({
-      success: (res) => {
-        // res.uuid 是设备的 UUID(iOS 下为 identifierForVendor)
-        console.log('res', res);
-        uuid.value = res.uuid;
-        console.log('iOS 设备 UUID:', uuid.value);
-      },
-      fail: (err) => {
-        console.error('获取设备信息失败:', err);
-      }
-    });
+    const systemInfo = uni.getSystemInfoSync();
+    if (systemInfo.platform == 'ios') {
+      plus.device.getInfo({
+        success: (res) => {
+          // res.uuid 是设备的 UUID(iOS 下为 identifierForVendor)
+          console.log('res', res);
+          uuid.value = res.uuid;
+          console.log('iOS 设备 UUID:', uuid.value);
+        },
+        fail: (err) => {
+          console.error('获取设备信息失败:', err);
+        }
+      });
+    }
 	};
 
 	const handleAgreementChange = (event) => {
@@ -274,7 +277,7 @@
 		const systemInfo = uni.getSystemInfoSync();
 		if (indexData.isAgreed === true) {
 
-			if (!uuid.value) {
+      if (!uuid.value && systemInfo.platform == 'ios') {
 				toast("设备id丢失")
 				getUUid()
 				return false
@@ -377,7 +380,7 @@
 		// 		  provider: 'weixin',
 		// 		 	"onlyAuthorize": true, // 微信登录仅请求授权认证
 		// 		  success: function (loginRes) {
-		// 			  		console.log('loginRes',loginRes); 
+		// 			  		console.log('loginRes',loginRes);
 
 		// 		  }
 		// 	  });