调整学生资源权限

issues25489
杨树明 5 years ago
parent 10dc5db970
commit 961aeae749

@ -421,7 +421,7 @@ class Selectresource extends Component{
<Radio style={radioStyle} value={0}>
立即发布
</Radio>
<Radio style={radioStyle} value={1} className={"fl"}>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延迟发布</span>
<DatePicker
dropdownClassName="hideDisable"

@ -529,7 +529,7 @@ class Selectsetting extends Component{
<Radio style={radioStyle} value={0}>
立即发布
</Radio>
<Radio style={radioStyle} value={1} className={"fl"}>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延迟发布</span>
<DatePicker

@ -263,6 +263,8 @@ class Sendresource extends Component{
height: '30px',
lineHeight: '30px',
};
return(
<div>
{/*提示*/}
@ -396,7 +398,7 @@ class Sendresource extends Component{
<Radio style={radioStyle} value={0}>
立即发布
</Radio>
<Radio style={radioStyle} value={1} className={"fl"}>
<Radio style={radioStyle} value={1} className={"fl"} disabled={this.props.isStudent()}>
<span className={"mr5"}>延迟发布</span>
<DatePicker

@ -1224,7 +1224,7 @@ submittojoinclass=(value)=>{
}
{
this.props.Headertop && this.props.Headertop.laboratory_user &&
<li><a href="/cooperative">后台管理</a></li>
<li><a href="/admins">后台管理</a></li>
}
<li><a href={`/account/profile`}>账号管理</a></li>

@ -38,6 +38,7 @@ class AccountSecure extends Component {
}
return flag;
}
componentDidMount() {
let {basicInfo}=this.props;
let {list}=this.state;
@ -47,7 +48,7 @@ class AccountSecure extends Component {
}else{
basicInfo&&basicInfo.open_users.map((item,key)=>{
newlist.map((items,keys)=>{
if(item.en_type===items.en_type){
if(items.en_type===item.en_type){
items.id=item.id;
items.nickname=item.nickname;
}
@ -60,6 +61,30 @@ class AccountSecure extends Component {
})
}
componentDidUpdate=(prevProps)=>{
if(prevProps!=this.props){
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(items.en_type===item.en_type){
items.id=item.id;
items.nickname=item.nickname;
}
})
})
}
this.setState({
list:newlist
})
}
}
showModal=()=>{
this.setState({
visible: true,
@ -86,11 +111,21 @@ class AccountSecure extends Component {
})
}
Saveundologin=(id)=>{
Saveundologin=(type,id)=>{
let {basicInfo}=this.props;
let {list}=this.state;
let newlist=list;
let url=`/users/accounts/${basicInfo.id}/open_users/${id}.json`;
axios.delete(url).then((result)=>{
if(result.data.status===0){
newlist.map((item,key)=>{
if(item.en_type===type){
item.id=null
}
})
this.setState({
list:newlist
})
this.props.showNotification('解绑成功');
this.Cancelundologins()
this.props.getBasicInfo()
@ -105,7 +140,7 @@ class AccountSecure extends Component {
Modalstype:true,
Modalstopval:type==="wechat"?"是否确定解绑微信账号?":"是否确定解绑QQ账号",
ModalCancel:this.Cancelundologins,
ModalSave:()=>this.Saveundologin(id),
ModalSave:()=>this.Saveundologin(type,id),
})
}
openqqlogin=()=>{
@ -120,6 +155,7 @@ class AccountSecure extends Component {
render() {
let flag = this.IsPC(); //true为PC端false为手机端
let {list}=this.state;
console.log(window.location.host)
return (
<div>
<div className="basicForm settingForm">
@ -217,7 +253,7 @@ class AccountSecure extends Component {
</div>
<div className="description lineheight60">
<span className={"color-grey-9 ml80"}>{item.nickname}</span>
<span className={"color-grey-9 ml80"}>{item.id===null?"":item.nickname}</span>
</div>
<div className="status pt19">
@ -227,7 +263,7 @@ class AccountSecure extends Component {
}
>{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?flag===true?() => this.openqqlogin():() => this.openphoneqqlogin():() => this.undologin("qq",item.id)
}
>{item.id===null?"绑定":"解绑"}</WordsBtn>}
</div>

Loading…
Cancel
Save