forked from Gitlink/forgeplus-react
定制竞赛关注按钮bug
This commit is contained in:
parent
1c97c59adc
commit
d50fdb602c
|
@ -25,7 +25,7 @@ if (isDev) {
|
|||
}
|
||||
debugType = window.location.search.indexOf('debug=t') !== -1 ? 'teacher' :
|
||||
window.location.search.indexOf('debug=s') !== -1 ? 'student' :
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || 'admin'
|
||||
window.location.search.indexOf('debug=a') !== -1 ? 'a' : parsed.debug || ''
|
||||
}
|
||||
window._debugType = debugType;
|
||||
export function initAxiosInterceptors(props) {
|
||||
|
|
|
@ -165,27 +165,35 @@ const Competition = (props) => {
|
|||
|
||||
// 关注和取消关注
|
||||
function follow1(){
|
||||
follow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
if(current_user && current_user.login){
|
||||
follow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
}else{
|
||||
props.showLoginDialog();
|
||||
}
|
||||
}
|
||||
|
||||
function unfollow(){
|
||||
unFollow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('取消关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
if(current_user && current_user.login){
|
||||
unFollow({
|
||||
id: competitionId,
|
||||
target_type: 'competition_info'
|
||||
}).then(res=>{
|
||||
if(res && res.status === 200){
|
||||
message.success('取消关注成功');
|
||||
setReloadDetail(Math.random());
|
||||
}
|
||||
})
|
||||
}else{
|
||||
props.showLoginDialog();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const is_local = qzDetail && qzDetail.is_local;
|
||||
|
|
Loading…
Reference in New Issue