|
|
|
@ -12,10 +12,54 @@ class AccountSecure extends Component {
|
|
|
|
|
super(props)
|
|
|
|
|
this.state = {
|
|
|
|
|
Modalstype:false,
|
|
|
|
|
list:[{
|
|
|
|
|
en_type: "wechat",
|
|
|
|
|
id: null,
|
|
|
|
|
nickname: "",
|
|
|
|
|
},{
|
|
|
|
|
en_type: "qq",
|
|
|
|
|
id: null,
|
|
|
|
|
nickname: "",
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
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 {basicInfo}=this.props;
|
|
|
|
|
let {list}=this.state;
|
|
|
|
|
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({
|
|
|
|
|
visible: true,
|
|
|
|
@ -64,10 +108,18 @@ 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.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;
|
|
|
|
|
|
|
|
|
|
let flag = this.IsPC(); //true为PC端,false为手机端
|
|
|
|
|
let {list}=this.state;
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<div className="basicForm settingForm">
|
|
|
|
@ -152,120 +204,69 @@ class AccountSecure extends Component {
|
|
|
|
|
<div className="title">绑定登录账号</div>
|
|
|
|
|
|
|
|
|
|
<Form>
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
<div className="flexRow">
|
|
|
|
|
<div className="name">
|
|
|
|
|
<i className={"iconfont icon-weixin2 weixinlogo mr10"}></i>
|
|
|
|
|
<span className={"color-ooo"}>微信</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="description lineheight60">
|
|
|
|
|
{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":<span className={"color-grey-9 ml80"}>{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}</span>}
|
|
|
|
|
</div>
|
|
|
|
|
{list.map((item,key)=>{
|
|
|
|
|
|
|
|
|
|
return(
|
|
|
|
|
<div className="flexTable" key={key}>
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
<div className="flexRow">
|
|
|
|
|
<div className="name">
|
|
|
|
|
{item.en_type!="qq"?<i className={"iconfont icon-weixin2 weixinlogo mr10"}></i>:<i className={"iconfont icon-qq qqlogo mr10"}></i>}
|
|
|
|
|
{item.en_type!="qq"?<span className={"color-ooo"}>微信</span>:<span className={"color-ooo"}>QQ</span>}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="description lineheight60">
|
|
|
|
|
<span className={"color-grey-9 ml80"}>{item.nickname}</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="status pt19">
|
|
|
|
|
{item.en_type!="qq"?<WordsBtn style={ item.id===null?"blue":"colorgrey9"} className={item.id===null?"borderBottom":""}
|
|
|
|
|
onClick={
|
|
|
|
|
item.id===null?() => this.showModal("wechat"):() => this.undologin("wechat",item.id)
|
|
|
|
|
}
|
|
|
|
|
>{item.id===null?"绑定":"解绑"}</WordsBtn>:<WordsBtn style={ item.id===null?"blue":"colorgrey9"} className={item.id===null?"borderBottom":""}
|
|
|
|
|
onClick={
|
|
|
|
|
item.id===null?flag===true?() => this.openphoneqqlogin():() => this.openqqlogin():() => this.undologin("qq",item.id)
|
|
|
|
|
}
|
|
|
|
|
>{item.id===null?"绑定":"解绑"}</WordsBtn>}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<div className="status pt19">
|
|
|
|
|
<WordsBtn style={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"blue":"colorgrey9"} className={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"borderBottom":""}
|
|
|
|
|
onClick={
|
|
|
|
|
basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?() => 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 ?"绑定":"解绑"}</WordsBtn>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ml70{
|
|
|
|
|
margin-left: 70px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Modal
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
|
visible={this.state.visible}
|
|
|
|
|
onOk={this.handleOk}
|
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<iframe
|
|
|
|
|
className={"weixinheight390 ml70"}
|
|
|
|
|
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%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login&state=account#wechat_redirect`}></iframe>
|
|
|
|
|
<p className="clearfix pagemancenter">
|
|
|
|
|
<a className={"startlogin color-blue"} onClick={()=>this.handleCancel()}>取消</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="flexTable">
|
|
|
|
|
<div className="flexRow">
|
|
|
|
|
<div className="name">
|
|
|
|
|
<i className={"iconfont icon-qq qqlogo mr10"}></i>
|
|
|
|
|
<span className={"color-ooo"}>QQ</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="description lineheight60">
|
|
|
|
|
{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"":<span className={"color-grey-9 ml80"}>{basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users[0].nickname}</span>}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div className="status pt19">
|
|
|
|
|
<WordsBtn style={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"blue":"colorgrey9"} className={basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0?"borderBottom":""}
|
|
|
|
|
onClick={
|
|
|
|
|
basicInfo===undefined||JSON.stringify(basicInfo) == "{}"?"":basicInfo&&basicInfo.open_users.length===0 ?() => 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 ?"绑定":"解绑"}</WordsBtn>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
</Form>
|
|
|
|
|
<style>
|
|
|
|
|
{
|
|
|
|
|
`
|
|
|
|
|
.ml70{
|
|
|
|
|
margin-left: 70px;
|
|
|
|
|
}
|
|
|
|
|
`
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Modal
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
|
visible={this.state.visible}
|
|
|
|
|
onOk={this.handleOk}
|
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<iframe
|
|
|
|
|
className={"weixinheight390 ml70"}
|
|
|
|
|
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%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login&state=account#wechat_redirect`}></iframe>
|
|
|
|
|
<p className="clearfix pagemancenter">
|
|
|
|
|
<a className={"startlogin color-blue"} onClick={()=>this.handleCancel()}>取消</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Modal>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
</style>
|
|
|
|
|
<Modal
|
|
|
|
|
closable={false}
|
|
|
|
|
footer={null}
|
|
|
|
|
visible={this.state.visible}
|
|
|
|
|
onOk={this.handleOk}
|
|
|
|
|
onCancel={this.handleCancel}
|
|
|
|
|
>
|
|
|
|
|
<div>
|
|
|
|
|
<iframe
|
|
|
|
|
className={"weixinheight390 ml70"}
|
|
|
|
|
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%2f${window.location.host}%2fotherloginstart&response_type=code&scope=snsapi_login&state=account#wechat_redirect`}></iframe>
|
|
|
|
|
<p className="clearfix pagemancenter">
|
|
|
|
|
<a className={"startlogin color-blue"} onClick={()=>this.handleCancel()}>取消</a>
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</Form>
|
|
|
|
|
</Modal>
|
|
|
|
|
</div>
|
|
|
|
|
<div style={{color: '#989898', marginLeft: '20px'}}>* 我们确保你所提供的信息均处于严格保密状态,不会泄露</div>
|
|
|
|
|
</div>
|
|
|
|
|