更新
This commit is contained in:
@@ -39,7 +39,11 @@ public class SensitiveWordInitializer implements CommandLineRunner{
|
|||||||
denySet.add(item.getWord());
|
denySet.add(item.getWord());
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
redisService.sAdd(SensitiveRedisContants.SENSITIVE_WORD_ALLOW, allowSet);
|
if (!allowSet.isEmpty()) {
|
||||||
redisService.sAdd(SensitiveRedisContants.SENSITIVE_WORD_DENY, denySet);
|
redisService.sAdd(SensitiveRedisContants.SENSITIVE_WORD_ALLOW, allowSet.toArray());
|
||||||
|
}
|
||||||
|
if (!denySet.isEmpty()) {
|
||||||
|
redisService.sAdd(SensitiveRedisContants.SENSITIVE_WORD_DENY, denySet.toArray());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ public class CourseController {
|
|||||||
/**
|
/**
|
||||||
* 删除课程
|
* 删除课程
|
||||||
*/
|
*/
|
||||||
@DeleteMapping("/course")
|
@DeleteMapping("/{courseID}")
|
||||||
public ResultDomain<Boolean> deleteCourse(@PathVariable("courseID") String courseID) {
|
public ResultDomain<Boolean> deleteCourse(@PathVariable("courseID") String courseID) {
|
||||||
return courseService.deleteCourse(courseID);
|
return courseService.deleteCourse(courseID);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
{{ getActionButtonText(row.status) }}
|
{{ getActionButtonText(row.status) }}
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button size="small" @click="editArticle(row)">编辑</el-button>
|
<el-button size="small" @click="editArticle(row)">编辑</el-button>
|
||||||
<el-button size="small" type="danger" @click="deleteArticle()">删除</el-button>
|
<el-button size="small" type="danger" @click="deleteArticle(row)">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
@@ -77,7 +77,7 @@ defineOptions({
|
|||||||
name: 'ArticleManagementView'
|
name: 'ArticleManagementView'
|
||||||
});
|
});
|
||||||
import { ref, onMounted } from 'vue';
|
import { ref, onMounted } from 'vue';
|
||||||
import { ElButton, ElInput, ElTable, ElTableColumn, ElTag, ElPagination, ElMessage } from 'element-plus';
|
import { ElButton, ElInput, ElTable, ElTableColumn, ElTag, ElPagination, ElMessage, ElMessageBox } from 'element-plus';
|
||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { resourceApi, resourceTagApi } from '@/apis/resource'
|
import { resourceApi, resourceTagApi } from '@/apis/resource'
|
||||||
import type { PageParam, ResourceSearchParams, Resource, Tag } from '@/types';
|
import type { PageParam, ResourceSearchParams, Resource, Tag } from '@/types';
|
||||||
@@ -200,9 +200,30 @@ function handleEditFromView() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function deleteArticle() {
|
async function deleteArticle(row: Resource) {
|
||||||
// TODO: 删除文章
|
try {
|
||||||
ElMessage.info('删除功能开发中');
|
await ElMessageBox.confirm(
|
||||||
|
`确定要删除文章「${row.title}」吗?`,
|
||||||
|
'删除确认',
|
||||||
|
{
|
||||||
|
confirmButtonText: '确定',
|
||||||
|
cancelButtonText: '取消',
|
||||||
|
type: 'warning'
|
||||||
|
}
|
||||||
|
);
|
||||||
|
const res = await resourceApi.deleteResource(row.resourceID!);
|
||||||
|
if (res.success) {
|
||||||
|
ElMessage.success('删除成功');
|
||||||
|
loadArticles();
|
||||||
|
} else {
|
||||||
|
ElMessage.error(res.message || '删除失败');
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
if (error !== 'cancel') {
|
||||||
|
console.error('删除失败:', error);
|
||||||
|
ElMessage.error('删除失败');
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getStatusType(status: number) {
|
function getStatusType(status: number) {
|
||||||
|
|||||||
Reference in New Issue
Block a user