Commit 21f5dacdadd8a629a044372dd37b60feaa1a5b1f

Authored by calmound
0 parents

feat:init

Too many changes to show.

To preserve performance only 13 of 45 files are displayed.

.eslintrc.js 0 → 100644
  1 +++ a/.eslintrc.js
  1 +module.exports = {
  2 + extends: require.resolve('@umijs/max/eslint'),
  3 +};
... ...
.gitignore 0 → 100644
  1 +++ a/.gitignore
  1 +/node_modules
  2 +/.env.local
  3 +/.umirc.local.ts
  4 +/config/config.local.ts
  5 +/src/.umi
  6 +/src/.umi-production
  7 +/src/.umi-test
  8 +/.umi
  9 +/.umi-production
  10 +/.umi-test
  11 +/dist
  12 +/.mfsu
  13 +.swc
... ...
.husky/commit-msg 0 → 100644
  1 +++ a/.husky/commit-msg
  1 +#!/usr/bin/env sh
  2 +. "$(dirname -- "$0")/_/husky.sh"
  3 +
  4 +npx --no-install max verify-commit $1
... ...
.husky/pre-commit 0 → 100644
  1 +++ a/.husky/pre-commit
  1 +#!/usr/bin/env sh
  2 +. "$(dirname -- "$0")/_/husky.sh"
  3 +
  4 +npx --no-install lint-staged --quiet
... ...
.lintstagedrc 0 → 100644
  1 +++ a/.lintstagedrc
  1 +{
  2 + "*.{md,json}": [
  3 + "prettier --cache --write"
  4 + ],
  5 + "*.{js,jsx}": [
  6 + "max lint --fix --eslint-only",
  7 + "prettier --cache --write"
  8 + ],
  9 + "*.{css,less}": [
  10 + "max lint --fix --stylelint-only",
  11 + "prettier --cache --write"
  12 + ],
  13 + "*.ts?(x)": [
  14 + "max lint --fix --eslint-only",
  15 + "prettier --cache --parser=typescript --write"
  16 + ]
  17 +}
... ...
.npmrc 0 → 100644
  1 +++ a/.npmrc
  1 +registry=https://registry.npmjs.com/
  2 +
... ...
.prettierignore 0 → 100644
  1 +++ a/.prettierignore
  1 +node_modules
  2 +.umi
  3 +.umi-production
... ...
.prettierrc 0 → 100644
  1 +++ a/.prettierrc
  1 +{
  2 + "printWidth": 80,
  3 + "singleQuote": true,
  4 + "trailingComma": "all",
  5 + "proseWrap": "never",
  6 + "overrides": [{ "files": ".prettierrc", "options": { "parser": "json" } }],
  7 + "plugins": ["prettier-plugin-organize-imports", "prettier-plugin-packagejson"]
  8 +}
... ...
.stylelintrc.js 0 → 100644
  1 +++ a/.stylelintrc.js
  1 +module.exports = {
  2 + extends: require.resolve('@umijs/max/stylelint'),
  3 +};
... ...
.umirc.ts 0 → 100644
  1 +++ a/.umirc.ts
  1 +import { defineConfig } from '@umijs/max';
  2 +
  3 +export default defineConfig({
  4 + antd: {},
  5 + access: {},
  6 + model: {},
  7 + initialState: {},
  8 + request: {},
  9 + layout: {
  10 + title: '项目组模板',
  11 + },
  12 + proxy: {
  13 + '/api/': {
  14 + target: 'http://11.1.1.144:31590/',
  15 + changeOrigin: true,
  16 + pathRewrite: { '^/api': '' },
  17 + },
  18 + },
  19 + routes: [
  20 + {
  21 + path: '/',
  22 + redirect: '/home',
  23 + },
  24 + {
  25 + name: '首页',
  26 + path: '/home',
  27 + component: './Home',
  28 + },
  29 + {
  30 + name: '权限演示',
  31 + path: '/access',
  32 + component: './Access',
  33 + },
  34 + {
  35 + name: '用户',
  36 + path: '/user',
  37 + component: './User',
  38 + },
  39 + {
  40 + name: ' CRUD 示例',
  41 + path: '/table',
  42 + component: './Table',
  43 + },
  44 + ],
  45 + npmClient: 'pnpm',
  46 +});
... ...
README.md 0 → 100644
  1 +++ a/README.md
  1 +# README
  2 +
  3 +`@umijs/max` 模板项目,更多功能参考 [Umi Max 简介](https://umijs.org/docs/max/introduce)
... ...
mock/userAPI.ts 0 → 100644
  1 +++ a/mock/userAPI.ts
  1 +const users = [
  2 + { id: 0, name: 'Umi', nickName: 'U', gender: 'MALE' },
  3 + { id: 1, name: 'Fish', nickName: 'B', gender: 'FEMALE' },
  4 +];
  5 +
  6 +export default {
  7 + 'GET /api/v1/queryUserList': (req: any, res: any) => {
  8 + res.json({
  9 + success: true,
  10 + data: { list: users },
  11 + errorCode: 0,
  12 + });
  13 + },
  14 + 'PUT /api/v1/user/': (req: any, res: any) => {
  15 + res.json({
  16 + success: true,
  17 + errorCode: 0,
  18 + });
  19 + },
  20 +};
... ...
package.json 0 → 100644
  1 +++ a/package.json
  1 +{
  2 + "private": true,
  3 + "author": "calmound <245708505@qq.com>",
  4 + "scripts": {
  5 + "dev": "max dev",
  6 + "build": "max build",
  7 + "format": "prettier --cache --write .",
  8 + "prepare": "husky install",
  9 + "postinstall": "max setup",
  10 + "setup": "max setup",
  11 + "start": "npm run dev"
  12 + },
  13 + "dependencies": {
  14 + "@ant-design/icons": "^5.2.6",
  15 + "@ant-design/pro-components": "^2.6.32",
  16 + "@umijs/max": "^4.0.87",
  17 + "antd": "^5.10.2"
  18 + },
  19 + "devDependencies": {
  20 + "@types/react": "^18.2.31",
  21 + "@types/react-dom": "^18.2.14",
  22 + "husky": "^8.0.3",
  23 + "lint-staged": "^15.0.2",
  24 + "prettier": "^3.0.3",
  25 + "prettier-plugin-organize-imports": "^3.2.3",
  26 + "prettier-plugin-packagejson": "^2.4.6",
  27 + "typescript": "^5.2.2"
  28 + }
  29 +}
... ...