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] =?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 {