Commit ff1475fa authored by linwenqing's avatar linwenqing

fix:读取和拍摄照片不需要授权也可以

parent 5141f95d
...@@ -40,10 +40,10 @@ function openSetting() { ...@@ -40,10 +40,10 @@ function openSetting() {
//吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息 //吊起设备原生相机相册取得文件,并自动上传七牛,返回七牛key,domain,本地file信息
function getPhoto(type, token) { function getPhoto(type, token) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
hasPermissionOfCamera().then((r) => { // hasPermissionOfCamera().then((r) => {
if (!r) { // if (!r) {
reject(false) // reject(false)
} // }
let sourceType = type == 1 ? ['album'] : ['album', 'camera'] let sourceType = type == 1 ? ['album'] : ['album', 'camera']
uni.chooseImage({ uni.chooseImage({
count: 1, //默认9 count: 1, //默认9
...@@ -66,7 +66,7 @@ function getPhoto(type, token) { ...@@ -66,7 +66,7 @@ function getPhoto(type, token) {
}) })
}, },
}) })
}) // })
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment