This commit is contained in:
caicai8 2020-03-20 20:50:30 +08:00
parent 1457bc1adc
commit 8bb298f062
8 changed files with 11 additions and 19 deletions

View File

@ -128,7 +128,7 @@ export function initAxiosInterceptors(props) {
// TODO 读取到package.json中的配置
var //proxy = "http://localhost:3000"
proxy="http://123.59.135.93:56666"
proxy="https://testforgeplus.trustie.net"
// proxy="http://localhost:3000"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求

View File

@ -28,9 +28,8 @@ class CoderRootCommit extends Component{
}
getCommitList=(branch , page , limit)=>{
const { login } = this.props.current_user;
const { projectsId } = this.props.match.params;
const url = `/${login}/${projectsId}/commits.json`;
const url = `/repositories/${projectsId}/commits.json`;
axios.get(url,{
params:{
sha:branch,

View File

@ -62,11 +62,9 @@ class CoderRootDirectory extends Component{
// 获取根目录
getProjectRoot=(branch)=>{
const { current_user } = this.props;
const { projectsId , author } = this.props.match.params;
const { state } = this.props.history.location;
const { projectsId } = this.props.match.params;
console.log(this.props);
const url = `/${author}/${projectsId}/entries.json`;
const url = `/repositories/${projectsId}/entries.json`;
axios.get((url),{
params:{
branch
@ -125,13 +123,11 @@ class CoderRootDirectory extends Component{
// 获取子目录
getFileDetail=(arr)=>{
const { current_user } = this.props;
const { projectsId } = this.props.match.params;
const { branch } = this.state;
const { state } = this.props.history.location;
const url =`/${state ? state : current_user && current_user.login}/${projectsId}/sub_entries.json`;
const url =`/repositories/${projectsId}/sub_entries.json`;
axios.get(url,{
params:{

View File

@ -153,7 +153,6 @@ class Detail extends Component{
this.setState({
current_user:result.data
})
this.getDetail();
}
}).catch(error=>{
console.log(error)
@ -173,8 +172,8 @@ class Detail extends Component{
// }
getDetail=()=>{
const { projectsId , author } = this.props.match.params;
const url = `/${author}/${projectsId}.json`;
const { projectsId } = this.props.match.params;
const url = `/repositories/${projectsId}.json`;
axios.get(url).then((result)=>{
if(result){
this.setState({

View File

@ -28,7 +28,7 @@ class IndexItem extends Component{
<Link to={`/projects/${item.id}/${item.author && item.author.login}/coder`} className="hide-1 font-16 color-grey-3" style={{whiteSpace:"wrap"}}>{item.name}</Link>
</div>
<div className="p-r-content">
<p className="break_word task-hide flex1" style={{maxHeight:"40px"}}>{item.description}</p>
<p className="break_word task-hide flex1" style={{maxHeight:"40px",width:"0"}}>{item.description}</p>
<span className="p-r-tags">
{/* { item.forked_count ? <span><label>Fork</label><span>{ item.forked_count}</span></span>:"" } */}
<span className="pariseTag"><img src={img_parise} alt="" className="pariseImg"/>点赞 ({ item.praises_count })</span>

View File

@ -74,9 +74,8 @@ class MergeSubmit extends Component{
//获取提交列表
getCommitList=(branch , page , limit)=>{
const { login } = this.props.current_user;
const { projectsId } = this.props.match.params;
const url = `/${login}/${projectsId}/commits.json`;
const url = `/repositories/${projectsId}/commits.json`;
axios.get(url,{
params:{
sha:branch,

View File

@ -168,9 +168,8 @@ class NewMerge extends Component{
//获取提交列表
getCommitList=(branch , page , limit)=>{
const { current_user } = this.props;
const { projectsId } = this.props.match.params;
const url = `/${current_user&&current_user.login}/${projectsId}/commits.json`;
const url = `/repositories/${projectsId}/commits.json`;
axios.get(url,{
params:{
sha:branch,

View File

@ -34,7 +34,7 @@ class Setting extends Component{
getInfo=()=>{
const { current_user } = this.props;
const { projectsId } = this.props.match.params;
const url = `/${current_user.login}/${projectsId}/edit.json`;
const url = `/repositories/${projectsId}/edit.json`;
axios.get(url).then(result=>{
if(result){
this.props.form.setFieldsValue({