This commit is contained in:
caishi 2020-11-11 16:09:57 +08:00
parent ef19107fcd
commit 0c59855e9c
11 changed files with 29 additions and 57 deletions

View File

@ -38,7 +38,6 @@ clearAllCookie();
function setpostcookie() {
const str = window.location.pathname;
if (str.indexOf("/wxcode") !== -1) {
console.log("123")
cookie.remove('_educoder_session', { path: '/' });
cookie.remove('autologin_trustie', { path: '/' });
const _params = window.location.search;
@ -58,8 +57,8 @@ export function initAxiosInterceptors(props) {
initOnlineOfflineListener()
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation
var
proxy = "http://localhost:3000"
proxy = "https://testforgeplus.trustie.net"
proxy = "http://localhost:3000";
proxy = "https://testforgeplus.trustie.net";
const requestMap = {};
window.setfalseInRequestMap = function (keyName) {

View File

@ -38,13 +38,11 @@ export const formatDelta = (deltas) => {
alt="${alt}"
/>
`;
// text = "<img src="+url+" width='60px' height='30px' onclick='' alt="+alt+"/>";
}
}
formatted.push(text);
});
console.log(formatted);
return formatted.join('');
}

View File

@ -1,8 +1,6 @@
import React from 'react';
import styled from 'styled-components';
export default ({title , value , className})=>{
const Keys = styled.span`
display:flex;

View File

@ -74,7 +74,7 @@ export default ({ match , history }) => {
{
parents && parents.length > 0 && parents.map((item,key)=>{
return(
<Keys title="父节点" value={truncateCommitId(item.sha) } className="mr20"></Keys>
<Keys title="父节点" value={truncateCommitId(item.sha)} key={key} className="mr20"></Keys>
)
})
}

View File

@ -40,7 +40,7 @@ function Files({data,history,owner,projectsId}){
{
files.map((item,key)=>{
return(
<div className="files">
<div className="files" key={key}>
<FlexAJ className="filesInfo" style={{cursor:item.isBin ? "default":"pointer"}} onClick={()=>showDown(item.flag,key,item.isBin)}>
<AlignCenter>
{!item.isBin ? <i className={!item.flag?"iconfont icon-xiajiantou font-16 mr15 color-grey-9":"iconfont icon-youjiantou font-16 mr15 color-grey-9"}></i>:""}
@ -61,7 +61,7 @@ function Files({data,history,owner,projectsId}){
return(
i.lines && i.lines.length>0 && i.lines.map((item,key)=>{
return(
<div className={(item.type === 2) ? "linesContent add" : item.type === 3 ? "linesContent reduce": item.type===4?"linesContent translate":"linesContent"}>
<div key={k+key} className={(item.type === 2) ? "linesContent add" : item.type === 3 ? "linesContent reduce": item.type===4?"linesContent translate":"linesContent"}>
<span className="lines">
<span>{item.leftIdx && item.leftIdx !=="0" ? item.leftIdx :"" }</span>
<span>{item.rightIdx && item.rightIdx !=="0" ? item.rightIdx :"" }</span>

View File

@ -37,7 +37,6 @@ class MergeSubmit extends Component{
}
getDetail=()=>{
const { projectsId , mergeId, owner} = this.props.match.params;
const url = `/projects/${owner}/${projectsId}/pull_requests/${mergeId}.json`;
axios.get(url).then((result)=>{
@ -84,6 +83,13 @@ class MergeSubmit extends Component{
}).catch((error)=>{console.log(error)})
}
title =()=>{
return(
<div className="f-wrap-between" style={{alignItems:"center"}}>
<span className="font-16">提交列表</span>
</div>
)
}
render(){
const { projectsId , owner } = this.props.match.params;
@ -120,14 +126,6 @@ class MergeSubmit extends Component{
<span>{text}</span>
)
}]
const title =()=>{
return(
<div className="f-wrap-between" style={{alignItems:"center"}}>
<span className="font-16">提交列表</span>
</div>
)
}
return(
<Spin spinning={this.state.isSpin}>
@ -138,11 +136,9 @@ class MergeSubmit extends Component{
showHeader={false}
size="small"
pagination={false}
title={() => title()}
title={() => this.title()}
/>
</Spin>
// </div>
// </div>
)
}
}

View File

@ -63,59 +63,49 @@ class MergeFooter extends Component {
})
const { footer_type , comparesData } = this.props;
const { projectsId , owner , mergeId } = this.props.match.params;
if(index === "2"){
if(footer_type){
if(footer_type){
if(index === "2"){
this.getCommit(owner,projectsId,mergeId);
}else{
this.setState({
commitsData:comparesData.commits,
filesData:comparesData.diff,
commitCount:comparesData.commits_count,
filesCount:comparesData.diff && comparesData.diff.files_count,
isSpin:false
})
this.setState({
isSpin:false
})
}
}else if(index === "3"){
if(footer_type){
}else if(index === "3"){
this.getFile(owner,projectsId,mergeId);
}else{
this.setState({
commitsData:comparesData.commits,
filesData:comparesData.diff,
filesCount:comparesData.diff && comparesData.diff.files_count,
commitCount:comparesData.commits_count
})
this.setState({
isSpin:false
})
}
}else{
this.setState({
commitsData:comparesData.commits,
filesData:comparesData.diff,
commitCount:comparesData.commits_count,
filesCount:comparesData.diff && comparesData.diff.files_count,
isSpin:false
})
}
}
getCommit =(owner,projectsId,mergeId)=>{
const url = `/${owner}/${projectsId}/pulls/${mergeId}/commits.json`;
axios.get(url).then(result=>{
if(result){
this.setState({
commitsData:result.data.commits,
isSpin:false
isSpin:false,
commitCount:result.data.commits_count
})
}
}).catch(error=>{})
}
getFile =(owner,projectsId,mergeId)=>{
const url = `/${owner}/${projectsId}/pulls/${mergeId}/files.json`;
axios.get(url).then(result=>{
if(result){
this.setState({
filesData:result.data,
isSpin:false
isSpin:false,
filesCount:result.data.files_count,
})
}
}).catch(error=>{})
@ -125,7 +115,7 @@ class MergeFooter extends Component {
const { projectsId , owner } = this.props.match.params;
const { footer_type, order_id, data , comparesData } = this.props;
let { pageData , isSpin , activeKey , filesCount, commitCount , filesData , commitsData } = this.state;
let { isSpin , activeKey , filesCount, commitCount , filesData , commitsData } = this.state;
return (
!footer_type && !comparesData || (comparesData && ((comparesData.commits && comparesData.commits.length===0)||(comparesData && !comparesData.diff)) )?"":

View File

@ -307,20 +307,18 @@ export function commentHOC(WrappedComponent) {
this.setState({ newComments })
}
}
console.log(response)
}).catch((error) => {
console.log(error)
})
}
rewardCode(parrentComment, childComment, amount) {
const { challenge, shixun, showSnackbar } = this.props;
const { showSnackbar } = this.props;
let handleComment = parrentComment
if (childComment) {
handleComment = childComment;
}
let handleCommentId = handleComment.id;
// const url = `/api/v1/discusses/${handleCommentId}/reward_code`
const url = `/discusses/${handleCommentId}/reward_code.json`
axios.post(url, {
@ -380,7 +378,6 @@ export function commentHOC(WrappedComponent) {
comments: newComments
})
}
console.log(response)
}).catch((error) => {
console.log(error)
})
@ -421,7 +418,6 @@ export function commentHOC(WrappedComponent) {
}
}
})
console.log(response)
}).catch((error) => {
console.log(error)
})

View File

@ -40,7 +40,6 @@ class CheckAllGroup extends Component{
})
this.props.onChange && this.props.onChange(checkedValues, true);
}
console.log(checkedValues, arguments)
}
render() {

View File

@ -36,7 +36,6 @@ class CompetitionContentsMd extends Component{
chart_rules.rule_contents.map((items,keys)=>{
if(parseInt(this.props.tabkey)===items.competition_stage_id){
console.log(items)
this.contentMdRef.current.setValue(items.content);
this.setState({
contentFileList:undefined,
@ -110,7 +109,6 @@ class CompetitionContentsMd extends Component{
if (response.data) {
const { status } = response.data;
if (status == 0) {
console.log('--- success')
this.props.showNotification(response.data.message);
this.setState((state) => {
const index = state[stateName].indexOf(file);

View File

@ -35,7 +35,6 @@ class Bankcardnumberverification extends Component {
} catch (e) {
}
console.log(this.props.bank_account);
//初始化值
if (this.props.bank_account) {
@ -147,7 +146,6 @@ class Bankcardnumberverification extends Component {
render() {
const { getFieldDecorator } = this.props.form;
const { updating, seconds, secondsFlag, basicInfo, phonebool, emailbool, certification, formationdata, bank_account_editable, leader, bank_account } = this.state
return (
<div>
<div className="flexdirections mt36">