Pārlūkot izejas kodu

修改安卓弹出权限异常

wangxy 1 nedēļu atpakaļ
vecāks
revīzija
068e737e00
1 mainītis faili ar 15 papildinājumiem un 13 dzēšanām
  1. 15 13
      pages/login/index.vue

+ 15 - 13
pages/login/index.vue

@@ -249,18 +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) => {
@@ -275,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