forked from Gitlink/forgeplus-react
修改开源夏令营文件上传服务以及banner图压缩以及新闻公告代码优化
This commit is contained in:
parent
bce4543ab4
commit
3bf38174b3
|
@ -1,9 +1,10 @@
|
||||||
import React , { useCallback, useEffect , useState } from 'react';
|
import React , { useCallback, useEffect , useState } from 'react';
|
||||||
import { Breadcrumb, Button, Form, Input, Select, Upload, Modal } from 'antd';
|
import { Breadcrumb, Button, Form, Input, Select, Upload, Modal } from 'antd';
|
||||||
|
import {getUploadActionUrl} from 'educoder';
|
||||||
import {getUserApplyInfo, applyGlcc} from '../api';
|
import {getUserApplyInfo, applyGlcc} from '../api';
|
||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
import TextArea from 'antd/lib/input/TextArea';
|
import TextArea from 'antd/lib/input/TextArea';
|
||||||
import { httpUrl } from '../fetch';
|
import { main_site_url } from '../fetch';
|
||||||
import banner from "../img/banner.png";
|
import banner from "../img/banner.png";
|
||||||
import './index.scss';
|
import './index.scss';
|
||||||
const Option = Select.Option;
|
const Option = Select.Option;
|
||||||
|
@ -80,7 +81,7 @@ function Apply(props) {
|
||||||
onOk: ()=>{
|
onOk: ()=>{
|
||||||
const params ={
|
const params ={
|
||||||
...values,
|
...values,
|
||||||
projectLogoId: values.logo.file.response.data.id,
|
projectLogoId: values.logo.file.response.id,
|
||||||
userId: current_user.user_id,
|
userId: current_user.user_id,
|
||||||
userName: current_user.username
|
userName: current_user.username
|
||||||
}
|
}
|
||||||
|
@ -176,12 +177,12 @@ function Apply(props) {
|
||||||
'logo格式为png、jpg、jpeg,限制上传大小2m,建议上传尺寸为382*228',
|
'logo格式为png、jpg、jpeg,限制上传大小2m,建议上传尺寸为382*228',
|
||||||
'logo',
|
'logo',
|
||||||
[{ required: true, message: "请正确上传项目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
|
:<Upload
|
||||||
listType="picture-card"
|
listType="picture-card"
|
||||||
className="avatar-uploader"
|
className="avatar-uploader"
|
||||||
showUploadList={false}
|
showUploadList={false}
|
||||||
action={`${httpUrl}/busiAttachments/upload`}
|
action={getUploadActionUrl()}
|
||||||
accept=".png,.jpg,.jpeg"
|
accept=".png,.jpg,.jpeg"
|
||||||
beforeUpload={beforeUpload}
|
beforeUpload={beforeUpload}
|
||||||
onChange={handleChange}
|
onChange={handleChange}
|
||||||
|
|
|
@ -22,11 +22,11 @@ function News() {
|
||||||
<h3 className="glcc-tit">新闻中心</h3>
|
<h3 className="glcc-tit">新闻中心</h3>
|
||||||
<div className="news-content">
|
<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>
|
<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>
|
<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>
|
<Button type="link" ><a target="_black" href={list[0].url}>查看详情</a></Button>
|
||||||
</div>}
|
</div> : ''}
|
||||||
|
|
||||||
<div className="news-box">
|
<div className="news-box">
|
||||||
{
|
{
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 MiB After Width: | Height: | Size: 479 KiB |
Loading…
Reference in New Issue