<!-- 选择照片所需权限 -->
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
uni.chooseImage({
count: 1,
sizeType: ['original', 'compressed'],
sourceType: ['album','camera'],
success: (chooseImageRes) => {
const tempFilePaths = chooseImageRes.tempFilePaths;
if(this.fujianImg==null){
this.fujianImg=[];
}
const uploadTask = uni.uploadFile({
header: {
token: getApp().globalData.token
},
url: this.$baseUrl+'/user/upload',
filePath: tempFilePaths[0],
name:'file',
success: (uploadFileRes) => {
var res = JSON.parse(uploadFileRes.data);
}
});
}
});
e***@126.com (作者)
targetSdkVersion 是30
2020-08-24 14:34
DCloud_Android_ST
回复 e***@126.com: 改为28
2020-08-24 14:42
e***@126.com (作者)
回复 DCloud_Android_ST: 感谢大神。。问题解决了。多谢
2020-08-24 14:47