uni-auth 1.0.3 → 1.0.5
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 +1 -1
- package/src/common/index.js +1 -1
- package/src/index.js +2 -2
- package/src/util/app.js +14 -1
package/package.json
CHANGED
package/src/common/index.js
CHANGED
|
@@ -19,7 +19,7 @@ export function hintOpenAuth(params = {}) {
|
|
|
19
19
|
const { code, platform = 'android', content = '', isOpenAuth = false } = params || {}
|
|
20
20
|
return new Promise((resolve, reject) => {
|
|
21
21
|
uni.showModal({
|
|
22
|
-
content
|
|
22
|
+
content,
|
|
23
23
|
showCancel: platform !== 'ios',
|
|
24
24
|
cancelText: '拒绝',
|
|
25
25
|
confirmText: platform === 'ios' ? '下一步' : '同意',
|
package/src/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { appAuth } from './util/app.js'
|
|
2
|
+
import { wxAuth } from './util/wx.js'
|
|
3
3
|
export { default as AuthPop } from './components/AuthPop.vue'
|
|
4
4
|
|
|
5
5
|
export async function ifUserAuth(code) {
|
package/src/util/app.js
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
import { hintOpenAuth, contentEnum } from '../common/index.js'
|
|
2
|
-
|
|
2
|
+
const APP = {
|
|
3
|
+
ios: {
|
|
4
|
+
相册: 'albumAuthorized',
|
|
5
|
+
相机: 'cameraAuthorized',
|
|
6
|
+
麦克风: 'microphoneAuthorized',
|
|
7
|
+
},
|
|
8
|
+
android: {
|
|
9
|
+
相册: 'android.permission.WRITE_EXTERNAL_STORAGE',
|
|
10
|
+
相机: 'android.permission.WRITE_EXTERNAL_STORAGE',
|
|
11
|
+
麦克风: 'android.permission.RECORD_AUDIO',
|
|
12
|
+
设备信息: 'android.permission.READ_PHONE_STATE',
|
|
13
|
+
电话: 'android.permission.CALL_PHONE',
|
|
14
|
+
},
|
|
15
|
+
}
|
|
3
16
|
export function appAuth(code = '相册') {
|
|
4
17
|
return new Promise((resolve, reject) => {
|
|
5
18
|
const platform = uni.getSystemInfoSync().platform // ios/android
|