Skip to content

Commit fd26651

Browse files
jpevolgitee-org
authored andcommitted
修复公众号-素材管理 上传时缺少accountId参数
Signed-off-by: Evol郑天 <[email protected]>
1 parent 57b20f1 commit fd26651

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

src/views/mp/material/components/UploadFile.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ const message = useMessage()
3333
3434
const props = defineProps<{ type: UploadType }>()
3535
36+
const accountId = inject<number>('accountId')
37+
3638
const fileList = ref<UploadUserFile[]>([])
3739
const emit = defineEmits<{
3840
(e: 'uploaded', v: void)
@@ -41,7 +43,8 @@ const emit = defineEmits<{
4143
const uploadData: UploadData = reactive({
4244
type: UploadType.Image,
4345
title: '',
44-
introduction: ''
46+
introduction: '',
47+
accountId: accountId!
4548
})
4649
4750
/** 上传前检查 */

src/views/mp/material/components/UploadVideo.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ import { HEADERS, UploadData, UPLOAD_URL, UploadType, beforeVideoUpload } from '
5959
6060
const message = useMessage()
6161
62+
const accountId = inject<number>('accountId')
63+
6264
const uploadRules: FormRules = {
6365
title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
6466
introduction: [{ required: true, message: '请输入描述', trigger: 'blur' }]
@@ -89,7 +91,8 @@ const fileList = ref<UploadUserFile[]>([])
8991
const uploadData: UploadData = reactive({
9092
type: UploadType.Video,
9193
title: '',
92-
introduction: ''
94+
introduction: '',
95+
accountId: accountId!
9396
})
9497
9598
const uploadFormRef = ref<FormInstance | null>(null)

src/views/mp/material/components/upload.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ interface UploadData {
99
type: UploadType
1010
title: string
1111
introduction: string
12+
accountId: number
1213
}
1314

1415
const beforeImageUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) =>

src/views/mp/material/index.vue

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,17 +99,22 @@ const type = ref<UploadType>(UploadType.Image) // 素材类型
9999
const loading = ref(false) // 遮罩层
100100
const list = ref<any[]>([]) // 总条数
101101
const total = ref(0) // 数据列表
102+
103+
const accountId = ref(-1)
104+
provide('accountId', accountId)
105+
102106
// 查询参数
103107
const queryParams = reactive({
104108
pageNo: 1,
105109
pageSize: 10,
106-
accountId: -1,
110+
accountId: accountId,
107111
permanent: true
108112
})
109113
const showCreateVideo = ref(false) // 是否新建视频的弹窗
110114
111115
/** 侦听公众号变化 **/
112116
const onAccountChanged = (id: number) => {
117+
accountId.value = id
113118
queryParams.accountId = id
114119
queryParams.pageNo = 1
115120
getList()

0 commit comments

Comments
 (0)