|
|
@@ -11,6 +11,7 @@ import MyPopconfirm from '@/components/MyPopconfirm'
|
|
|
import dayjs from 'dayjs'
|
|
|
import { A7AddType, A7tableType } from '@/types/api/A7collection'
|
|
|
import ZupTypes from '@/components/ZupTypes'
|
|
|
+import { baseURL } from '@/utils/http'
|
|
|
|
|
|
type Props = {
|
|
|
editInfo: A1EditInfoType
|
|
|
@@ -143,9 +144,31 @@ function A7add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
|
|
|
const coverUrl1 = ZupThumbRef1.current?.fileComFileResFu()
|
|
|
const { fileList, sonType, sonIsOk } = ZupTypesRef.current?.fileComFileResFu()
|
|
|
+ console.log(fileList, sonType, sonIsOk, '1111111')
|
|
|
// 没有传 封面图
|
|
|
if (!coverUrl1.url) return MessageFu.warning('请上传首页封面图!')
|
|
|
if (sonIsOk) return MessageFu.warning('请上传附件!')
|
|
|
+ const modelFile = fileList.model.filePath || ''
|
|
|
+ const commonUrl = 'https://www.4dmodel.com/'
|
|
|
+ const sceneUrl = 'https://4dscene.4dage.com/'
|
|
|
+ if (modelFile !== '') {
|
|
|
+ if (modelFile.trim() === '' || /\s/.test(modelFile))
|
|
|
+ return MessageFu.warning('链接地址不能为空或包含空白字符,请输入有效的链接。')
|
|
|
+
|
|
|
+ // 不是以http:// 或 https:// 开头
|
|
|
+ if (!modelFile.startsWith('http://') && !modelFile.startsWith('https://')) {
|
|
|
+ return MessageFu.warning('链接格式不正确,请以 http:// 或 https:// 开头。')
|
|
|
+ }
|
|
|
+ if (
|
|
|
+ !modelFile.includes(baseURL) &&
|
|
|
+ !modelFile.includes(commonUrl) &&
|
|
|
+ !modelFile.includes(sceneUrl)
|
|
|
+ ) {
|
|
|
+ return MessageFu.warning('填写域名地址未在小程序配置,请前往小程序后台的“业务域名”配置')
|
|
|
+ }
|
|
|
+ } else if (sonType.includes('model') && modelFile === '') {
|
|
|
+ return MessageFu.warning('链接地址不能为空或包含空白字符,请输入有效的链接。')
|
|
|
+ }
|
|
|
|
|
|
// 发布
|
|
|
const obj1: A7AddType = {
|
|
|
@@ -261,11 +284,11 @@ function A7add({ editInfo, closeFu, addTableFu, editTableFu }: Props) {
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item label='尺寸' name='size'>
|
|
|
- <Input placeholder='请输入内容,最多30字' maxLength={30} showCount />
|
|
|
+ <Input placeholder='请输入内容,最多100字' maxLength={100} showCount />
|
|
|
</Form.Item>
|
|
|
|
|
|
<Form.Item label='简介' name='remark'>
|
|
|
- <TextArea maxLength={1000} showCount placeholder='请输入内容,不超过1000个字' />
|
|
|
+ <TextArea maxLength={2000} showCount placeholder='请输入内容,不超过2000个字' />
|
|
|
</Form.Item>
|
|
|
|
|
|
{/* 封面 */}
|