forked from Gitlink/forgeplus-react
cookie设置path
This commit is contained in:
parent
7b74564ecc
commit
2c867f9856
|
@ -12,26 +12,15 @@ function SystemNotice({system_notification,history}){
|
|||
if(system_notification && !cookie.load('notice_stage')){
|
||||
setVisible(true);
|
||||
}
|
||||
},[system_notification])
|
||||
},[system_notification,history.location])
|
||||
|
||||
function sureContinue() {
|
||||
// if(login && ( system_notification && system_notification.id )){
|
||||
// const url = `/users/${login}/system_notification_histories.json`;
|
||||
// axios.post(url,{
|
||||
// system_notification_id:system_notification.id
|
||||
// }).then(result=>{
|
||||
// if(result && result.status === 0){
|
||||
// setVisible(false);
|
||||
// hideSystemNotice();
|
||||
// }
|
||||
// }).catch(error=>{})
|
||||
// }
|
||||
console.log("cookies before:",cookie.load('notice_stage')) ;
|
||||
cookie.remove('notice_stage');
|
||||
let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
|
||||
// let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟
|
||||
cookie.save('notice_stage', true,{ expires: inFifteenMinutes });
|
||||
console.log("cookies after:",cookie.load('notice_stage')) ;
|
||||
|
||||
// let inFifteenMinutes = new Date(new Date().getTime() + 24 * 3600 * 1000);//一天
|
||||
let inFifteenMinutes = new Date(new Date().getTime() + 60 * 1000);//一分钟
|
||||
cookie.save('notice_stage', true,{ expires: inFifteenMinutes,path:"/" });
|
||||
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue