feat: crud

This commit is contained in:
luchang
2024-05-22 19:14:37 +08:00
parent 4e1cd06e6e
commit 20293b6283
21 changed files with 1381 additions and 1065 deletions
+10
View File
@@ -0,0 +1,10 @@
import { defineConfig } from "@umijs/max";
export default defineConfig({
define: {
'process.env': {
API_HOST_URL: 'http://localhost:3000'
}
}
})
+2 -2
View File
@@ -15,9 +15,9 @@ const Settings: ProLayoutProps & {
fixedHeader: false,
fixSiderbar: true,
colorWeak: false,
title: 'Ant Design Pro',
title: '依图',
pwa: true,
logo: 'https://gw.alipayobjects.com/zos/rmsportal/KDpgvguMpGfqaHPjicRK.svg',
logo: 'https://polaris-frontend.oss-cn-shanghai.aliyuncs.com/yitu_image/logo.png',
iconfontUrl: '',
token: {
// 参见ts声明,demo 见文档,通过token 修改样式
+7 -24
View File
@@ -9,36 +9,19 @@
*
* @doc https://umijs.org/docs/guides/proxy
*/
const { API_HOST_URL = 'localhost:3000' } = process.env;
export default {
// 如果需要自定义本地开发服务器 请取消注释按需调整
// dev: {
// // localhost:8000/api/** -> https://preview.pro.ant.design/api/**
// '/api/': {
// // 要代理的地址
// target: 'https://preview.pro.ant.design',
// // 配置了这个可以从 http 代理到 https
// // 依赖 origin 的功能可能需要这个,比如 cookie
// changeOrigin: true,
// },
// },
/**
* @name 详细的代理配置
* @doc https://github.com/chimurai/http-proxy-middleware
*/
test: {
dev: {
// localhost:8000/api/** -> https://preview.pro.ant.design/api/**
'/api/': {
target: 'https://proapi.azurewebsites.net',
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
pre: {
'/api/': {
target: 'your pre url',
// 要代理的地址
target: API_HOST_URL,
// 配置了这个可以从 http 代理到 https
// 依赖 origin 的功能可能需要这个,比如 cookie
changeOrigin: true,
pathRewrite: { '^': '' },
},
},
};
+22 -22
View File
@@ -23,37 +23,37 @@ export default [
],
},
{
path: '/welcome',
path: '/userList',
name: 'welcome',
icon: 'smile',
component: './Welcome',
},
{
path: '/admin',
name: 'admin',
icon: 'crown',
access: 'canAdmin',
routes: [
{
path: '/admin',
redirect: '/admin/sub-page',
},
{
path: '/admin/sub-page',
name: 'sub-page',
component: './Admin',
},
],
component: './UserList',
},
{
name: 'list.table-list',
icon: 'table',
path: '/list',
component: './TableList',
path: '/banner',
component: './Banner',
routers: [
{
name: 'login',
path: '/banner/test',
component: './Banner',
},
{
name: 'login',
path: '/banner/2',
component: './Banner',
},
{
name: 'login',
path: '/banner/3',
component: './Banner',
},
],
},
{
path: '/',
redirect: '/welcome',
redirect: '/userList',
},
{
path: '*',