更新代码

This commit is contained in:
2025-05-19 17:34:40 +08:00
parent 1587524031
commit 7bd072add9
32 changed files with 1465 additions and 139 deletions
@@ -322,7 +322,7 @@
// 初始化分类列表
that.initCategoryList = function () {
$.ajax({
url: '/admin/articles/articlecate',
url: '/admin/article/articlecate',
type: 'POST',
success: function (res) {
if (res.code === 0) {
@@ -387,7 +387,7 @@
// 加载分类信息
that.loadCategoryInfo = function (id) {
$.get('/admin/articles/cateedit?id=' + id, function (res) {
$.get('/admin/article/cateedit?id=' + id, function (res) {
if (res.code === 0) {
that.showCategoryForm(0, res.data);
}
@@ -413,7 +413,7 @@
$select.empty().append('<option value="0">顶级分类</option>');
// 获取所有分类作为父级选项
$.ajax({
url: '/admin/articles/articlecate',
url: '/admin/article/articlecate',
type: 'POST',
async: false,
success: function (res) {
@@ -472,7 +472,7 @@
// 监听表单提交
form.on('submit(saveCategory)', function (data) {
var url = data.field.id ? '/admin/articles/cateedit' : '/admin/articles/cateadd';
var url = data.field.id ? '/admin/article/cateedit' : '/admin/article/cateadd';
$.post(url, data.field, function (res) {
if (res.code === 0) {
layer.msg(res.msg, { icon: 1 });
@@ -490,7 +490,7 @@
if (!id) return;
layer.confirm('确定要删除该分类吗?', function (index) {
$.post('/admin/articles/catedel', { id: id }, function (res) {
$.post('/admin/article/catedel', { id: id }, function (res) {
if (res.code === 0) {
layer.msg(res.msg, { icon: 1 });
that.initCategoryList();
@@ -87,7 +87,7 @@
// 初始化表格
table.render({
elem: '#articleTable',
url: '/admin/articles/articlelist',
url: '/admin/article/articlelist',
method: 'post',
cols: [[
{ field: 'id', title: 'ID', align: 'center', width: 80 },
@@ -174,18 +174,18 @@
}
function add() {
window.location.href = '/admin/articles/add';
window.location.href = '/admin/article/add';
}
function edit(id) {
window.location.href = '/admin/articles/edit?id=' + id;
window.location.href = '/admin/article/edit?id=' + id;
}
function del(id) {
layer.confirm('确定要删除该文章吗?', {
btn: ['确定', '取消']
}, function () {
$.post('/admin/articles/delete', { id: id }, function (res) {
$.post('/admin/article/delete', { id: id }, function (res) {
if (res.code == 0) {
layer.msg(res.msg, { icon: 1 });
setTimeout(function () {