fix6
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 176 KiB |
@@ -268,39 +268,37 @@
|
||||
});
|
||||
},
|
||||
// 正面
|
||||
|
||||
handleUploadSuccess1(response) {
|
||||
const { status,uri } = response
|
||||
if(status === "OK"){
|
||||
this.ruleForm.imageUrl1 = uploadApi.aliyunFileUrl + uri
|
||||
}
|
||||
handleUploadSuccess1(response, file) {
|
||||
// OSS直接上传模式(无callback)
|
||||
const key = this.uploadData.key
|
||||
const fileUrl = 'https://coin-exchange117.oss-cn-shanghai.aliyuncs.com/'
|
||||
this.ruleForm.imageUrl1 = fileUrl + key
|
||||
},
|
||||
// 反面
|
||||
handleUploadSuccess2(response) {
|
||||
const { status,uri } = response
|
||||
if(status === "OK"){
|
||||
this.ruleForm.imageUrl2 = uploadApi.aliyunFileUrl + uri
|
||||
}
|
||||
handleUploadSuccess2(response, file) {
|
||||
const key = this.uploadData.key
|
||||
const fileUrl = 'https://coin-exchange117.oss-cn-shanghai.aliyuncs.com/'
|
||||
this.ruleForm.imageUrl2 = fileUrl + key
|
||||
},
|
||||
// 手持
|
||||
handleUploadSuccess3(response) {
|
||||
const { status,uri } = response
|
||||
if(status === "OK"){
|
||||
this.ruleForm.imageUrl3 = uploadApi.aliyunFileUrl + uri
|
||||
}
|
||||
handleUploadSuccess3(response, file) {
|
||||
const key = this.uploadData.key
|
||||
const fileUrl = 'https://coin-exchange117.oss-cn-shanghai.aliyuncs.com/'
|
||||
this.ruleForm.imageUrl3 = fileUrl + key
|
||||
},
|
||||
async beforeUpload(){
|
||||
let res = await uploadApi.getPreUpload()
|
||||
if(res.data){
|
||||
let preUploadData = res.data
|
||||
let {dir,policy,signature,callback,accessid,host} = preUploadData
|
||||
let {dir,policy,signature,accessid,host} = preUploadData
|
||||
this.uploadHost = host
|
||||
this.uploadData.name=signature
|
||||
this.uploadData.key=`${dir}${new Date().getTime()}.jpg`
|
||||
this.uploadData.policy=policy
|
||||
this.uploadData.OSSAccessKeyId=accessid
|
||||
this.uploadData.success_action_status=200
|
||||
this.uploadData.callback=callback
|
||||
// 移除callback参数,避免OSS回调失败 (CallbackFailed 307)
|
||||
// this.uploadData.callback=callback
|
||||
this.uploadData.signature=signature
|
||||
}else{
|
||||
return Promise.reject()
|
||||
|
||||
Reference in New Issue
Block a user