uni-auth 1.1.6 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-auth",
3
- "version": "1.1.6",
3
+ "version": "1.1.8",
4
4
  "main": "src/index.js",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -1,17 +1,14 @@
1
1
  <template>
2
- <!-- #ifdef APP-PLUS -->
3
- <!-- #ifndef APP-IOS -->
2
+ <!-- #ifdef APP -->
4
3
  <view class="auth-pop" :style="{ marginTop: safeH }" v-if="isPermissionAlertShow">
5
4
  <view class="title">{{ type }}权限使用说明</view>
6
5
  <view class="msg">{{ contentEnum['android'][type] }}</view>
7
6
  </view>
8
- <!-- #ifdef APP-PLUS -->
9
7
  <!-- #endif -->
10
8
  </template>
11
9
 
12
10
  <script setup>
13
- // #ifdef APP-PLUS
14
- // #ifndef APP-IOS
11
+ // #ifdef APP
15
12
  import { onMounted, onUnmounted, computed, ref } from 'vue'
16
13
  import { contentEnum, safeHeight } from '../common/index.js'
17
14
  const type = ref('')
@@ -24,15 +21,18 @@ const props = defineProps({
24
21
  },
25
22
  })
26
23
  onMounted(() => {
27
- permissionListener.value = uni.createRequestPermissionListener()
28
- permissionListener.value.onConfirm((e) => {
29
- type.value = uni.getStorageSync('authCode') || ''
30
- uni.removeStorageSync('authCode')
31
- if (type.value) isPermissionAlertShow.value = true
32
- })
33
- permissionListener.value.onComplete((e) => {
34
- isPermissionAlertShow.value = false
35
- })
24
+ const systemInfo = uni.getSystemInfoSync()
25
+ if (systemInfo.platform !== 'ios') {
26
+ permissionListener.value = uni.createRequestPermissionListener()
27
+ permissionListener.value.onConfirm((e) => {
28
+ type.value = uni.getStorageSync('authCode') || ''
29
+ uni.removeStorageSync('authCode')
30
+ if (type.value) isPermissionAlertShow.value = true
31
+ })
32
+ permissionListener.value.onComplete((e) => {
33
+ isPermissionAlertShow.value = false
34
+ })
35
+ }
36
36
  })
37
37
  const safeH = computed(() => {
38
38
  if (props.top) return props.top + 'px'
@@ -43,7 +43,6 @@ onUnmounted(() => {
43
43
  permissionListener.value.stop()
44
44
  })
45
45
  // #endif
46
- // #endif
47
46
  </script>
48
47
 
49
48
  <style scoped>