|
|
@@ -601,23 +601,33 @@ const QuestionAnswerInfo: React.FC = () => {
|
|
|
// console.log(info, 'info data----');
|
|
|
const id = location?.state?.id;
|
|
|
let res = null;
|
|
|
- if (id) {
|
|
|
- // 编辑应用
|
|
|
- res = await apis.modifyTakaiApplicationApi(id, info);
|
|
|
- } else {
|
|
|
- // 创建应用
|
|
|
- res = await await apis.createTakaiApplicationApi(info);
|
|
|
- }
|
|
|
- console.log(res, 'create or modify');
|
|
|
- if (res.data === 9) {
|
|
|
- message.error('没有配置审核人,请联系管理员');
|
|
|
- } else if (res.data === 1) {
|
|
|
- message.success('操作成功')
|
|
|
- } else {
|
|
|
- message.error('操作失败');
|
|
|
- }
|
|
|
- if (type === 'SUBMIT') {
|
|
|
- router.navigate({ pathname: '/deepseek/questionAnswer' });
|
|
|
+ try {
|
|
|
+ if (id) {
|
|
|
+ // 编辑应用
|
|
|
+ res = await apis.modifyTakaiApplicationApi(id, info);
|
|
|
+ } else {
|
|
|
+ // 创建应用
|
|
|
+ res = await apis.createTakaiApplicationApi(info);
|
|
|
+ }
|
|
|
+ console.log(res, 'create or modify');
|
|
|
+ if (res.data === 9) {
|
|
|
+ message.error('没有配置审核人,请联系管理员');
|
|
|
+ } else if (res.data === 1) {
|
|
|
+ message.success('操作成功')
|
|
|
+ if (type === 'SUBMIT') {
|
|
|
+ router.navigate({ pathname: '/deepseek/questionAnswer' });
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ message.error('操作失败');
|
|
|
+ }
|
|
|
+ } catch (error: any) {
|
|
|
+ // 检查是否是403错误
|
|
|
+ if (error?.response?.status === 403) {
|
|
|
+ message.error('您提交的信息内容非法,访问已被防火墙拒绝');
|
|
|
+ } else {
|
|
|
+ console.error('提交失败:', error);
|
|
|
+ // 其他错误会由axios拦截器处理,这里不再重复显示错误信息
|
|
|
+ }
|
|
|
}
|
|
|
}).catch((error) => {
|
|
|
console.error(error);
|