service('deleteBlogService',//删除博客
['$rootScope',
'$http',
'$q',
function ($rootScope, $http, $q) {
var result = {};
result.operate = function (blogId) {
var deferred = $q.defer();
$http({
headers: {
'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
},
url: $rootScope.$baseUrl + "/admin/blog/deleteBlogById",
method: 'GET',
dataType: 'json',
params: {
id: blogId
}
})
.success(function (data) {
deferred.resolve(data);
console.log("删除成功!");
})
.error(function () {
deferred.reject();
alert("删除失败!")
});
return deferred.promise;
};
return result;
}])
/**
* 删除博客
*/
$scope.deleteBlog = function (blogId) {
var deletePromise = deleteBlogService.operate(blogId);
deletePromise.then(function (data) {
if (data.status == 200) {
var promise = getBlogListService.operate($scope.currentPage);
promise.then(function (data) {
$scope.blogs = data.blogs;
$scope.pageCount = $scope.blogs.totalPages;
});
}
});
};
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有