Commit d7fb4e61 authored by wangjj's avatar wangjj

cookie path 限制

parent 906e9bc4
...@@ -32,7 +32,7 @@ if($mod == 'credit'){ ...@@ -32,7 +32,7 @@ if($mod == 'credit'){
$creditRule = Credit::addCreditLog($userId, $creditRuleId); $creditRule = Credit::addCreditLog($userId, $creditRuleId);
if ($creditRule) { if ($creditRule) {
$creditInfo = array('title'=>$creditRule['operation_name'],'desc'=>$creditRule['operation_details'],'number'=>$creditRule['number']); $creditInfo = array('title'=>$creditRule['operation_name'],'desc'=>$creditRule['operation_details'],'number'=>$creditRule['number']);
esetcookie('creditNotice',json_encode($creditInfo)); setcookie('creditNotice',json_encode($creditInfo),0,'/');
echo json_encode(['status'=>true,'message'=>'ok','creditRule'=>$creditRule]); echo json_encode(['status'=>true,'message'=>'ok','creditRule'=>$creditRule]);
} else { } else {
echo json_encode(['status'=>false]); echo json_encode(['status'=>false]);
......
...@@ -186,12 +186,12 @@ function setCookie(cname, cvalue) { ...@@ -186,12 +186,12 @@ function setCookie(cname, cvalue) {
function cookieTips() { function cookieTips() {
var obj = getCookie('udvqbcreditNotice'); var obj = getCookie('creditNotice');
if(obj){ if(obj){
obj = JSON.parse(obj); obj = JSON.parse(obj);
var desc = '分享成功金币 +'+ obj.number; var desc = '分享成功金币 +'+ obj.number;
Banshou.creditTip(obj.title,desc,2000); Banshou.creditTip(obj.title,desc,2000);
setCookie('udvqbcreditNotice',''); setCookie('creditNotice','');
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment