Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 80a88dfd58 | |||
| 3a9b552681 | |||
| c48e8716ae | |||
| c4a8232226 | |||
| cf708dde75 | |||
| d4ab6db42e | |||
| c7ee52a1a1 |
@@ -8,6 +8,10 @@ COPY package*.json ./
|
|||||||
|
|
||||||
# 安装所有依赖 (包括开发依赖)
|
# 安装所有依赖 (包括开发依赖)
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
# 设置时区
|
||||||
|
RUN apk add --no-cache tzdata \
|
||||||
|
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
||||||
|
&& echo "Asia/Shanghai" > /etc/timezone
|
||||||
|
|
||||||
# 复制源代码
|
# 复制源代码
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend/src
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend/src
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend/src
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system/backend
|
|
||||||
@@ -75,7 +75,7 @@ services:
|
|||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
- backend
|
||||||
environment:
|
environment:
|
||||||
VITE_API_BASE_URL: http://47.238.126.111:33001
|
VITE_API_BASE_URL: ''
|
||||||
VITE_API_URL: http://backend:3001
|
VITE_API_URL: http://backend:3001
|
||||||
ports:
|
ports:
|
||||||
- "2000:3000"
|
- "2000:3000"
|
||||||
@@ -91,6 +91,27 @@ services:
|
|||||||
retries: 3
|
retries: 3
|
||||||
start_period: 30s
|
start_period: 30s
|
||||||
|
|
||||||
|
# Nginx反向代理服务
|
||||||
|
nginx:
|
||||||
|
image: nginx:alpine
|
||||||
|
container_name: performance-nginx
|
||||||
|
restart: unless-stopped
|
||||||
|
depends_on:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
ports:
|
||||||
|
- "80:80"
|
||||||
|
volumes:
|
||||||
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
||||||
|
networks:
|
||||||
|
- app-network
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD", "nginx", "-t"]
|
||||||
|
interval: 30s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 3
|
||||||
|
start_period: 10s
|
||||||
|
|
||||||
# 定义网络
|
# 定义网络
|
||||||
networks:
|
networks:
|
||||||
app-network:
|
app-network:
|
||||||
|
|||||||
7
frontend/.env.production
Normal file
7
frontend/.env.production
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# 前端生产环境配置
|
||||||
|
# 构建时使用的环境变量
|
||||||
|
|
||||||
|
# API 基础 URL - 使用阿里云NLB负载均衡器
|
||||||
|
VITE_API_BASE_URL=http://nlb-y7wvnvbyb726t5m4bz.cn-hongkong.nlb.aliyuncsslbintl.com:3001
|
||||||
|
|
||||||
|
# 其他环境变量可根据需要添加
|
||||||
@@ -3,7 +3,8 @@ import axios from 'axios';
|
|||||||
const TOKEN_KEY = 'auth_token';
|
const TOKEN_KEY = 'auth_token';
|
||||||
|
|
||||||
const http = axios.create({
|
const http = axios.create({
|
||||||
baseURL: import.meta.env.VITE_API_BASE_URL || 'http://localhost:33001',
|
// 🔥 核心修改
|
||||||
|
baseURL: import.meta.env.VITE_API_BASE_URL || '',
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -25,7 +26,6 @@ http.interceptors.response.use(
|
|||||||
(error) => {
|
(error) => {
|
||||||
const status = error?.response?.status;
|
const status = error?.response?.status;
|
||||||
if (status === 401 || status === 403) {
|
if (status === 401 || status === 403) {
|
||||||
// Clear stored credentials and redirect to login
|
|
||||||
localStorage.removeItem(TOKEN_KEY);
|
localStorage.removeItem(TOKEN_KEY);
|
||||||
localStorage.removeItem('auth_user');
|
localStorage.removeItem('auth_user');
|
||||||
window.location.href = '/login';
|
window.location.href = '/login';
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ import {
|
|||||||
ArrowLeftOutlined,
|
ArrowLeftOutlined,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
import { useParams, useNavigate } from 'react-router-dom';
|
import { useParams, useNavigate } from 'react-router-dom';
|
||||||
import { PerformanceRecord } from '../../api/performance';
|
import { PerformanceRecord, PerformanceItemDetail } from '../../api/performance';
|
||||||
import http from '../../api/http';
|
import http from '../../api/http';
|
||||||
import { useIsMobile } from '../../hooks/useBreakpoint';
|
import { useIsMobile } from '../../hooks/useBreakpoint';
|
||||||
import dayjs from 'dayjs';
|
import dayjs from 'dayjs';
|
||||||
@@ -85,7 +85,7 @@ const PerformanceReview: React.FC = () => {
|
|||||||
|
|
||||||
// Initialize form with existing manager scores if available
|
// Initialize form with existing manager scores if available
|
||||||
const itemScores: Record<string, ItemScoreForm> = {};
|
const itemScores: Record<string, ItemScoreForm> = {};
|
||||||
data.performanceItems?.forEach((item) => {
|
data.performanceItems?.forEach((item: PerformanceItemDetail) => {
|
||||||
itemScores[item.itemName] = {
|
itemScores[item.itemName] = {
|
||||||
managerScore: item.managerScore ?? item.aiScore ?? item.selfScore ?? 0,
|
managerScore: item.managerScore ?? item.aiScore ?? item.selfScore ?? 0,
|
||||||
scoreExplanation: item.managerExplanation ?? '',
|
scoreExplanation: item.managerExplanation ?? '',
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ interface SubordinateRecord extends PerformanceRecord {
|
|||||||
userPosition?: string;
|
userPosition?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface PageResult<T> {
|
// interface PageResult<T> {
|
||||||
list: T[];
|
// list: T[];
|
||||||
total: number;
|
// total: number;
|
||||||
page: number;
|
// page: number;
|
||||||
pageSize: number;
|
// pageSize: number;
|
||||||
}
|
// }
|
||||||
|
|
||||||
const SubordinateList: React.FC = () => {
|
const SubordinateList: React.FC = () => {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
|
|||||||
@@ -4,12 +4,19 @@ import react from '@vitejs/plugin-react';
|
|||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
|
host: '0.0.0.0', // 监听所有网络接口
|
||||||
port: 3000,
|
port: 3000,
|
||||||
|
allowedHosts: 'all',
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': {
|
'/api': {
|
||||||
target: process.env.VITE_API_URL || 'http://localhost:33001',
|
target: process.env.VITE_API_URL || 'http://localhost:33001',
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
hmr: {
|
||||||
|
host: 'performance-appraisal.excn.top',
|
||||||
|
protocol: 'wss',
|
||||||
|
clientPort: 443,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
34
nginx.conf
Normal file
34
nginx.conf
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name performance-appraisal.excn.top;
|
||||||
|
|
||||||
|
if ($http_x_forwarded_proto = "http") {
|
||||||
|
return 301 https://$server_name$request_uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
# 🔥 API(必须放前面 + ^~)
|
||||||
|
location ^~ /api/ {
|
||||||
|
|
||||||
|
rewrite ^/api/api/(.*)$ /api/$1 break;
|
||||||
|
|
||||||
|
proxy_pass http://backend:3001/;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;
|
||||||
|
|
||||||
|
add_header X-Debug-API "hit-api";
|
||||||
|
}
|
||||||
|
|
||||||
|
# 前端
|
||||||
|
location / {
|
||||||
|
proxy_pass http://frontend:3000;
|
||||||
|
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Upgrade $http_upgrade;
|
||||||
|
proxy_set_header Connection "upgrade";
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
/c/Users/99095/Desktop/优一科技/performance-evaluation-system
|
|
||||||
Reference in New Issue
Block a user