diff --git a/src/pages/StreamerInformation/index.jsx b/src/pages/StreamerInformation/index.jsx index a24c5c7..36ea58b 100644 --- a/src/pages/StreamerInformation/index.jsx +++ b/src/pages/StreamerInformation/index.jsx @@ -322,6 +322,33 @@ const StreamerInformationContent = () => { const newPosterId = [...oldPosterId, ...displayPosterId]; const newVideoId = [...oldVideoId, ...displayVideoId]; const newGalleryId = [...oldGalleryId, ...displayGalleryId]; + if ( + newPosterId.length === 0 || + newVideoId.length === 0 || + newGalleryId.length < 2 + ) { + alert("请确保封面、视频不为空,且相册大于2"); + return; + } + if ( + !defaultValues.key || + !value.signature || + !value.age || + !value.height || + !value.weight || + !value.constellation || + !value.location || + !value.fans || + !value.wechat_price || + !value.auto_response_message + ) { + alert("请完善信息后提交"); + return; + } + if (value.wechat_lock_type === 0 && !value.wechat) { + alert("请填写微信后提交"); + return; + } try { const base = baseRequest(); const detailResponse = await fetch(`/op/streamer/update`, { @@ -349,28 +376,7 @@ const StreamerInformationContent = () => { ...base, }), }); - console.log(value); - console.log({ - mid: defaultValues.key, - gender: parseInt(value.gender, 10), - wechat_contact: value.wechat, - bio: value.signature, - cover: { image_ids: newPosterId }, - shorts: { video_ids: newVideoId }, - album: { image_ids: newGalleryId }, - age: parseInt(value.age, 10), - height: parseInt(value.height, 10), - weight: parseInt(value.weight, 10), - constellation: value.constellation, - city: value.location, - wechat_lock_type: parseInt(value.wechat_lock_type, 10), - fans: parseInt(value.fans, 10), - wechat_coin_price: parseInt(value.wechat_price, 10) * 10, - auto_response_message: value.auto_response_message, - ...base, - }); const detailData = await detailResponse.json(); - console.log(detailData); if (detailData.ret === -1) { alert(detailData.msg); return; @@ -756,12 +762,9 @@ const StreamerInformationContent = () => { 相册图片:

{defaultMedia.displayGallery.length !== 0 && ( -
+
{defaultMedia.displayGallery.map((item) => ( -
+