备份:大改造前的完整版本 - 修复合同细节/付款节点/文件上传/施工管理/项目保存等BUG
This commit is contained in:
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { Card, Typography, Button, Space, Table, Tag, message, Spin, Modal, Input } from 'antd';
|
||||
import { PlusOutlined, DeleteOutlined } from '@ant-design/icons';
|
||||
import axios from 'axios';
|
||||
import apiClient from '../../utils/request';
|
||||
import { useAuthStore } from '../../store/authStore';
|
||||
|
||||
const { Title, Paragraph } = Typography;
|
||||
@@ -52,9 +52,7 @@ const ProjectsPage: React.FC = () => {
|
||||
|
||||
const fetchProjects = async () => {
|
||||
try {
|
||||
console.log('开始获取项目列表...');
|
||||
const response = await axios.get('/api/projects');
|
||||
console.log('API响应:', response.data);
|
||||
const response = await apiClient.get('/projects');
|
||||
if (response.data.success) {
|
||||
setProjects(response.data.data.map((p: Project) => ({
|
||||
...p,
|
||||
@@ -93,7 +91,7 @@ const ProjectsPage: React.FC = () => {
|
||||
|
||||
setDeleteLoading(true);
|
||||
try {
|
||||
const response = await axios.delete(`/api/projects/${deleteProjectId}`, {
|
||||
const response = await apiClient.delete(`/projects/${deleteProjectId}`, {
|
||||
headers: {
|
||||
'x-user-role': 'admin'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user