forked from Gitlink/forgeplus-react
上传图片地址
This commit is contained in:
parent
0502fb1317
commit
0b4c83d640
|
@ -263,15 +263,18 @@ class CoderRootDirectory extends Component{
|
|||
http_url:branchLastCommit && branchLastCommit.http_url,
|
||||
isSpin: true
|
||||
})
|
||||
const { pathname } = this.props.location;
|
||||
if(pathname && pathname.indexOf("/filesurl/")>-1){
|
||||
let url =pathname.split("filesurl/")[1];
|
||||
this.setState({
|
||||
filePath:url
|
||||
})
|
||||
this.getFileDetail(url,branchLastCommit && branchLastCommit.name);
|
||||
}else{
|
||||
this.getProjectRoot( branchLastCommit && branchLastCommit.name );
|
||||
if(branchLastCommit){
|
||||
const { pathname } = this.props.location;
|
||||
if(pathname && pathname.indexOf("/filesurl/")>-1){
|
||||
let url =pathname.split("filesurl/")[1];
|
||||
this.setState({
|
||||
filePath:url
|
||||
})
|
||||
this.getFileDetail(url, branchLastCommit.name);
|
||||
}else{
|
||||
this.getProjectRoot( branchLastCommit.name );
|
||||
}
|
||||
// this.props.history.location.search.replace( branchLastCommit.name );
|
||||
}
|
||||
}
|
||||
render(){
|
||||
|
|
|
@ -19,7 +19,8 @@ import deepEqual from './deepEqual.js'
|
|||
import { fetchUploadImage } from '../../services/ojService.js';
|
||||
import ImageBlot from './ImageBlot';
|
||||
import FillBlot from './FillBlot';
|
||||
import LinkBlot from './link-blot'
|
||||
import LinkBlot from './link-blot';
|
||||
import { getImageUrl } from 'educoder';
|
||||
var Size = Quill.import('attributors/style/size');
|
||||
Size.whitelist = ['14px', '16px', '18px', '20px', false];
|
||||
var fonts = ['Microsoft-YaHei', 'SimSun', 'SimHei', 'KaiTi', 'FangSong'];
|
||||
|
@ -174,7 +175,7 @@ function QuillForEditor({
|
|||
const result = await fetchUploadImage(formData);
|
||||
// 获取上传图片的url
|
||||
if (result.data && result.data.id) {
|
||||
fileUrl = (`https://testforgeplus.trustie.net/api/attachments/${result.data.id}`);
|
||||
fileUrl = (getImageUrl(`api/attachments/${result.data.id}`));
|
||||
}
|
||||
// 根据id获取文件路径
|
||||
const { width, height } = imgAttrs;
|
||||
|
|
Loading…
Reference in New Issue