我似乎无法使用 Angularjs 删除 cookie。有什么问题..她是代码..
$scope.adminLogout = function(){
$http({
url: '/AdServerLongTail/adminapi/logout',
method: "POST",
dataType:"json",
}).success(function (data, status, headers, config) {
console.log("success");
delete $cookies["username"];
delete $cookies["JSESSIONID"];
$rootScope.welcome=null;
$location.path("/admin");
}).error(function (data, status, headers, config) {
console.log("error");
});
}
html
<li><a href="#" ng-click="adminLogout()">LOGOUT</a></li>