feat: 1. 将大部分的请求从fetch改成axios方便管理。

2. 给文档类型添加入口模块和相关数据的渲染。并且给文档类型进行功能上的角色权限区分
3. 新增角色权限管理页面
This commit is contained in:
2025-11-20 20:34:31 +08:00
parent 2e604e8ede
commit 3850d05bdd
25 changed files with 2299 additions and 762 deletions
@@ -32,6 +32,7 @@ import {
} from '../../api/cross-checking/cross-file-result';
import { useFetcher, useNavigate } from '@remix-run/react';
import { API_BASE_URL } from '~/config/api-config';
import axios from 'axios';
// import '../../styles/components/TooltipStyles.css';
/**
@@ -768,18 +769,16 @@ export function ReviewPointsList({
}
// 打印最终请求体
// console.log('最终请求体:', data);
// 用原生 fetch + application/json 提交
// 用 axios + application/json 提交
try {
const response = await fetch(`${API_BASE_URL.replace(/\/$/, '')}/admin/cross_review/proposals`, {
method: 'POST',
const response = await axios.post(`${API_BASE_URL.replace(/\/$/, '')}/admin/cross_review/proposals`, data, {
headers: {
'Content-Type': 'application/json',
'Authorization': `Bearer ${userInfo.frontend_jwt}`,
},
body: JSON.stringify(data)
}
});
const result = await response.json();
if (response.ok) {
const result = response.data;
if (response.status === 200) {
toastService.success('意见提交成功');
// 创建新的提案对象