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 {