forked from Gitlink/forgeplus-react
tips
This commit is contained in:
parent
171f14bd2a
commit
a0ebba839e
|
@ -29,9 +29,10 @@ if (isDev) {
|
||||||
}
|
}
|
||||||
window._debugType = debugType;
|
window._debugType = debugType;
|
||||||
export function initAxiosInterceptors(props) {
|
export function initAxiosInterceptors(props) {
|
||||||
|
// 判断网络是否连接
|
||||||
initOnlineOfflineListener();
|
initOnlineOfflineListener();
|
||||||
var proxy = "https://testforgeplus.trustie.net";
|
|
||||||
|
|
||||||
|
var proxy = "https://testforgeplus.trustie.net";
|
||||||
//响应前的设置
|
//响应前的设置
|
||||||
axios.interceptors.request.use(
|
axios.interceptors.request.use(
|
||||||
config => {
|
config => {
|
||||||
|
@ -39,7 +40,6 @@ export function initAxiosInterceptors(props) {
|
||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
requestProxy(config);
|
requestProxy(config);
|
||||||
|
|
||||||
let url = `/api${config.url}`;
|
let url = `/api${config.url}`;
|
||||||
|
|
||||||
if (`${config[0]}` !== `true`) {
|
if (`${config[0]}` !== `true`) {
|
||||||
|
|
|
@ -39,10 +39,10 @@ function DetailBanner({ list , owner , projectsId , isManager , url , pathname ,
|
||||||
{
|
{
|
||||||
item.menu_name === "issues" &&
|
item.menu_name === "issues" &&
|
||||||
<li className={pathname==="issues" ? "active" : ""}>
|
<li className={pathname==="issues" ? "active" : ""}>
|
||||||
<Tooltip title="复刻是fork的中文名,即复制代码仓库" placement="bottom">
|
<Tooltip title="易修是Issue的中文名,即问题列表" placement="bottom">
|
||||||
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
<Link to={{ pathname: `/projects/${owner}/${projectsId}/issues`, state }}>
|
||||||
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
<i className={pathname==="issues" ? "iconfont icon-renwu color-grey-3 mr5 font-14":"iconfont icon-renwu color-grey-6 font-14 mr5"}></i>
|
||||||
<span title="易修是Issue的中文名,即问题列表">易修</span>
|
<span>易修</span>
|
||||||
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
{projectDetail && projectDetail.issues_count ? <span className="num">{projectDetail.issues_count}</span> : ""}
|
||||||
</Link>
|
</Link>
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
|
|
|
@ -13,6 +13,7 @@ const sort = [
|
||||||
"按引用排序"
|
"按引用排序"
|
||||||
]
|
]
|
||||||
const limit = 15;
|
const limit = 15;
|
||||||
|
const https = 'http://117.50.100.12:8001';
|
||||||
function Index(props){
|
function Index(props){
|
||||||
const [ sortValue , setSortValue ] = useState(1);
|
const [ sortValue , setSortValue ] = useState(1);
|
||||||
const [ page , setPage ] = useState(1);
|
const [ page , setPage ] = useState(1);
|
||||||
|
@ -20,20 +21,20 @@ function Index(props){
|
||||||
const [ search , setSearch ] = useState(undefined);
|
const [ search , setSearch ] = useState(undefined);
|
||||||
|
|
||||||
const [ visible , setVisible ] = useState(false);
|
const [ visible , setVisible ] = useState(false);
|
||||||
const projectsId = props.match.params.projectsId;
|
const repo_id = props.projectDetail && props.projectDetail.repo_id;
|
||||||
const owner = props.match.params.owner;
|
const owner = props.match.params.owner;
|
||||||
|
|
||||||
useEffect(()=>{
|
useEffect(()=>{
|
||||||
if(owner && projectsId){
|
if(owner && repo_id){
|
||||||
getData();
|
getData();
|
||||||
}
|
}
|
||||||
},[projectsId,owner,search,sort,page])
|
},[repo_id,owner,search,sort,page])
|
||||||
|
|
||||||
function getData(){
|
function getData(){
|
||||||
const url = `http://117.50.100.12:8001/api/project/achievement/`;
|
const url = https +`/api/project/achievement/`;
|
||||||
axios.get(url,{
|
axios.get(url,{
|
||||||
params:{
|
params:{
|
||||||
projectId:projectsId,
|
projectId:repo_id,
|
||||||
curPage:page,
|
curPage:page,
|
||||||
pageSize:limit,
|
pageSize:limit,
|
||||||
name:search,
|
name:search,
|
||||||
|
|
|
@ -17,21 +17,6 @@ const paramRequestOldUrlArray = [
|
||||||
|
|
||||||
]
|
]
|
||||||
const paramRequestNewUrlArray = [
|
const paramRequestNewUrlArray = [
|
||||||
// 获取代码内容
|
|
||||||
// (matchResult) => {
|
|
||||||
// const stageId = matchResult[1]
|
|
||||||
// return `/tasks/${stageId}/rep_content.json`
|
|
||||||
// },
|
|
||||||
|
|
||||||
// 获取版本库目录、文件
|
|
||||||
// http://testeduplus2.educoder.net/tasks/se79x25pzfwo/git_entries.json?path=&dev=master&gpid=3441
|
|
||||||
// (matchResult) => {
|
|
||||||
// const stageId = matchResult[1]
|
|
||||||
// // return `/tasks/${stageId}/git_entries.json`
|
|
||||||
// return `/myshixuns/${stageId}/repository.json`
|
|
||||||
// },
|
|
||||||
|
|
||||||
// `/tasks/tonblikwzj78/choose_build.json`
|
|
||||||
(matchResult) => {
|
(matchResult) => {
|
||||||
const stageId = matchResult[1]
|
const stageId = matchResult[1]
|
||||||
return `/tasks/${stageId}/choose_build.json`
|
return `/tasks/${stageId}/choose_build.json`
|
||||||
|
@ -65,20 +50,4 @@ export function requestProxy(config) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
('/api/v1/careers/qweqw/edit/').match(/\/api\/v1\/careers\/(\w*)\/edit/i)
|
|
||||||
0: "/api/v1/careers/qweqw/edit"
|
|
||||||
1: "qweqw"
|
|
||||||
|
|
||||||
example:
|
|
||||||
`/api/v1/games/${this.props.game.identifier}/answer_grade` ->
|
|
||||||
`/tasks/${this.props.game.identifier}/answer_grade.json`
|
|
||||||
|
|
||||||
|
|
||||||
https://testeduplus2.educoder.net/api/v1/games/feguz4tiqpvx/rep_content
|
|
||||||
?path=src/step2/CLnkQueue.cpp&shixun_gpid=2791&status=0&retry=0 ->
|
|
||||||
http://testeduplus2.educoder.net/tasks/tonblikwzj78/rep_content.json
|
|
||||||
?path=1-4.py&shixun_gpid=2448&status=0
|
|
||||||
*/
|
|
|
@ -302,12 +302,9 @@ class LoginDialog extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
isRender: nextProps.isRender
|
isRender: nextProps.isRender
|
||||||
})
|
})
|
||||||
// console.log(nextProps.isRender);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
IsPC = () => {
|
IsPC = () => {
|
||||||
var userAgentInfo = navigator.userAgent;
|
var userAgentInfo = navigator.userAgent;
|
||||||
|
@ -324,8 +321,8 @@ class LoginDialog extends Component {
|
||||||
return flag;
|
return flag;
|
||||||
}
|
}
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
|
//true为PC端,false为手机端
|
||||||
let flag = this.IsPC(); //true为PC端,false为手机端
|
let flag = this.IsPC();
|
||||||
this.setState({
|
this.setState({
|
||||||
isphone: flag
|
isphone: flag
|
||||||
})
|
})
|
||||||
|
@ -357,7 +354,6 @@ class LoginDialog extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
loginEDU = () => {
|
loginEDU = () => {
|
||||||
|
|
||||||
let { loginValue, passValue, regular, isGoingValue } = this.state;
|
let { loginValue, passValue, regular, isGoingValue } = this.state;
|
||||||
if (regular === 1) {
|
if (regular === 1) {
|
||||||
return
|
return
|
||||||
|
@ -379,15 +375,8 @@ class LoginDialog extends Component {
|
||||||
if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") {
|
if (response.data.message === "登录密码出错已达上限,账号已被锁定, 请10分钟后重新登录或找回密码") {
|
||||||
const messge = (
|
const messge = (
|
||||||
<div>
|
<div>
|
||||||
<p>
|
<p>登录密码出错已达上限,账号已被锁定;</p>
|
||||||
登录密码出错已达上限,账号已被锁定;
|
<p className="mt10">请10分钟后重新登录或<a href={'https://www.trustie.net/account/lost_password'} style={{textDecoration: "underline",color: "#4CACFF"}}>找回密码</a></p>
|
||||||
</p>
|
|
||||||
<p className="mt10">
|
|
||||||
请10分钟后重新登录或<a href={'https://www.trustie.net/account/lost_password'} style={{
|
|
||||||
textDecoration: "underline",
|
|
||||||
color: "#4CACFF",
|
|
||||||
}}>找回密码</a>
|
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
this.openNotifications(messge);
|
this.openNotifications(messge);
|
||||||
|
@ -466,10 +455,9 @@ class LoginDialog extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let { login, isGoing, isGoingValue, disabled, Phonenumberisnotco,
|
let { login, isGoing, isGoingValue, disabled , Phonenumberisnotco , dialogBox, isRender, weixinlogin } = this.state;
|
||||||
dialogBox, isRender, weixinlogin } = this.state;
|
|
||||||
|
|
||||||
let { settings } = this.props;
|
let { settings } = this.props;
|
||||||
|
|
||||||
if (isRender === undefined) {
|
if (isRender === undefined) {
|
||||||
isRender = false
|
isRender = false
|
||||||
}
|
}
|
||||||
|
@ -532,9 +520,10 @@ class LoginDialog extends Component {
|
||||||
|
|
||||||
<div style={{ height: '25px' }}><p className="color-orange edu-txt-left none" id="username_error_notice"
|
<div style={{ height: '25px' }}><p className="color-orange edu-txt-left none" id="username_error_notice"
|
||||||
style={{ display: Phonenumberisnotco === undefined ? 'none' : 'block' }}>{Phonenumberisnotco}</p></div>
|
style={{ display: Phonenumberisnotco === undefined ? 'none' : 'block' }}>{Phonenumberisnotco}</p></div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<input type="password" id="password_loggin_input"
|
<input
|
||||||
|
type="password"
|
||||||
|
id="password_loggin_input"
|
||||||
name="password"
|
name="password"
|
||||||
ref="passwordText"
|
ref="passwordText"
|
||||||
onInput={this.passwordChange}
|
onInput={this.passwordChange}
|
||||||
|
@ -544,8 +533,8 @@ class LoginDialog extends Component {
|
||||||
this.loginEDU : () => {
|
this.loginEDU : () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
placeholder="密码" >
|
placeholder="密码"
|
||||||
</input>
|
/>
|
||||||
<div style={{ height: '25px' }}>
|
<div style={{ height: '25px' }}>
|
||||||
<p className="color-orange edu-txt-left none" id="password_error_notice">
|
<p className="color-orange edu-txt-left none" id="password_error_notice">
|
||||||
请输入密码
|
请输入密码
|
||||||
|
@ -594,17 +583,7 @@ class LoginDialog extends Component {
|
||||||
:""
|
:""
|
||||||
}
|
}
|
||||||
</form>
|
</form>
|
||||||
{/* {weixinlogin === true ? <iframe
|
|
||||||
className={"weixinheight390"}
|
|
||||||
frameBorder="0"
|
|
||||||
sandbox="allow-scripts allow-same-origin allow-top-navigation"
|
|
||||||
scrolling="no"
|
|
||||||
src={`https://open.weixin.qq.com/connect/qrconnect?appid=wx6b119e2d829c13fa&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&response_type=code&scope=snsapi_login&state=null,${window.location.host}#wechat_redirect`}></iframe> : ""}
|
|
||||||
{weixinlogin === true ? <p className="clearfix ">
|
|
||||||
<a className={"startlogin color-blue"} onClick={() => this.hideweixinlogin()}>返回账号登录</a>
|
|
||||||
</p> : ""} */}
|
|
||||||
</div>
|
</div>
|
||||||
{/*快捷登录*/}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
: ""}
|
: ""}
|
||||||
|
|
Loading…
Reference in New Issue