用户退出操作js代码

原创 2018-11-29 04:49:36 259
摘要:// 退出登录 function logout(){ // 退出前确认 layer.confirm('确定要退出吗?',{ icon:3, btn:['确定','取消'] },function(){ $.get('/index.php/admins/account/logout',function(res){

// 退出登录

function logout(){

// 退出前确认

layer.confirm('确定要退出吗?',{

icon:3,

btn:['确定','取消']

},function(){

$.get('/index.php/admins/account/logout',function(res){

if(res.code>0){

layer.msg(res.msg,{'icon':2});

}else{

layer.msg(res.msg,{'icon':1});

setTimeout(function(){window.location.href='/index.php/admins/account/login';},1000);

}

},'json');

});

}


发布手记

热门词条