|
@@ -57,6 +57,11 @@ export default defineComponent({
|
|
|
type: String,
|
|
|
default: 'daya'
|
|
|
},
|
|
|
+ path: {
|
|
|
+ // 创建的目录
|
|
|
+ type: String,
|
|
|
+ default: ''
|
|
|
+ },
|
|
|
disabled: {
|
|
|
type: Boolean,
|
|
|
default: false
|
|
@@ -68,7 +73,7 @@ export default defineComponent({
|
|
|
postMessage(
|
|
|
{
|
|
|
api: 'chooseFile',
|
|
|
- content: { type: 'img', max: 1, bucket: this.bucket }
|
|
|
+ content: { type: 'img', max: 1, bucket: this.bucket, path: this.path }
|
|
|
},
|
|
|
(res: any) => {
|
|
|
console.log(res, 'fileUrl')
|
|
@@ -126,7 +131,8 @@ export default defineComponent({
|
|
|
}
|
|
|
const signUrl = state.platformApi + '/open/getUploadSign'
|
|
|
const tempName = file.name || ''
|
|
|
- const fileName = tempName && tempName.replace(/ /gi, '_')
|
|
|
+ console.log(this.path)
|
|
|
+ const fileName = this.path + (tempName && tempName.replace(/ /gi, '_'))
|
|
|
const key = new Date().getTime() + fileName
|
|
|
console.log(file)
|
|
|
|