修改开源夏令营文件上传服务以及banner图压缩以及新闻公告代码优化

This commit is contained in:
谢思 2022-04-15 17:11:20 +08:00
parent bce4543ab4
commit 3bf38174b3
3 changed files with 7 additions and 6 deletions

View File

@ -1,9 +1,10 @@
import React , { useCallback, useEffect , useState } from 'react';
import { Breadcrumb, Button, Form, Input, Select, Upload, Modal } from 'antd';
import {getUploadActionUrl} from 'educoder';
import {getUserApplyInfo, applyGlcc} from '../api';
import axios from 'axios';
import TextArea from 'antd/lib/input/TextArea';
import { httpUrl } from '../fetch';
import { main_site_url } from '../fetch';
import banner from "../img/banner.png";
import './index.scss';
const Option = Select.Option;
@ -80,7 +81,7 @@ function Apply(props) {
onOk: ()=>{
const params ={
...values,
projectLogoId: values.logo.file.response.data.id,
projectLogoId: values.logo.file.response.id,
userId: current_user.user_id,
userName: current_user.username
}
@ -176,12 +177,12 @@ function Apply(props) {
'logo格式为png、jpg、jpeg限制上传大小2m建议上传尺寸为382*228',
'logo',
[{ required: true, message: "请正确上传项目logo" }],
userApplyInfo && userApplyInfo.projectLogoId ? <div className='projectLogo'><img src={`${httpUrl}/busiAttachments/download/${userApplyInfo.projectLogoId}`}/></div>
userApplyInfo && userApplyInfo.projectLogoId ? <div className='projectLogo'><img src={`${main_site_url}/api/attachments/${userApplyInfo.projectLogoId}`}/></div>
:<Upload
listType="picture-card"
className="avatar-uploader"
showUploadList={false}
action={`${httpUrl}/busiAttachments/upload`}
action={getUploadActionUrl()}
accept=".png,.jpg,.jpeg"
beforeUpload={beforeUpload}
onChange={handleChange}

View File

@ -22,11 +22,11 @@ function News() {
<h3 className="glcc-tit">新闻中心</h3>
<div className="news-content">
{list.length && <div className="main-news">
{list.length ? <div className="main-news">
<h3 className="news-tit ellipsis-2">{list[0].title}</h3>
<div className="news-date">{list[0].created_time && list[0].created_time.split(' ')[0]}</div>
<Button type="link" ><a target="_black" href={list[0].url}>查看详情</a></Button>
</div>}
</div> : ''}
<div className="news-box">
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 MiB

After

Width:  |  Height:  |  Size: 479 KiB