feat(react-web-next): 新增.editorconfig和.prettierrc配置文件,添加public/.gitkeep占位文件
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
// Umi 3 基础配置(中文注释)
|
||||
// 目标:
|
||||
// - 显式启用 routes.ts(保持与原项目路径兼容,支持 *.html 路径)
|
||||
// - 使用 browser history,开发调试直达路径不 404;产物 publicPath 保持相对路径便于静态托管
|
||||
// - 开发环境走 proxy 转发后端,避免跨域
|
||||
import routes from './routes';
|
||||
import proxy from './proxy';
|
||||
|
||||
const { REACT_APP_ENV } = process.env as any;
|
||||
const isDev = process.env.NODE_ENV === 'development';
|
||||
|
||||
export default {
|
||||
hash: true,
|
||||
// 资源路径:开发用根路径,生产为相对路径
|
||||
publicPath: isDev ? '/' : './',
|
||||
antd: {},
|
||||
// 页面 meta 标签
|
||||
metas: [
|
||||
{ charset: 'utf-8' },
|
||||
{ name: 'viewport', content: 'width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' },
|
||||
],
|
||||
// 主题(现代风格 + 红绿配主色)
|
||||
theme: {
|
||||
'primary-color': '#ff4d4f',
|
||||
'border-radius-base': '8px',
|
||||
'box-shadow-base': '0 8px 32px rgba(0, 0, 0, 0.1)',
|
||||
'animation-duration-slow': '0.4s',
|
||||
'animation-duration-base': '0.3s',
|
||||
'animation-duration-fast': '0.2s',
|
||||
},
|
||||
// 关闭 i18n,多语言后续按需启用
|
||||
locale: { antd: false, default: 'zh-CN', baseNavigator: true },
|
||||
// 使用按需编译的动态导入,提升首屏
|
||||
dynamicImport: { loading: '@/components/PageLoading' },
|
||||
// 路由采用显式配置
|
||||
routes,
|
||||
// 历史模式
|
||||
history: { type: 'browser' },
|
||||
// Dev 代理
|
||||
proxy: (proxy as any)[REACT_APP_ENV || 'dev'],
|
||||
// 构建优化
|
||||
nodeModulesTransform: { type: 'none' },
|
||||
mfsu: false,
|
||||
fastRefresh: {},
|
||||
} as any;
|
||||
@@ -0,0 +1,20 @@
|
||||
/**
|
||||
* 开发代理配置(仅 dev 生效)
|
||||
* - 统一网关转发:仅代理 /api- 前缀到网关(/api-user、/api-uaa 等)
|
||||
* - 生产环境由网关/容器转发,此文件不生效
|
||||
*/
|
||||
const GATEWAY = process.env.GATEWAY_ORIGIN || 'http://127.0.0.1:9900';
|
||||
|
||||
export default {
|
||||
dev: {
|
||||
// 单一规则覆盖所有微服务前缀:/api-*
|
||||
'/api-': { target: GATEWAY, changeOrigin: true },
|
||||
},
|
||||
test: {
|
||||
'/api-': { target: GATEWAY, changeOrigin: true },
|
||||
},
|
||||
pre: {
|
||||
'/api-': { target: GATEWAY, changeOrigin: true },
|
||||
},
|
||||
} as const;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
export default [
|
||||
{ path: '/user/login', component: '@/pages/user/Login' },
|
||||
{
|
||||
path: '/',
|
||||
component: '@/layouts/BasicLayout',
|
||||
routes: [
|
||||
{ path: '/', redirect: '/welcome' },
|
||||
{ path: '/welcome', component: '@/pages/Welcome' },
|
||||
{
|
||||
path: '/system',
|
||||
routes: [
|
||||
{ path: '/system/tokens.html', component: '@/pages/system/Token' },
|
||||
{ path: '/system/menus.html', component: '@/pages/system/Menu' },
|
||||
{ path: '/system/role.html', component: '@/pages/system/Role' },
|
||||
{ path: '/system/user.html', component: '@/pages/system/User' },
|
||||
{ path: '/system/tenant.html', component: '@/pages/system/TenantManage' },
|
||||
{ path: '/system/miniApp.html', component: '@/pages/system/MiniApp' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/orders',
|
||||
routes: [
|
||||
{ path: '/orders/order.html', component: '@/pages/orders/Order' },
|
||||
{ path: '/orders/orderFiles.html', component: '@/pages/orders/OrderFile' },
|
||||
{ path: '/orders/qrcode.html', component: '@/pages/orders/Qrcode' },
|
||||
{ path: '/orders/tourism.html', component: '@/pages/orders/Tourism' },
|
||||
{ path: '/orders/tourismFile.html', component: '@/pages/orders/TourismFile' },
|
||||
{ path: '/orders/homeCarousel.html', component: '@/pages/orders/HomeCarousel' },
|
||||
{ path: '/orders/refund.html', component: '@/pages/orders/Refund' },
|
||||
{ path: '/orders/statistics.html', component: '@/pages/orders/Statistics' },
|
||||
{ path: '/orders/profitSharing.html', component: '@/pages/orders/ProfitSharing' },
|
||||
{ path: '/orders/profit-sharing/statistics.html', component: '@/pages/orders/ProfitSharing/Statistics' },
|
||||
{ path: '/orders/videoTemplate.html', component: '@/pages/orders/VideoTemplate' },
|
||||
{ path: '/orders/editTask.html', component: '@/pages/orders/EditTask' },
|
||||
{ path: '/orders/wxMessage.html', component: '@/pages/orders/WxMessage' },
|
||||
{ path: '/orders/coupon.html', component: '@/pages/orders/Coupon' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/device',
|
||||
routes: [
|
||||
{ path: '/device/wayline.html', component: '@/pages/device/Wayline' },
|
||||
{ path: '/device/device.html', component: '@/pages/device/Device' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/log',
|
||||
routes: [
|
||||
{ path: '/log/sysLog.html', component: '@/pages/log/SysLog' },
|
||||
{ path: '/log/auditLog.html', component: '@/pages/log/AuditLog' },
|
||||
{ path: '/log/slowQueryLog.html', component: '@/pages/log/SlowSqlLog' },
|
||||
],
|
||||
},
|
||||
{
|
||||
path: '/search',
|
||||
routes: [
|
||||
{ path: '/search/index_manager.html', component: '@/pages/search/Index' },
|
||||
{ path: '/search/user_search.html', component: '@/pages/search/User' },
|
||||
],
|
||||
},
|
||||
{ path: '/message/message.html', component: '@/pages/message' },
|
||||
{
|
||||
path: '/files',
|
||||
routes: [
|
||||
{ path: '/files/files.html', component: '@/pages/files/File' },
|
||||
],
|
||||
},
|
||||
{ path: '/generator/list.html', component: '@/pages/system/Generator' },
|
||||
{ path: '/attestation/app.html', component: '@/pages/system/App' },
|
||||
{ path: '/system/myInfo.html', component: '@/pages/system/UserInfo' },
|
||||
{ component: '@/pages/404' },
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user