Initial commit: Car Maintenance Management System
Author: Yang Lu School: Liaoning Institute of Science and Technology Major: Computer Science and Technology Class: BZ246 Tech Stack: - Backend: Spring Boot 2.7.18 + JPA + MySQL - Frontend: HTML5 + CSS3 + JavaScript Features: - User Management (Admin/Staff/Customer roles) - Vehicle Archive Management - Service Order Management - Parts Inventory Management - Online Appointment Service - Data Statistics and Analysis Generated with Claude Code Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
52
frontend/js/config.js
Normal file
52
frontend/js/config.js
Normal file
@@ -0,0 +1,52 @@
|
||||
// API配置
|
||||
const API_CONFIG = {
|
||||
BASE_URL: 'http://localhost:8080/api',
|
||||
TIMEOUT: 30000
|
||||
};
|
||||
|
||||
// API端点
|
||||
const API_ENDPOINTS = {
|
||||
// 认证相关
|
||||
LOGIN: '/auth/login',
|
||||
LOGOUT: '/auth/logout',
|
||||
REGISTER: '/auth/register',
|
||||
|
||||
// 用户管理
|
||||
USERS: '/users',
|
||||
USER_BY_ID: (id) => `/users/${id}`,
|
||||
USERS_BY_ROLE: (role) => `/users/role/${role}`,
|
||||
CHANGE_PASSWORD: (id) => `/users/${id}/password`,
|
||||
|
||||
// 车辆管理
|
||||
VEHICLES: '/vehicles',
|
||||
VEHICLE_BY_ID: (id) => `/vehicles/${id}`,
|
||||
VEHICLES_BY_CUSTOMER: (customerId) => `/vehicles/customer/${customerId}`,
|
||||
VEHICLE_BY_PLATE: (plate) => `/vehicles/plate/${plate}`,
|
||||
|
||||
// 工单管理
|
||||
ORDERS: '/orders',
|
||||
ORDER_BY_ID: (id) => `/orders/${id}`,
|
||||
ORDERS_BY_CUSTOMER: (customerId) => `/orders/customer/${customerId}`,
|
||||
ORDERS_BY_VEHICLE: (vehicleId) => `/orders/vehicle/${vehicleId}`,
|
||||
ORDERS_BY_STATUS: (status) => `/orders/status/${status}`,
|
||||
|
||||
// 配件管理
|
||||
PARTS: '/parts',
|
||||
PART_BY_ID: (id) => `/parts/${id}`,
|
||||
PARTS_BY_CATEGORY: (category) => `/parts/category/${category}`,
|
||||
PARTS_LOW_STOCK: '/parts/low-stock',
|
||||
|
||||
// 预约管理
|
||||
APPOINTMENTS: '/appointments',
|
||||
APPOINTMENT_BY_ID: (id) => `/appointments/${id}`,
|
||||
APPOINTMENTS_BY_CUSTOMER: (customerId) => `/appointments/customer/${customerId}`,
|
||||
APPOINTMENTS_BY_STATUS: (status) => `/appointments/status/${status}`,
|
||||
CANCEL_APPOINTMENT: (id) => `/appointments/${id}/cancel`
|
||||
};
|
||||
|
||||
// 本地存储键名
|
||||
const STORAGE_KEYS = {
|
||||
TOKEN: 'car_maintenance_token',
|
||||
USER_INFO: 'car_maintenance_user',
|
||||
REMEMBER_ME: 'car_maintenance_remember'
|
||||
};
|
||||
Reference in New Issue
Block a user