mirror of
https://github.com/labring/FastGPT.git
synced 2025-08-02 20:58:12 +00:00
Optimize the project structure and introduce DDD design (#394)
This commit is contained in:
15
projects/app/src/service/common/api/plugins.ts
Normal file
15
projects/app/src/service/common/api/plugins.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { POST } from './request';
|
||||
|
||||
export const postTextCensor = (data: { text: string }) =>
|
||||
POST<{ code?: number; message: string }>('/plugins/censor/text_baidu', data)
|
||||
.then((res) => {
|
||||
if (res?.code === 5000) {
|
||||
return Promise.reject(res);
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
if (err?.code === 5000) {
|
||||
return Promise.reject(err.message);
|
||||
}
|
||||
return Promise.resolve('');
|
||||
});
|
Reference in New Issue
Block a user