diff --git a/public/index.html b/public/index.html index 70396e4ca..b024c3b79 100755 --- a/public/index.html +++ b/public/index.html @@ -20,7 +20,7 @@ - --> @@ -43,7 +43,7 @@
- + diff --git a/src/App.js b/src/App.js index 534706b86..28ec0d5f5 100644 --- a/src/App.js +++ b/src/App.js @@ -213,13 +213,13 @@ class App extends Component { - + {/* */} this.Modifyloginvalue()}> - - - - - + {/* */} + {/* */} + {/* */} + {/* */} + {/* */} {/*项目*/} diff --git a/src/AppConfig.js b/src/AppConfig.js index 153780b3f..69d3cc317 100644 --- a/src/AppConfig.js +++ b/src/AppConfig.js @@ -1,12 +1,9 @@ import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; -import { broadcastChannelOnmessage , isDev, queryString } from 'educoder'; +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: '/' }); - } } } @@ -63,9 +57,9 @@ window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() // TODO 避免重复的请求 https://github.com/axios/axios#cancellation - var - // proxy = "http://localhost:3000" - proxy = "https://forgeplus.trustie.net" + var + // proxy = "http://localhost:3000" + proxy = "https://testforgeplus.trustie.net" const requestMap = {}; window.setfalseInRequestMap = function (keyName) { @@ -109,12 +103,10 @@ export function initAxiosInterceptors(props) { }); axios.interceptors.response.use(function (response) { - - // console.log(".............") if (response === undefined) { return } - const config = response.config + const config = response.config; if (response.data.status === -1) { if (window.location.pathname.startsWith('/tasks/')) { props.showSnackbar(response.data.message || '服务器异常,请联系管理员。') @@ -127,12 +119,10 @@ export function initAxiosInterceptors(props) { }, }); } - throw new axios.Cancel('Operation canceled by the user.'); } if (response.data.status === 403 || response.data.status === "403") { - locationurl('/403'); } @@ -159,8 +149,6 @@ export function initAxiosInterceptors(props) { message501 = false }, 2000); } - - requestMap[response.config.url] = false; setpostcookie(); return response; 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 aeecf7eb2..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); } @@ -427,7 +428,7 @@ class CoderRootDirectory extends Component { width: "60%", render: (text, item) => item.commit && item.commit.message ? - + {item.commit.message} : "" @@ -448,7 +449,7 @@ class CoderRootDirectory extends Component { const urlRoot = filePath === undefined ? "" : `/${filePath}`; let array = filePath && filePath.split("/"); return ( - +
diff --git a/src/forge/Main/CoderRootFileDetail.js b/src/forge/Main/CoderRootFileDetail.js index fd09b335b..2b7eb9aa7 100644 --- a/src/forge/Main/CoderRootFileDetail.js +++ b/src/forge/Main/CoderRootFileDetail.js @@ -107,9 +107,6 @@ class CoderRootFileDetail extends Component { EditFile = (flag) => { const { onEdit } = this.props; onEdit && onEdit(flag); - // this.setState({ - // readOnly: false, - // }); }; DownLoadFile =(url) => { diff --git a/src/forge/Merge/MessageCount.js b/src/forge/Merge/MessageCount.js index c837ccb44..c7052fe72 100644 --- a/src/forge/Merge/MessageCount.js +++ b/src/forge/Merge/MessageCount.js @@ -378,14 +378,12 @@ class MessageCount extends Component {
-
- {data.issue.description && - data.issue.description.length > 0 ? ( - this.commentCtx(data.issue.description) - ) : ( - 没有描述 - )} -
+ { + data.issue.description ? +
{this.commentCtx(data.issue.description)}
+ : +

没有描述

+ }
{pr_status === 2 && ( diff --git a/src/forge/Newfile/m_editor.js b/src/forge/Newfile/m_editor.js index 806154b0c..a2b4216c9 100644 --- a/src/forge/Newfile/m_editor.js +++ b/src/forge/Newfile/m_editor.js @@ -1,6 +1,5 @@ import React, { Component } from "react"; import Editor from "react-monaco-editor"; - import UserSubmitComponent from "./UserSubmitComponent"; import "./index.css"; @@ -29,6 +28,7 @@ class m_editor extends Component { lineHeight: 24, renderLineHighlight: "line", revealHorizontalRightPadding: 5, + placeholder:"请输入内容", readOnly: readOnly, cursorStyle: readOnly ? "underline-thin" : "line", folding: true, @@ -46,16 +46,17 @@ class m_editor extends Component {
+ {!readOnly && ( { this.setState({ isSpin: false }) - console.log(error); }) }else{ this.setState({ isSpin: false }) diff --git a/src/modules/tpm/TPMIndex.css b/src/modules/tpm/TPMIndex.css index f47632d35..cf3b7ffec 100644 --- a/src/modules/tpm/TPMIndex.css +++ b/src/modules/tpm/TPMIndex.css @@ -29,7 +29,7 @@ body>.-task-title { width: 100%; height:70px; min-width: 1200px; - z-index: 1000; + z-index: 10000; -moz-box-shadow: 0px 2px 10px 0px rgba(0,0,0,0.1); background:rgba(255,255,255,1); box-shadow:0px 2px 10px 0px rgba(0,0,0,0.1); diff --git a/src/modules/tpm/TPMIndexHOC.js b/src/modules/tpm/TPMIndexHOC.js index a4c47d4f2..0084c3334 100644 --- a/src/modules/tpm/TPMIndexHOC.js +++ b/src/modules/tpm/TPMIndexHOC.js @@ -8,7 +8,6 @@ import './TPMIndex.css'; import LoginDialog from '../login/LoginDialog'; import AccountProfile from '../user/AccountProfile'; import AccountPhoneemail from '../user/AccountPhoneemail'; -import cookies from 'react-cookies'; export function TPMIndexHOC(WrappedComponent) { return class II extends React.Component { @@ -154,7 +153,7 @@ export function TPMIndexHOC(WrappedComponent) { this.gettablogourlnull(); }); } - + fetchUsers = () => { let url = `/users/get_user_info.json`; axios.get(url).then((response) => { @@ -163,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) @@ -184,15 +186,16 @@ export function TPMIndexHOC(WrappedComponent) { json[key] = value; } } while (arr); - return json; }; + hideLoginDialog = () => { this.setState({ isRender: false, isloginCancel: undefined }) } + showLoginDialog = () => { this.setState({ isRender: true, @@ -209,6 +212,7 @@ export function TPMIndexHOC(WrappedComponent) { AccountProfiletype: false }) } + showProfileCompleteDialog = () => { this.dialogObj = {} this.setState({ @@ -393,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} + > + + } +