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 ?"绑定":"解绑"} -
- -
-
- - -
- -

- 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 ?"绑定":"解绑"} -
- -
-
- - -
- -

- this.handleCancel()}>取消 -

-
-
- - + } + + +
+ +

+ this.handleCancel()}>取消 +

- +
* 我们确保你所提供的信息均处于严格保密状态,不会泄露