소스 검색

修改bug

yu_ber 4 년 전
부모
커밋
df5541e398
1개의 변경된 파일15개의 추가작업 그리고 9개의 파일을 삭제
  1. 15 9
      UI/src/pages/ArticleContentManage/index.js

+ 15 - 9
UI/src/pages/ArticleContentManage/index.js

@@ -178,6 +178,7 @@ class ArticleManage extends React.Component {
         let list = []
         let obj = {}
         obj.url = imgUrlMini
+        obj.status = "done",
         obj.uid = '-2'
         list.push(obj)
         this.setState({
@@ -734,6 +735,19 @@ class ArticleManage extends React.Component {
         <Icon type='plus' />
       </div>
     );
+    let SsoToken = util.auth.getToken();
+    let fileProps = {
+      action: WXMpAPI + "/wx/content/upload/",
+      listType: 'picture-card',
+      fileList: this.state.headImgList,
+      showUploadList: true,
+      onChange: result => this.handleChange(result),
+      onPreview:result => this.onPreview(result),
+      onRemove:result => this.removeImg(result),
+      headers:{
+        'Sso-Token': SsoToken
+      },
+    };
     return (
       <div className="ArticleManage">
         {/* <Modal
@@ -866,15 +880,7 @@ class ArticleManage extends React.Component {
               </Form.Item>
 
               <Form.Item label="封面图片">
-                <Upload
-                  listType="picture-card"
-                  fileList={this.state.headImgList}
-                  showUploadList={{ showPreviewIcon: true }}
-                  onPreview={file => this.onPreview(file)}// 预览
-                  onRemove={file => this.removeImg("headImgList")}
-                  onChange={result => this.handleChange(result, "headImgList")}
-                  action={WXMpAPI + "/wx/content/upload "}
-                >
+                <Upload {...fileProps}>
                   {this.state.headImgList.length >= 1 ? null : uploadButton}
                 </Upload>
               </Form.Item>