实现敏感词检测后,失败发生邮箱
This commit is contained in:
46
schoolNewsWeb/src/apis/resource/sensitive.ts
Normal file
46
schoolNewsWeb/src/apis/resource/sensitive.ts
Normal file
@@ -0,0 +1,46 @@
|
||||
import { api } from '@/apis';
|
||||
import type { ResultDomain, SensitiveWord, PageParam } from '@/types';
|
||||
|
||||
export const sensitiveApi = {
|
||||
/**
|
||||
* 获取敏感词列表
|
||||
* @returns Promise<ResultDomain<SensitiveWord>>
|
||||
*/
|
||||
async getSensitivePage(pageParam: PageParam, filter?: SensitiveWord): Promise<ResultDomain<SensitiveWord>> {
|
||||
const response = await api.post<SensitiveWord>('/sensitive/page', {
|
||||
pageParam,
|
||||
filter,
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加敏感词
|
||||
* @param sensitiveWord 敏感词信息
|
||||
* @returns Promise<ResultDomain<SensitiveWord>>
|
||||
*/
|
||||
async addSensitiveWord(sensitiveWord: SensitiveWord): Promise<ResultDomain<SensitiveWord>> {
|
||||
const response = await api.post<SensitiveWord>('/sensitive', sensitiveWord);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改敏感词类型
|
||||
* @param sensitiveWord 敏感词对象
|
||||
* @returns Promise<ResultDomain<boolean>>
|
||||
*/
|
||||
async changeSensitiveWordType(sensitiveWord: SensitiveWord): Promise<ResultDomain<boolean>> {
|
||||
const response = await api.put<boolean>(`/sensitive`, sensitiveWord);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除敏感词
|
||||
* @param sensitiveWord 敏感词对象
|
||||
* @returns Promise<ResultDomain<boolean>>
|
||||
*/
|
||||
async deleteSensitiveWord(sensitiveWord: SensitiveWord): Promise<ResultDomain<boolean>> {
|
||||
const response = await api.delete<boolean>(`/sensitive`, { data: sensitiveWord });
|
||||
return response.data;
|
||||
},
|
||||
}
|
||||
Reference in New Issue
Block a user