feat: 上传封面图
This commit is contained in:
@@ -57,27 +57,18 @@ export default forwardRef(function UploadImage(props: UploadImageProps, ref) {
|
||||
setVisible(true)
|
||||
setSourceType(sourceType)
|
||||
setMaxCount(maxCount)
|
||||
fetchImages()
|
||||
fetchImages(sourceType)
|
||||
}
|
||||
}))
|
||||
|
||||
function fetchImages() {
|
||||
publishService.getPictures({
|
||||
pageOption: {
|
||||
page: 1,
|
||||
pageSize: 100,
|
||||
},
|
||||
seachOption: {
|
||||
tag: '',
|
||||
resource_type: 'image',
|
||||
dateRange: [],
|
||||
},
|
||||
}).then(res => {
|
||||
if (res.success) {
|
||||
function fetchImages(st: SourceType) {
|
||||
publishService.getPictures({ type: st }).then(res => {
|
||||
console.log(res, 1122)
|
||||
if (res.code === 0) {
|
||||
let start = 0
|
||||
setImages(res.data.data.rows.map(item => ({
|
||||
setImages(res.data.rows.map(item => ({
|
||||
id: (Date.now() + start++).toString(),
|
||||
url: item.thumbnail_url,
|
||||
url: item.file_url,
|
||||
})))
|
||||
} else {
|
||||
// TODO: 显示错误信息
|
||||
|
||||
Reference in New Issue
Block a user