修复公众号-素材管理 上传时缺少accountId参数

Signed-off-by: Evol郑天 <jpevol@163.com>
(cherry picked from commit fd266516fe)
This commit is contained in:
Evol郑天 2023-11-29 01:24:42 +00:00 committed by shizhong
parent 57b3b0499e
commit 2dc6c8ba93
4 changed files with 15 additions and 3 deletions

View File

@ -33,6 +33,8 @@ const message = useMessage()
const props = defineProps<{ type: UploadType }>() const props = defineProps<{ type: UploadType }>()
const accountId = inject<number>('accountId')
const fileList = ref<UploadUserFile[]>([]) const fileList = ref<UploadUserFile[]>([])
const emit = defineEmits<{ const emit = defineEmits<{
(e: 'uploaded', v: void) (e: 'uploaded', v: void)
@ -41,7 +43,8 @@ const emit = defineEmits<{
const uploadData: UploadData = reactive({ const uploadData: UploadData = reactive({
type: UploadType.Image, type: UploadType.Image,
title: '', title: '',
introduction: '' introduction: '',
accountId: accountId!
}) })
/** 上传前检查 */ /** 上传前检查 */

View File

@ -59,6 +59,8 @@ import { HEADERS, UploadData, UPLOAD_URL, UploadType, beforeVideoUpload } from '
const message = useMessage() const message = useMessage()
const accountId = inject<number>('accountId')
const uploadRules: FormRules = { const uploadRules: FormRules = {
title: [{ required: true, message: '请输入标题', trigger: 'blur' }], title: [{ required: true, message: '请输入标题', trigger: 'blur' }],
introduction: [{ required: true, message: '请输入描述', trigger: 'blur' }] introduction: [{ required: true, message: '请输入描述', trigger: 'blur' }]
@ -89,7 +91,8 @@ const fileList = ref<UploadUserFile[]>([])
const uploadData: UploadData = reactive({ const uploadData: UploadData = reactive({
type: UploadType.Video, type: UploadType.Video,
title: '', title: '',
introduction: '' introduction: '',
accountId: accountId!
}) })
const uploadFormRef = ref<FormInstance | null>(null) const uploadFormRef = ref<FormInstance | null>(null)

View File

@ -9,6 +9,7 @@ interface UploadData {
type: UploadType type: UploadType
title: string title: string
introduction: string introduction: string
accountId: number
} }
const beforeImageUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) => const beforeImageUpload: UploadProps['beforeUpload'] = (rawFile: UploadRawFile) =>

View File

@ -101,17 +101,22 @@ const type = ref<UploadType>(UploadType.Image) // 素材类型
const loading = ref(false) // const loading = ref(false) //
const list = ref<any[]>([]) // const list = ref<any[]>([]) //
const total = ref(0) // const total = ref(0) //
const accountId = ref(-1)
provide('accountId', accountId)
// //
const queryParams = reactive({ const queryParams = reactive({
pageNo: 1, pageNo: 1,
pageSize: 10, pageSize: 10,
accountId: -1, accountId: accountId,
permanent: true permanent: true
}) })
const showCreateVideo = ref(false) // const showCreateVideo = ref(false) //
/** 侦听公众号变化 **/ /** 侦听公众号变化 **/
const onAccountChanged = (id: number) => { const onAccountChanged = (id: number) => {
accountId.value = id
queryParams.accountId = id queryParams.accountId = id
queryParams.pageNo = 1 queryParams.pageNo = 1
getList() getList()