diff --git a/src/AppConfig.js b/src/AppConfig.js index 153780b3f..644676c73 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -4,9 +4,6 @@ import { broadcastChannelOnmessage , isDev, queryString } from 'educoder'; import { notification } from 'antd'; import cookie from 'react-cookies'; import './index.css'; -const $ = window.$; -let timestamp; -let checkSubmitFlg = false; let message501 = false; broadcastChannelOnmessage('refreshPage', () => { @@ -39,9 +36,7 @@ function clearAllCookie() { } clearAllCookie(); function setpostcookie() { - const str = window.location.pathname; - let newdomain = ".educoder.net" if (str.indexOf("/wxcode") !== -1) { console.log("123") cookie.remove('_educoder_session', { path: '/' }); @@ -53,7 +48,6 @@ function setpostcookie() { cookie.save('_educoder_session', _educoder_sessions[1], { domain: '.educoder.net', path: '/' }); let autologin_trusties = _search.split('&')[1].split('='); cookie.save('autologin_trustie', autologin_trusties[1], { domain: '.educoder.net', path: '/' }); - } } } diff --git a/src/forge/Index.js b/src/forge/Index.js index 6157aa64d..eca6d8719 100644 --- a/src/forge/Index.js +++ b/src/forge/Index.js @@ -52,7 +52,6 @@ class Index extends Component { )} > ( diff --git a/src/forge/Main/CoderRootDirectory.js b/src/forge/Main/CoderRootDirectory.js index 47c2b0a52..affbd5140 100644 --- a/src/forge/Main/CoderRootDirectory.js +++ b/src/forge/Main/CoderRootDirectory.js @@ -89,9 +89,9 @@ class CoderRootDirectory extends Component { if (search && search.indexOf("?url=") > -1) { let url = search.split("?url=")[1]; this.setState({ - filePath: url, + filePath: decodeURI(url), }); - this.getFileDetail(url); + this.getFileDetail(decodeURI(url)); } else { const { branch } = this.state; this.getProjectRoot(branchName || branch); @@ -195,6 +195,9 @@ class CoderRootDirectory extends Component { } }).then((result)=>{ let entries = result.data && result.data.entries; + this.setState({ + isSpin:false + }) if( entries && entries.length > 0){ let { chooseType } = this.state; // 当前返回的子目录只有一条数据,且这条数据返回的是文件类型 @@ -202,14 +205,12 @@ class CoderRootDirectory extends Component { this.setState({ fileDetail:entries, rootList:undefined, - isSpin:false, subFileType:false }) }else{ this.setState({ fileDetail:undefined, rootList:entries, - isSpin:false, branchLastCommit:result.data.last_commit && result.data.last_commit.commit, lastCommitAuthor:result.data.last_commit && (result.data.last_commit.author || (result.data.last_commit.commit && result.data.last_commit.commit.author)) }) @@ -326,9 +327,9 @@ class CoderRootDirectory extends Component { if (search && search.indexOf("?url=") > -1) { let url = search.split("?url=")[1]; this.setState({ - filePath: url, + filePath: decodeURI(url), }); - this.getFileDetail(url, value); + this.getFileDetail(decodeURI(url), value); } else { this.getProjectRoot(value); } @@ -448,7 +449,7 @@ class CoderRootDirectory extends Component { const urlRoot = filePath === undefined ? "" : `/${filePath}`; let array = filePath && filePath.split("/"); return ( - +
diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index e267d8d32..0084c3334 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -153,7 +153,7 @@ export function TPMIndexHOC(WrappedComponent) { this.gettablogourlnull(); }); } - + fetchUsers = () => { let url = `/users/get_user_info.json`; axios.get(url).then((response) => { @@ -162,6 +162,9 @@ export function TPMIndexHOC(WrappedComponent) { this.setState({ tpmLoading: false }) + if (this.props.match.path === "/" && response.data.login) { + this.props.history.push(`/users/${response.data.login}`); + } } }).catch((error) => { console.log(error) @@ -394,11 +397,15 @@ export function TPMIndexHOC(WrappedComponent) { tip={this._gLoadingTip || "加载中..."} >
- this.initCommonState(user)} - {...this.props} {...this.state} - {...common} - > - + { + current_user && + this.initCommonState(user)} + {...this.props} {...this.state} + {...common} + > + + } +