Commit 2d535161 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理商品描述上传文件没token问题

parent ff8b7fea
......@@ -9,12 +9,14 @@ import ImgCrop from 'antd-img-crop';
import { inject, observer } from 'mobx-react'
import { store } from '@/store'
import { getAuth } from '@/utils/auth'
const ProductDescFormDefualt: React.FC<{}> = (props) => {
const [fileImageList, setFileImageList] = useState<any>([])
const [videoList, setVideoList] = useState<any>([])
const flagRef = useRef<boolean>(false)
const [isLoading, setIsLoading] = useState<boolean>(false) // 上传的加载状态
const { userId, memberId, token } = getAuth() || {}
const { ProductStore } = store
const { productInfoByEdit, setProductDescription, selectCategoryId } = ProductStore
......@@ -56,6 +58,7 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
name: 'file',
action: '/api/file/file/upload',
showUploadList: false,
headers: { token },
data: { fileType: UPLOAD_TYPE },
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/jpg' || file.type === 'image/png' || file.type === 'image/gif';
......@@ -91,6 +94,7 @@ const ProductDescFormDefualt: React.FC<{}> = (props) => {
name: 'file',
action: '/api/file/file/upload',
showUploadList: false,
headers: { token },
data: { fileType: UPLOAD_TYPE },
beforeUpload(file) {
const isVideo = file.type === 'video/mp4';
......
......@@ -303,7 +303,7 @@ const DirectChannel: React.FC<{}> = () => {
PublicApi.getTemplateWebMemberChannelWebFindCurrMemberChannel().then(res => {
if(res.data.id){
setCheckedValues(values)
setShopId(res.data.id)
setShopId(res?.data?.id)
}else{
message.error('您还没有开通店铺,无法上下架商品!')
}
......
......@@ -84,7 +84,7 @@ const FirstApprovedOrder:React.FC<FirstApprovedOrderProps> = (props) => {
}}
formilyChilds={{
children: <Space>
<Button onClick={handleSubmitBatch} loading={loading}>批量提交审核</Button>
<Button onClick={handleSubmitBatch} loading={loading}>批量归档</Button>
</Space>,
layouts: {
span: 8
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment