From 04d20727ea7ce95e0a05a75568208f53060247e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 4 Nov 2019 14:14:46 +0800 Subject: [PATCH 01/16] =?UTF-8?q?qq=E7=99=BB=E5=BD=95start?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/login/LoginDialog.css | 8 +- public/react/src/modules/login/LoginDialog.js | 135 +++--------------- .../src/modules/login/Otherloginstart.js | 1 - 3 files changed, 28 insertions(+), 116 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.css b/public/react/src/modules/login/LoginDialog.css index 9a9373770..37e2f48b6 100644 --- a/public/react/src/modules/login/LoginDialog.css +++ b/public/react/src/modules/login/LoginDialog.css @@ -136,12 +136,18 @@ .startlogin{ color:#888; } + .weixinheight390{ height: 390px; } + +.qqheight390{ + width: 450px; + height: 390px; +} #log_reg_content { padding: 38px 30px 20px !important; } .textcenter{ text-align: center; -} \ No newline at end of file +} diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 6bd6ac41f..6763f0f91 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -7,7 +7,7 @@ import Dialog, { DialogContentText, DialogTitle, } from 'material-ui/Dialog'; -import {notification } from 'antd'; +import {notification,Modal } from 'antd'; import axios from 'axios'; @@ -104,8 +104,8 @@ class LoginDialog extends Component { MyEduCoderModals:false, Phonenumberisnotco:undefined, Phonenumberisnotcobool:false, - weixinlogin:false - + weixinlogin:false, + qqlogin:false }; } enter=(num) =>{ @@ -529,14 +529,23 @@ class LoginDialog extends Component { weixinlogin:true }) } + openqqlogin=()=>{ + this.setState({ + qqlogin:true + }) + window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code` + + // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` + } hideweixinlogin=()=>{ this.setState({ - weixinlogin:false + weixinlogin:false, + qqlogin:false }) } render() { - let{open,login,speedy,loginValue,regular,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, - dialogBox,shortcutnum,disabledType,gaincode,authCodeType,authCodeclass, isRender,weixinlogin}=this.state; + let{qqlogin,login,isGoing,isGoingValue,disabled,bottonclass,Phonenumberisnotco, + dialogBox, isRender,weixinlogin}=this.state; if (isRender === undefined) { isRender = false @@ -659,6 +668,9 @@ class LoginDialog extends Component { this.openweixinlogin()}> 微信登录 + {/*this.openqqlogin()} className={"ml10"}>*/} + {/*qq登录*/} + {/**/}

:""} @@ -669,7 +681,9 @@ class LoginDialog extends Component { 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%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login#wechat_redirect`}>:""} - {weixinlogin===true?

+ + + {weixinlogin===true?

this.hideweixinlogin()}>返回账号登录

:""} @@ -690,110 +704,3 @@ class LoginDialog extends Component { export default LoginDialog ; - -// onkeypress="user_login_keypress(event);" - -// onkeypress="user_login_keypress(event);" - - -{/*
-
-
-

-
-
} - - - -{/*第三方账号登录*/} - -{/*
-

第三方账号登录

-
- - - -
-
} - -// -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/**/} -// {/**/} -// {/*
*/} -// {/**/} -// {/**/} -// {/**/} -// {/*
*/} -// {/*

请输入有效的手机号/邮箱号*/} -// {/*

*/} -// {/*
*/} -// -// {/*
*/} -// {/*/!*drag*/ }*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*请按住滑块,拖动到最右边*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*
*/} -// {/*

请先拖动滑块完成验证

*/} -// {/*
*/} -// {/*
*/} -// -// {/*

*/} -// {/**/} -// {/**/} -// {/**/} -// {/*

*/} -// -// {/*
*/} -// {/*

*/} -// {/*请输入验证码*/} -// {/*

*/} -// {/*
*/} -// -// {/**/} -// -// {/*

*/} -// -// {/**/} -// {/**/} -// {/**/} -// {/**/} -// -// {/**/} -// {/*忘记密码*/} -// {/*注册*/} -// {/**/} -// -// {/*

*/} -// {/**/} -// {/*
*/} diff --git a/public/react/src/modules/login/Otherloginstart.js b/public/react/src/modules/login/Otherloginstart.js index fc5d46bbc..97e06f9da 100644 --- a/public/react/src/modules/login/Otherloginstart.js +++ b/public/react/src/modules/login/Otherloginstart.js @@ -10,7 +10,6 @@ class Otherloginstart extends Component { let query=this.props.location.search; const type = query.split('?code='); const types = type[1].split('&state='); - console.log(types) let codeurl = `/auth/wechat/callback.json` axios.get(codeurl,{params:{ code:types[0] From 3815b70c7935764a007b8648850a388d100fffef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 4 Nov 2019 15:27:38 +0800 Subject: [PATCH 02/16] =?UTF-8?q?qq=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 6763f0f91..46bdea005 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -533,7 +533,7 @@ class LoginDialog extends Component { this.setState({ qqlogin:true }) - window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginstart&response_type=code` + window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` } @@ -668,9 +668,9 @@ class LoginDialog extends Component { this.openweixinlogin()}> 微信登录 - {/*this.openqqlogin()} className={"ml10"}>*/} - {/*qq登录*/} - {/**/} + this.openqqlogin()} className={"ml10"}> + qq登录 +

:""} From 194b9677ba1e9f386e7e34282ccaa85505c31215 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 4 Nov 2019 17:29:48 +0800 Subject: [PATCH 03/16] =?UTF-8?q?qq=E7=99=BB=E5=BD=95=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/App.js | 8 ++- public/react/src/AppConfig.js | 39 +++++++----- public/react/src/modules/login/LoginDialog.js | 4 +- public/react/src/modules/login/Otherlogin.js | 6 +- .../react/src/modules/login/Otherloginqq.js | 60 +++++++++++++++++++ .../src/modules/login/Otherloginstart.js | 42 +++++++------ 6 files changed, 120 insertions(+), 39 deletions(-) create mode 100644 public/react/src/modules/login/Otherloginqq.js diff --git a/public/react/src/App.js b/public/react/src/App.js index e4cd6a732..84b5c0ae4 100644 --- a/public/react/src/App.js +++ b/public/react/src/App.js @@ -75,7 +75,10 @@ const Otherloginstart=Loadable({ loader: () => import('./modules/login/Otherloginstart'), loading: Loading, }) - +const Otherloginsqq=Loadable({ + loader: () => import('./modules/login/Otherloginqq'), + loading: Loading, +}) // const TestIndex = Loadable({ // loader: () => import('./modules/test'), // loading: Loading, @@ -527,6 +530,9 @@ class App extends Component { + diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index ece36b61c..7bdecd966 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() @@ -73,15 +73,22 @@ export function initAxiosInterceptors(props) { } requestProxy(config) - var url = `/api${config.url}`; + let url = `/api${config.url}`; + + //qq登录去掉api + if(config.params&&config.params.redirect_uri!=undefined){ + if(config.params.redirect_uri.indexOf('otherloginqq')!=-1){ + url = `${config.url}`; + } + } if(`${config[0]}`!=`true`){ if (window.location.port === "3007") { - if (url.indexOf('.json') == -1) { - - alert('开发提示:请给接口加.json:' + url) - - } + // if (url.indexOf('.json') == -1) { + // + // alert('开发提示:请给接口加.json:' + url) + // + // } config.url = `${proxy}${url}`; if (config.url.indexOf('?') == -1) { config.url = `${config.url}?debug=${debugType}`; diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 46bdea005..574f46356 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -533,8 +533,8 @@ class LoginDialog extends Component { this.setState({ qqlogin:true }) - window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` - + //window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2otherloginqq&response_type=code` + window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` } hideweixinlogin=()=>{ diff --git a/public/react/src/modules/login/Otherlogin.js b/public/react/src/modules/login/Otherlogin.js index 73f0c6dc6..59710ab2f 100644 --- a/public/react/src/modules/login/Otherlogin.js +++ b/public/react/src/modules/login/Otherlogin.js @@ -132,6 +132,8 @@ class Otherlogin extends Component { } postwechatlogin=(type,username,password)=>{ + let query=this.props.location.search; + const types = query.split('?type='); if(type===false){ if(username===undefined||username===""||username===null){ this.setState({ @@ -146,9 +148,11 @@ class Otherlogin extends Component { return } } + + let url = "/bind_user.json"; axios.post(url, { - type: 'wechat', + type: types[1]==="qq"?"qq":'wechat', not_bind:type, username:username, password:password diff --git a/public/react/src/modules/login/Otherloginqq.js b/public/react/src/modules/login/Otherloginqq.js new file mode 100644 index 000000000..ae614b474 --- /dev/null +++ b/public/react/src/modules/login/Otherloginqq.js @@ -0,0 +1,60 @@ +import React, { Component } from 'react'; + +import { BrowserRouter as Router, Route, Link } from "react-router-dom"; + +import { Spin } from 'antd'; +import axios from 'axios'; +class Otherloginqq extends Component { + + componentDidMount() { + let query=this.props.location.search; + + if(query!= ""){ + + } + const type = query.split('?code='); + let codeurl = `/auth/qq/callback`; + axios.get(codeurl,{params:{ + code:type[1], + redirect_uri:`https://test-newweb.educoder.net/otherloginqq` + }}).then((result)=> { + if(result){ + if(result.data.status===0){ + if(result.data.new_user===true){ + window.location.href="/otherlogin?type=qq" + }else{ + // this.getinfo() + if(types[1]==="account"){ + window.location.href="/account/binding" + }else{ + window.location.href="/" + } + + } + } + } + }).catch((error)=>{ + + }) + } + + render() { + // Loading + return ( +
+ + +
+ ); + } +} + +export default Otherloginqq; \ No newline at end of file diff --git a/public/react/src/modules/login/Otherloginstart.js b/public/react/src/modules/login/Otherloginstart.js index 97e06f9da..9901fc8ad 100644 --- a/public/react/src/modules/login/Otherloginstart.js +++ b/public/react/src/modules/login/Otherloginstart.js @@ -8,30 +8,34 @@ class Otherloginstart extends Component { componentDidMount() { let query=this.props.location.search; - const type = query.split('?code='); - const types = type[1].split('&state='); - let codeurl = `/auth/wechat/callback.json` - axios.get(codeurl,{params:{ - code:types[0] - }}).then((result)=> { - if(result){ - if(result.data.status===0){ - if(result.data.new_user===true){ - window.location.href="/otherlogin" - }else{ - // this.getinfo() - if(types[1]==="account"){ - window.location.href="/account/binding" + debugger + if(query!= ""){ + const type = query.split('?code='); + const types = type[1].split('&state='); + let codeurl = `/auth/wechat/callback.json` + axios.get(codeurl,{params:{ + code:types[0] + }}).then((result)=> { + if(result){ + if(result.data.status===0){ + if(result.data.new_user===true){ + window.location.href="/otherlogin?type=wechat" }else{ - window.location.href="/" - } + // this.getinfo() + if(types[1]==="account"){ + window.location.href="/account/binding" + }else{ + window.location.href="/" + } + } } } - } - }).catch((error)=>{ + }).catch((error)=>{ + + }) + } - }) } From 6df0ab0c2c8b799292453b7e31f6b69603f1f269 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Mon, 4 Nov 2019 20:58:40 +0800 Subject: [PATCH 04/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 20 +++---- .../modules/user/account/AccountBinding.js | 58 +++++++++++++++++++ 2 files changed, 68 insertions(+), 10 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 7bdecd966..8440db911 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -// if (isDev) { -// const _search = window.location.search; -// let parsed = {}; -// if (_search) { -// parsed = queryString.parse(_search); -// } -// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : -// window.location.search.indexOf('debug=s') != -1 ? 'student' : -// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -// } +if (isDev) { + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +} window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index b36095fcb..68a642a96 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -146,6 +146,7 @@ class AccountSecure extends Component { } `}
绑定登录账号
+
@@ -203,6 +204,63 @@ class AccountSecure extends Component {
+ + {/*
*/} + {/*
*/} + {/*
*/} + + {/*
*/} + {/*
*/} + {/*
*/} + {/**/} + {/*QQ*/} + {/*
*/} + + {/*
*/} + {/*{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}}*/} + {/*
*/} + + {/*
*/} + {/* this.showModal("wechat"):() => this.undologin("wechat",basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].id)*/} + {/*}*/} + {/*>{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?"绑定":"解绑"}*/} + {/*
*/} + + {/*
*/} + {/*
*/} + {/**/} + {/**/} + {/*
*/} + {/**/} + {/*

*/} + {/*this.handleCancel()}>取消*/} + {/*

*/} + {/*
*/} + {/**/} + + + {/*
*/}
* 我们确保你所提供的信息均处于严格保密状态,不会泄露
From d4e163621bb682e0214c4108867d0e941692195a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 09:07:56 +0800 Subject: [PATCH 05/16] =?UTF-8?q?qq=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 20 +++++++++---------- public/react/src/modules/login/LoginDialog.js | 18 ++++++++++++++++- 2 files changed, 27 insertions(+), 11 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 8440db911..7bdecd966 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -21,16 +21,16 @@ let hashTimeout // TODO 开发期多个身份切换 let debugType ="" -if (isDev) { - const _search = window.location.search; - let parsed = {}; - if (_search) { - parsed = queryString.parse(_search); - } - debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : - window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' -} +// if (isDev) { +// const _search = window.location.search; +// let parsed = {}; +// if (_search) { +// parsed = queryString.parse(_search); +// } +// debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : +// window.location.search.indexOf('debug=s') != -1 ? 'student' : +// window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || 'admin' +// } window._debugType = debugType; export function initAxiosInterceptors(props) { initOnlineOfflineListener() diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 574f46356..9ea73908a 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -537,6 +537,11 @@ class LoginDialog extends Component { window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` // window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2fwww.educoder.net%2fotherloginstart&tp=qq&response_type=code` } + + openphoneqqlogin=()=>{ + window.location.href=`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` + } + hideweixinlogin=()=>{ this.setState({ weixinlogin:false, @@ -672,7 +677,18 @@ class LoginDialog extends Component { qq登录 -

:""} +

:

+ + ———————— 快速登录 ———————— +

+ {/*this.openweixinlogin()}>*/} + {/*微信登录*/} + {/**/} + this.openphoneqqlogin()} className={"ml10"}> + qq登录 + +
+

} } {weixinlogin===true?*/} - {/*

*/} - {/*this.handleCancel()}>取消*/} - {/*

*/} - {/**/} - {/**/} - - - {/**/} +
+
+
+ +
+
+
+ + QQ +
+ +
+ {basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}} +
+ +
+ this.showModal("wechat"):() => this.undologin("wechat",basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].id) + } + >{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?"绑定":"解绑"} +
+ +
+
+ + + + + + +
* 我们确保你所提供的信息均处于严格保密状态,不会泄露
From d29ce33ca5e10a8e066e773822c914641d784878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 12:59:36 +0800 Subject: [PATCH 07/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunHomework/ShixunHomeworkPage.js | 382 ++++++++---------- 1 file changed, 159 insertions(+), 223 deletions(-) diff --git a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js index d0392fb74..1df901d97 100644 --- a/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js +++ b/public/react/src/modules/courses/shixunHomework/ShixunHomeworkPage.js @@ -4,8 +4,7 @@ import {WordsBtn, ActionBtn} from 'educoder'; import axios from 'axios'; import { notification, - Spin, - Tabs + Spin } from "antd"; import '../css/members.css'; import "../common/formCommon.css"; @@ -23,9 +22,6 @@ import Startshixuntask from "../coursesPublic/Startshixuntask"; import TPMMDEditor from "../../tpm/challengesnew/TPMMDEditor"; import DownloadMessageysl from "../../modals/DownloadMessageysl"; import Modals from "../../modals/Modals"; - -const { TabPane } = Tabs; - class ShixunHomeworkPage extends Component { constructor(props) { super(props); @@ -121,12 +117,12 @@ class ShixunHomeworkPage extends Component { /// 重做的确认 ModalSaves=()=>{ - this.setState({ - ModalsType:false, - Modalstopval:"" - }); + this.setState({ + ModalsType:false, + Modalstopval:"" + }); if(this.state.teacherdatapage){ - this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier); + this.resetshixunCombat(this.state.teacherdatapage.myshixun_identifier); } try { console.log("this.child"); @@ -153,29 +149,29 @@ class ShixunHomeworkPage extends Component { } //重置按钮 resetshixunCombat=(id)=>{ - this.setState({ - mylistisSpin:true, + this.setState({ + mylistisSpin:true, + }) + let zrl=`/myshixuns/${id}/reset_my_game.json`; + axios.get(zrl).then((response) => { + // window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; + this.setState({ + mylistisSpin:false, + }) + this.child.Isupdatass(); + this.props.showNotification("已清空本实训的学习记录\n" + + "\n" + + "请点击“开启挑战”重做实训作业"); + }).catch((error) => { + this.setState({ + mylistisSpin:false, }) - let zrl=`/myshixuns/${id}/reset_my_game.json`; - axios.get(zrl).then((response) => { - // window.location.href = "/shixuns/" + response.data.shixun_identifier + "/challenges"; - this.setState({ - mylistisSpin:false, - }) - this.child.Isupdatass(); - this.props.showNotification("已清空本实训的学习记录\n" + - "\n" + - "请点击“开启挑战”重做实训作业"); - }).catch((error) => { - this.setState({ - mylistisSpin:false, - }) - console.log(error) - }); + console.log(error) + }); } bindRef = ref => { this.child = ref } ///////////////教师截止 - //编辑作业 + //编辑作业 Showupdateinstructionsboolfalse (bool) { this.setState({ Showupdateinstructions:bool @@ -187,105 +183,19 @@ class ShixunHomeworkPage extends Component { Showupdateinstructions:true }) } - gotohome=()=>{ + gotohome=()=>{ // console.log(this.props) let {jobsettingsdatapage}=this.state this.props.history.replace(`/courses/${this.props.match.params.coursesId}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.main === 1 ? "shixun_homeworks" :"shixun_homework"}/${jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.category.category_id === undefined ? "" : jobsettingsdatapage.data.category.category_id}`); } - - - callback=(key)=>{ - this.setState({ - tab: key, - }) - } - render() { let {tab, teacherdatapage, jobsettingsdatapage} = this.state; const isAdmin = this.props.isAdmin(); // console.log(119) - // console.log(jobsettingsdatapage); + // console.log(jobsettingsdatapage); document.title=jobsettingsdatapage === undefined ? "" : jobsettingsdatapage.data.course_name; - - const operations =
- {/**/} - {this.props.isAdmin() ? -
  • - 导出 - -
  • : ""} - {this.props.isAdmin() ? - teacherdatapage && teacherdatapage.end_immediately === true ? - this.homeworkendss(this.child)}>立即截止 - : "" - : ""} - {this.props.isAdmin() ? - teacherdatapage && teacherdatapage.publish_immediately === true ? - this.homeworkstarts(this.child)}>立即发布 - : "" - : ""} - {this.props.isAdmin() ? - teacherdatapage && teacherdatapage.code_review === true ? - this.workshowmodels(this.child)}>代码查重 - : "" : ""} - { - parseInt(tab)===1? - this.props.isAdmin() ? - this.edenwork()}>编辑作业 - :"" - :"" - } - - - {this.state.view_report === true ? - 查看实训报告 - : ""} - { - teacherdatapage === undefined ? "" - : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" : - {teacherdatapage.commit_des} - } - {teacherdatapage === undefined ? "" : } - {this.props.isStudent() ? - ( - teacherdatapage&&teacherdatapage.redo_work===true? - this.Modalcancelss()}>重做 - :"" - ) - : "" } -
    ; return (
    } -
    -

    - {teacherdatapage === undefined ? "" : teacherdatapage.homework_name} -

    - - this.gotohome()}>返回 - 实训详情 -
    - - - {/*
    */} - {/*
    */} - {/*/!*
    *!/*/} - {/*/!**!/*/} - {/*/!* this.ChangeTab(0)}>作品列表*!/*/} - {/*/!* this.ChangeTab(1)}>作业描述*!/*/} - {/*/!*{this.props.isAdmin() ?*!/*/} - {/*/!*this.state.code_review === true || jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" :*!/*/} - {/*/!* this.ChangeTab(2)}>*!/*/} - {/*/!*代码查重 : ""}*!/*/} - {/*/!*{parseInt(tab) === 3?*!/*/} - {/*/!**!/*/} - {/*/!*:""}*!/*/} - - {/*/!* this.ChangeTab(3)}*!/*/} - {/*>{this.props.isAdmin()?"设置":"得分规则"}*/} - {/*/!*{this.props.isAdmin() ? 导出 : ""}*!/*/} - {/**/} - - {/**/} - {/**/} - {/*
    */} - {/*
    */} - {/*
    */} - - - - - this.Getdataback(jobsettingsdata, teacherdata)}> - - - this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}> - - - this.Getdataback(jobsettingsdata, teacherdata)}> - - - this.Getdataback(jobsettingsdata, teacherdata)}> - - - - +
    +

    + {teacherdatapage === undefined ? "" : teacherdatapage.homework_name} +

    + + this.gotohome()}>返回 + 实训详情 + + +
    +
    +
    +
    + this.ChangeTab(0)}>作品列表 + this.ChangeTab(1)}>作业描述 + {this.props.isAdmin() ? + this.state.code_review === true || jobsettingsdatapage === undefined ? [""] : jobsettingsdatapage.data.homework_status[0] === "未发布" ? "" : + this.ChangeTab(2)}> + 代码查重 : ""} + {parseInt(tab) === 3? + + :""} + + this.ChangeTab(3)} + >{this.props.isAdmin()?"设置":"得分规则"} + {/*{this.props.isAdmin() ? 导出 : ""}*/} + + {this.props.isAdmin() ? +
  • + 导出 + +
  • : ""} + {this.props.isAdmin() ? + teacherdatapage && teacherdatapage.end_immediately === true ? + this.homeworkendss(this.child)}>立即截止 + : "" + : ""} + {this.props.isAdmin() ? + teacherdatapage && teacherdatapage.publish_immediately === true ? + this.homeworkstarts(this.child)}>立即发布 + : "" + : ""} + {this.props.isAdmin() ? + teacherdatapage && teacherdatapage.code_review === true ? + this.workshowmodels(this.child)}>代码查重 + : "" : ""} + { + parseInt(tab)===1? + this.props.isAdmin() ? + this.edenwork()}>编辑作业 + :"" + :"" + } + + + {this.state.view_report === true ? + 查看实训报告 + : ""} + { + teacherdatapage === undefined ? "" + : teacherdatapage.commit_des === null || teacherdatapage.commit_des === undefined ? "" : + {teacherdatapage.commit_des} + } + {teacherdatapage === undefined ? "" : } + {this.props.isStudent() ? + ( + teacherdatapage&&teacherdatapage.redo_work===true? + this.Modalcancelss()}>重做 + :"" + ) + : "" } +
    +
    +
    + + {parseInt(tab) === 0 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} + {parseInt(tab) === 1 ? this.Getdataback(jobsettingsdata, teacherdata)} Showupdateinstructionsboolfalse={(i)=>this.Showupdateinstructionsboolfalse(i)}>:""} + {parseInt(tab) === 2 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} + {parseInt(tab) === 3 ? this.Getdataback(jobsettingsdata, teacherdata)}>:""} +
    ) From 4031798e88248d810784b222680b4b750a219831 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 5 Nov 2019 13:42:50 +0800 Subject: [PATCH 08/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Competitioncommon/CompetitionCommon.js | 18 +++--- .../courses/exercise/new/SingleEditor.js | 59 ++++++++++--------- 2 files changed, 39 insertions(+), 38 deletions(-) diff --git a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js index bde5895e1..8d3726e1a 100755 --- a/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js +++ b/public/react/src/modules/competitions/Competitioncommon/CompetitionCommon.js @@ -43,7 +43,7 @@ class CompetitionCommon extends Component{ // }) // } // }).catch((error) => { - // console.log(error) + // //console.log(error) // }) } } @@ -51,8 +51,8 @@ class CompetitionCommon extends Component{ componentDidUpdate = (prevProps) => { if (prevProps.user != this.props.user) { - console.log("componentDidUpdatess"); - console.log(this.props.user); + //console.log("componentDidUpdatess"); + //console.log(this.props.user); if (this.props.user && this.props.user.login != "") { const zul = `/competitions/${this.props.match.params.identifier}/competition_staff.json`; axios.get((zul)).then((result) => { @@ -64,7 +64,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - //console.log(error); + ////console.log(error); }) } } @@ -103,7 +103,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - console.log(error) + //console.log(error) }) //this.props.user 有可能为空 @@ -119,7 +119,7 @@ class CompetitionCommon extends Component{ } } }).catch((error) => { - //console.log(error); + ////console.log(error); }) } @@ -161,7 +161,7 @@ class CompetitionCommon extends Component{ } }).catch((error) => { - console.log(error) + //console.log(error) }) } } @@ -192,7 +192,7 @@ class CompetitionCommon extends Component{ } }).catch((error) => { - console.log(error) + //console.log(error) }) }else{ if (module_url.substring(0, 7) == 'http://' || module_url.substring(0, 8) == 'https://') { @@ -309,7 +309,7 @@ class CompetitionCommon extends Component{ }) } }).catch((error) => { - console.log(error) + //console.log(error) }) } diff --git a/public/react/src/modules/courses/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index 1e2005360..f3c917c75 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -16,8 +16,8 @@ const $ = window.$ const { Option } = Select; const tagArray = [ - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] class SingleEditor extends Component{ @@ -92,13 +92,13 @@ class SingleEditor extends Component{ } - + const intScore = parseFloat(question_score) if (intScore == 0) { this.props.showNotification('分值:必须大于0'); return; } else if(!question_score || intScore == NaN) { this.props.showNotification('分值:不能为空'); return; - } + } if(!answerArray || answerArray.length == 0) { this.props.showNotification('请先点击选择本选择题的正确选项'); return; } @@ -119,9 +119,9 @@ class SingleEditor extends Component{ "question_type":1, "question_score":5, "question_choices":["a答案","b答案","c答案","d答案"], - "standard_answers":[1] + "standard_answers":[1] }*/ - const Id = this.props.match.params.Id + const Id = this.props.match.params.Id if (question_id) { const editUrl = this.props.getEditQuestionUrl(question_id); axios.put(editUrl, { @@ -144,7 +144,7 @@ class SingleEditor extends Component{ }); } else { const url = this.props.getAddQuestionUrl(); - + axios.post(url, { exercise_bank_id: Id, question_title, @@ -162,16 +162,16 @@ class SingleEditor extends Component{ .catch(function (error) { console.log(error); }); - } + } } onCancel = () => { this.props.onEditorCancel() } - + componentDidMount = () => { - + } onOptionClick = (index) => { // if (this.props.exerciseIsPublish) { @@ -186,7 +186,7 @@ class SingleEditor extends Component{ // TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3 return; } - let question_choices = this.state.question_choices.slice(0); + let question_choices = this.state.question_choices.slice(0); question_choices[index] = value; this.setState({ question_choices }) } @@ -200,19 +200,19 @@ class SingleEditor extends Component{ mdReactObject.toShowMode() } this.mdReactObject = that; - + } toShowMode = () => { - + } render() { let { question_title, question_score, question_type, question_choices, standard_answers } = this.state; let { question_id, index, exerciseIsPublish, - // question_title, - // question_type, + // question_title, + // question_type, // question_score, isNew } = this.props; - + // const { getFieldDecorator } = this.props.form; const isAdmin = this.props.isAdmin() @@ -221,8 +221,8 @@ class SingleEditor extends Component{ const qNumber = `question_${index}`; // TODO show模式 isNew为false isEdit为false - // [true, false, true] -> [0, 2] - + // [true, false, true] -> [0, 2] + const answerTagArray = standard_answers.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1); return(
    @@ -253,8 +253,8 @@ class SingleEditor extends Component{ ref="titleEditor" > - - {question_choices.map( (item, index) => { + + {question_choices.map( (item, index) => { const bg = standard_answers[index] ? 'check-option-bg' : '' return
    {/* 点击设置答案 */} @@ -268,7 +268,7 @@ class SingleEditor extends Component{ {/* */}
    - {/* {!exerciseIsPublish && 新增选项} */} - - {!exerciseIsPublish ? '温馨提示:点击选项标题,可以直接设置答案;选择多个答案即为多选题' : ' '} + + {!exerciseIsPublish ? '温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题' : ' '} { answerTagArray && !!answerTagArray.length ? {answerTagArray.join(' ')} 标准答案: - : - 请点击正确选项 + : + 温馨提示:点击选项输入框可设置答案;选中的选项即为正确答案,选择多个答案即为多选题 }
    @@ -310,18 +311,18 @@ class SingleEditor extends Component{  分 - + 取消 保存 - +
    - +
    ) } } // RouteHOC() -export default (SingleEditor); \ No newline at end of file +export default (SingleEditor); From 5784a10f1dbd84468a1e8c31186a1ba8d85e91cf Mon Sep 17 00:00:00 2001 From: hjm <63528605@qq.com> Date: Tue, 5 Nov 2019 13:51:40 +0800 Subject: [PATCH 09/16] =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/page/component/monaco/TPIMonaco.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/react/src/modules/page/component/monaco/TPIMonaco.js b/public/react/src/modules/page/component/monaco/TPIMonaco.js index b814ecb44..59cb5ce35 100644 --- a/public/react/src/modules/page/component/monaco/TPIMonaco.js +++ b/public/react/src/modules/page/component/monaco/TPIMonaco.js @@ -226,6 +226,7 @@ class TPIMonaco extends Component { // https://github.com/Microsoft/monaco-editor/issues/539 window.monaco.editor.setModelLanguage(editor_monaco.getModel(), lang) } else if (prevProps.isEditablePath != this.props.isEditablePath) { + // 当前文件是否可编辑 if (this.props.isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission == true) { editor_monaco.updateOptions({readOnly: false}) } else { @@ -250,6 +251,7 @@ class TPIMonaco extends Component { } } componentWillUnmount() { + // 注意销毁,不然会出现不能编辑的bug this.editor_monaco && this.editor_monaco.dispose() } From f220ad378e7271d0ae5e1614d708ba3b2aa71381 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 14:15:07 +0800 Subject: [PATCH 10/16] =?UTF-8?q?=E8=B0=83=E6=95=B4qq=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/login/Otherloginqq.js | 4 +- .../modules/user/account/AccountBinding.js | 200 ++++++++---------- 2 files changed, 91 insertions(+), 113 deletions(-) diff --git a/public/react/src/modules/login/Otherloginqq.js b/public/react/src/modules/login/Otherloginqq.js index ae614b474..e8e3b73d6 100644 --- a/public/react/src/modules/login/Otherloginqq.js +++ b/public/react/src/modules/login/Otherloginqq.js @@ -9,10 +9,8 @@ class Otherloginqq extends Component { componentDidMount() { let query=this.props.location.search; - if(query!= ""){ - - } const type = query.split('?code='); + const types = type[1].split('&state='); let codeurl = `/auth/qq/callback`; axios.get(codeurl,{params:{ code:type[1], diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index 324aadd93..62c946040 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -12,10 +12,29 @@ class AccountSecure extends Component { super(props) this.state = { Modalstype:false, + isphone:false } } - - + IsPC=()=>{ + var userAgentInfo = navigator.userAgent; + var Agents = ["Android", "iPhone", + "SymbianOS", "Windows Phone", + "iPad", "iPod"]; + var flag = true; + for (var v = 0; v < Agents.length; v++) { + if (userAgentInfo.indexOf(Agents[v]) > 0) { + flag = false; + break; + } + } + return flag; + } + componentDidMount() { + let flag = this.IsPC(); //true为PC端,false为手机端 + this.setState({ + isphone: flag + }) + } showModal=()=>{ this.setState({ visible: true, @@ -64,7 +83,13 @@ class AccountSecure extends Component { ModalSave:()=>this.Saveundologin(id), }) } + openqqlogin=()=>{ + window.location.href=`https://graph.qq.com/oauth2.0/show?which=Login&display=pc&client_id=101508858&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code` + } + openphoneqqlogin=()=>{ + window.location.href=`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code` + } render() { let {basicInfo}=this.props; @@ -152,120 +177,75 @@ class AccountSecure extends Component {
    绑定登录账号
    -
    -
    -
    - -
    -
    -
    - - 微信 -
    - -
    - {basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}} -
    + {/* + en_type: "qq" + id: 60 + nickname: "Sum" + */} + {basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"": + + basicInfo&&basicInfo.open_users.map((item,key)=>{ + + return( +
    +
    +
    +
    + {item.en_type!="qq"?:} + {item.en_type!="qq"?微信:QQ} +
    + +
    + {item.nickname} +
    + +
    + {item.en_type!="qq"? this.showModal("wechat"):() => this.undologin("wechat",item.id) + } + >{item.id===null?"绑定":"解绑"}: this.openphoneqqlogin():this.openqqlogin():() => this.undologin("qq",item.id) + } + >{item.id===null?"绑定":"解绑"}} +
    +
    +
    +
    + ) + }) + } -
    - this.showModal("wechat"):() => this.undologin("wechat",basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].id) - } - >{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?"绑定":"解绑"} -
    - -
    -
    - - - - - - -
    - -
    -
    -
    - -
    -
    -
    - - QQ -
    - -
    - {basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}} -
    - -
    - this.showModal("wechat"):() => this.undologin("wechat",basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].id) - } - >{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?"绑定":"解绑"} -
    - -
    -
    - - - - - - + } + + + - +
    * 我们确保你所提供的信息均处于严格保密状态,不会泄露
    From e562749e32f8ba63e99f33de0c7e133db3548dab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 14:17:55 +0800 Subject: [PATCH 11/16] =?UTF-8?q?=E8=B0=83=E6=95=B4qq=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/Otherloginqq.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/react/src/modules/login/Otherloginqq.js b/public/react/src/modules/login/Otherloginqq.js index e8e3b73d6..30407bf3c 100644 --- a/public/react/src/modules/login/Otherloginqq.js +++ b/public/react/src/modules/login/Otherloginqq.js @@ -14,7 +14,7 @@ class Otherloginqq extends Component { let codeurl = `/auth/qq/callback`; axios.get(codeurl,{params:{ code:type[1], - redirect_uri:`https://test-newweb.educoder.net/otherloginqq` + redirect_uri:`https://${window.location.host}/otherloginqq` }}).then((result)=> { if(result){ if(result.data.status===0){ From 129c8180ce772203b977b17d98e9e8f054fb8036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 14:50:08 +0800 Subject: [PATCH 12/16] =?UTF-8?q?=E8=B0=83=E6=95=B4qq=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 2 +- .../modules/user/LoginRegisterComponent.js | 2 +- .../modules/user/account/AccountBinding.js | 45 ++++++++++++++----- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 68a01d383..04cfa2e25 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -539,7 +539,7 @@ class LoginDialog extends Component { } openphoneqqlogin=()=>{ - window.location.href=`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code` + window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) } hideweixinlogin=()=>{ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index 3e5731c69..a41c15cc0 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -908,7 +908,7 @@ class LoginRegisterComponent extends Component { } openphoneqqlogin=()=>{ - window.location.href=`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code` + window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) } render() { const { diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index 62c946040..a1ad75d28 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -12,7 +12,17 @@ class AccountSecure extends Component { super(props) this.state = { Modalstype:false, - isphone:false + isphone:false, + list:[{ + en_type: "qq", + id: null, + nickname: "", + }, + { + en_type: "wechat", + id: null, + nickname: "", + }] } } IsPC=()=>{ @@ -31,9 +41,30 @@ class AccountSecure extends Component { } componentDidMount() { let flag = this.IsPC(); //true为PC端,false为手机端 + let {basicInfo}=this.props; + let {list}=this.state; this.setState({ isphone: flag }) + let newlist=list; + + if(basicInfo===undefined||JSON.stringify(basicInfo) == "{}"||basicInfo&&basicInfo.open_users.length===0){ + + }else{ + basicInfo&&basicInfo.open_users.map((item,key)=>{ + newlist.map((items,keys)=>{ + if(item.en_type===items.en_type){ + items.id=item.id; + items.nickname=item.nickname; + } + }) + }) + } + + this.setState({ + list:newlist + }) + } showModal=()=>{ this.setState({ @@ -88,11 +119,11 @@ class AccountSecure extends Component { } openphoneqqlogin=()=>{ - window.location.href=`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code` + window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) } render() { let {basicInfo}=this.props; - + let {list}=this.state; return (
    @@ -177,14 +208,8 @@ class AccountSecure extends Component {
    绑定登录账号
    - {/* - en_type: "qq" - id: 60 - nickname: "Sum" - */} - {basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"": - basicInfo&&basicInfo.open_users.map((item,key)=>{ + {list.map((item,key)=>{ return(
    From e796cd688214d38b94f50391b698e0aa03db4329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 14:51:41 +0800 Subject: [PATCH 13/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/user/account/AccountBinding.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index a1ad75d28..eb62aa1e1 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -14,15 +14,15 @@ class AccountSecure extends Component { Modalstype:false, isphone:false, list:[{ + en_type: "wechat", + id: null, + nickname: "", + },{ en_type: "qq", id: null, nickname: "", - }, - { - en_type: "wechat", - id: null, - nickname: "", - }] + } + ] } } IsPC=()=>{ @@ -231,7 +231,7 @@ class AccountSecure extends Component { } >{item.id===null?"绑定":"解绑"}: this.openphoneqqlogin():this.openqqlogin():() => this.undologin("qq",item.id) + item.id===null?this.state.isphone===true?() => this.openphoneqqlogin():() => this.openqqlogin():() => this.undologin("qq",item.id) } >{item.id===null?"绑定":"解绑"}}
    From 0c77bf300c5cb5c246aeed2a7e7f88af804dd3db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 15:03:52 +0800 Subject: [PATCH 14/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/modules/login/LoginDialog.js | 4 +++- public/react/src/modules/user/LoginRegisterComponent.js | 4 +++- public/react/src/modules/user/account/AccountBinding.js | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/public/react/src/modules/login/LoginDialog.js b/public/react/src/modules/login/LoginDialog.js index 04cfa2e25..940e70c9a 100644 --- a/public/react/src/modules/login/LoginDialog.js +++ b/public/react/src/modules/login/LoginDialog.js @@ -539,7 +539,9 @@ class LoginDialog extends Component { } openphoneqqlogin=()=>{ - window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) + window.open( + `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` + ) } hideweixinlogin=()=>{ diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js index a41c15cc0..55a42b62d 100644 --- a/public/react/src/modules/user/LoginRegisterComponent.js +++ b/public/react/src/modules/user/LoginRegisterComponent.js @@ -908,7 +908,9 @@ class LoginRegisterComponent extends Component { } openphoneqqlogin=()=>{ - window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) + window.open( + `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` + ) } render() { const { diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index eb62aa1e1..f5bf834d3 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -119,7 +119,9 @@ class AccountSecure extends Component { } openphoneqqlogin=()=>{ - window.open(`https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2f${window.location.host}%2fotherloginqq&response_type=code`) + window.open( + `https://xui.ptlogin2.qq.com/cgi-bin/xlogin?appid=716027609&pt_3rd_aid=101508858&daid=383&pt_skey_valid=0&style=35&s_url=http%3A%2F%2Fconnect.qq.com&refer_cgi=authorize&which=&client_id=101508858&response_type=code&scope=get_user_info&redirect_uri=https%3a%2f%2ftest-newweb.educoder.net%2fotherloginqq&response_type=code` + ) } render() { let {basicInfo}=this.props; From 10dc5db970204d5624e326f104d6159a23d9a71d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Tue, 5 Nov 2019 15:09:24 +0800 Subject: [PATCH 15/16] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../react/src/modules/user/account/AccountBinding.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/public/react/src/modules/user/account/AccountBinding.js b/public/react/src/modules/user/account/AccountBinding.js index f5bf834d3..98ebc6a66 100644 --- a/public/react/src/modules/user/account/AccountBinding.js +++ b/public/react/src/modules/user/account/AccountBinding.js @@ -12,7 +12,6 @@ class AccountSecure extends Component { super(props) this.state = { Modalstype:false, - isphone:false, list:[{ en_type: "wechat", id: null, @@ -40,14 +39,9 @@ class AccountSecure extends Component { return flag; } componentDidMount() { - let flag = this.IsPC(); //true为PC端,false为手机端 let {basicInfo}=this.props; let {list}=this.state; - this.setState({ - isphone: flag - }) let newlist=list; - if(basicInfo===undefined||JSON.stringify(basicInfo) == "{}"||basicInfo&&basicInfo.open_users.length===0){ }else{ @@ -124,7 +118,7 @@ class AccountSecure extends Component { ) } render() { - let {basicInfo}=this.props; + let flag = this.IsPC(); //true为PC端,false为手机端 let {list}=this.state; return (
    @@ -233,7 +227,7 @@ class AccountSecure extends Component { } >{item.id===null?"绑定":"解绑"}: this.openphoneqqlogin():() => this.openqqlogin():() => this.undologin("qq",item.id) + item.id===null?flag===true?() => this.openphoneqqlogin():() => this.openqqlogin():() => this.undologin("qq",item.id) } >{item.id===null?"绑定":"解绑"}}
    From 0972872cfea85df2fa588d1aab0cf0a9c6e983f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com> Date: Tue, 5 Nov 2019 15:20:20 +0800 Subject: [PATCH 16/16] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=AF=95=E5=8D=B7?= =?UTF-8?q?=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../courses/exercise/new/SingleEditor.js | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/public/react/src/modules/courses/exercise/new/SingleEditor.js b/public/react/src/modules/courses/exercise/new/SingleEditor.js index f3c917c75..624315817 100644 --- a/public/react/src/modules/courses/exercise/new/SingleEditor.js +++ b/public/react/src/modules/courses/exercise/new/SingleEditor.js @@ -224,6 +224,10 @@ class SingleEditor extends Component{ // [true, false, true] -> [0, 2] const answerTagArray = standard_answers.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1); + console.log("xuanzheshijuan"); + console.log(answerTagArray); + console.log(!exerciseIsPublish); + return(