perf: plugin response

This commit is contained in:
archer 2023-08-23 15:00:54 +08:00
parent a5f8fae3f2
commit 6a39b51460
No known key found for this signature in database
GPG Key ID: 569A5660D2379E28

View File

@ -1,3 +1,8 @@
import { GET, POST } from './request';
export const textCensor = (data: { text: string }) => POST('/plugins/censor/text_baidu', data);
export const textCensor = (data: { text: string }) =>
POST<{ code?: number; message: string }>('/plugins/censor/text_baidu', data).then((res) => {
if (res?.code === 5000) {
return Promise.reject(res.message);
}
});