From bf9bfa426c76d8e610ad69bc3b15efdf1229164a Mon Sep 17 00:00:00 2001
From: kevin <1026838160@qq.com>
Date: Tue, 25 Jun 2024 23:55:41 +0800
Subject: [PATCH] feat: common
---
package.json | 4 +-
pnpm-lock.yaml | 64 ++++++++++++++++++++++++++---
src/layout/ContentLayout/index.tsx | 7 ++++
src/layout/MainLayout.tsx/index.tsx | 7 ++++
src/main.tsx | 2 +-
src/pages/login/index.tsx | 7 ++++
src/pages/third/login/index.tsx | 5 +++
src/routes/index.tsx | 32 +++++++++++++++
src/routes/thirdRoutes.ts | 11 +++++
src/{ => styles}/main.css | 0
src/utils/request.ts | 37 +++++++++++++++++
src/utils/storage.ts | 13 ++++++
tsconfig.json | 30 ++++++++++----
tsconfig.node.json | 6 ++-
vite.config.ts | 8 +++-
15 files changed, 213 insertions(+), 20 deletions(-)
create mode 100644 src/layout/ContentLayout/index.tsx
create mode 100644 src/layout/MainLayout.tsx/index.tsx
create mode 100644 src/pages/login/index.tsx
create mode 100644 src/pages/third/login/index.tsx
create mode 100644 src/routes/index.tsx
create mode 100644 src/routes/thirdRoutes.ts
rename src/{ => styles}/main.css (100%)
create mode 100644 src/utils/request.ts
create mode 100644 src/utils/storage.ts
diff --git a/package.json b/package.json
index 0d52946..c808a06 100644
--- a/package.json
+++ b/package.json
@@ -37,10 +37,12 @@
}
},
"dependencies": {
+ "axios": "^1.7.2",
"i18next": "^23.11.5",
"pretty-bytes": "^6.1.1",
"react": "^18.2.0",
- "react-dom": "^18.2.0"
+ "react-dom": "^18.2.0",
+ "react-router-dom": "^6.23.1"
},
"devDependencies": {
"@commitlint/cli": "^18.4.4",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 347ed2d..61b6129 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -5,6 +5,9 @@ settings:
excludeLinksFromLockfile: false
dependencies:
+ axios:
+ specifier: ^1.7.2
+ version: 1.7.2
i18next:
specifier: ^23.11.5
version: 23.11.5
@@ -17,6 +20,9 @@ dependencies:
react-dom:
specifier: ^18.2.0
version: 18.2.0(react@18.2.0)
+ react-router-dom:
+ specifier: ^6.23.1
+ version: 6.23.1(react-dom@18.2.0)(react@18.2.0)
devDependencies:
'@commitlint/cli':
@@ -1153,6 +1159,11 @@ packages:
engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0}
dev: true
+ /@remix-run/router@1.16.1:
+ resolution: {integrity: sha512-es2g3dq6Nb07iFxGk5GuHN20RwBZOsuDQN7izWIisUcv9r+d2C5jQxqmgkdebXgReWfiyUabcki6Fg77mSNrig==}
+ engines: {node: '>=14.0.0'}
+ dev: false
+
/@rollup/rollup-android-arm-eabi@4.9.5:
resolution: {integrity: sha512-idWaG8xeSRCfRq9KpRysDHJ/rEHBEXcHuJ82XY0yYFIWnLMjZv9vF/7DOq8djQ2n3Lk6+3qfSH8AqlmHlmi1MA==}
cpu: [arm]
@@ -1818,7 +1829,6 @@ packages:
/asynckit@0.4.0:
resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==}
- dev: true
/at-least-node@1.0.0:
resolution: {integrity: sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==}
@@ -1848,6 +1858,16 @@ packages:
postcss-value-parser: 4.2.0
dev: true
+ /axios@1.7.2:
+ resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==}
+ dependencies:
+ follow-redirects: 1.15.6
+ form-data: 4.0.0
+ proxy-from-env: 1.1.0
+ transitivePeerDependencies:
+ - debug
+ dev: false
+
/balanced-match@1.0.2:
resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}
dev: true
@@ -2128,7 +2148,6 @@ packages:
engines: {node: '>= 0.8'}
dependencies:
delayed-stream: 1.0.0
- dev: true
/commander@4.1.1:
resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==}
@@ -2376,7 +2395,6 @@ packages:
/delayed-stream@1.0.0:
resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==}
engines: {node: '>=0.4.0'}
- dev: true
/detect-node@2.1.0:
resolution: {integrity: sha512-T0NIuQpnTvFDATNuHN5roPwSBG83rFsuO+MXXH9/3N1eFbn4wcPjttvjMLEPWJ0RGUYgQE7cGgS3tNxbqCGM7g==}
@@ -2968,6 +2986,16 @@ packages:
resolution: {integrity: sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==}
dev: true
+ /follow-redirects@1.15.6:
+ resolution: {integrity: sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==}
+ engines: {node: '>=4.0'}
+ peerDependencies:
+ debug: '*'
+ peerDependenciesMeta:
+ debug:
+ optional: true
+ dev: false
+
/foreground-child@3.1.1:
resolution: {integrity: sha512-TMKDUnIte6bfb5nWv7V/caI169OHgvwjb7V4WkeUvbQQdjr5rWKqHFiKWb/fcOwB+CzBT+qbWjvj+DVwRskpIg==}
engines: {node: '>=14'}
@@ -2983,7 +3011,6 @@ packages:
asynckit: 0.4.0
combined-stream: 1.0.8
mime-types: 2.1.35
- dev: true
/fraction.js@4.3.7:
resolution: {integrity: sha512-ZsDfxO51wGAXREY55a7la9LScWpwv9RxIrYABrlvOFBlH/ShPnrtsXeuUIfXKKOVicNxQ+o8JTbJvjS4M89yew==}
@@ -3784,14 +3811,12 @@ packages:
/mime-db@1.52.0:
resolution: {integrity: sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==}
engines: {node: '>= 0.6'}
- dev: true
/mime-types@2.1.35:
resolution: {integrity: sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==}
engines: {node: '>= 0.6'}
dependencies:
mime-db: 1.52.0
- dev: true
/mime@2.6.0:
resolution: {integrity: sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==}
@@ -4310,6 +4335,10 @@ packages:
retry: 0.12.0
dev: true
+ /proxy-from-env@1.1.0:
+ resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==}
+ dev: false
+
/pump@3.0.0:
resolution: {integrity: sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==}
dependencies:
@@ -4351,6 +4380,29 @@ packages:
engines: {node: '>=0.10.0'}
dev: true
+ /react-router-dom@6.23.1(react-dom@18.2.0)(react@18.2.0):
+ resolution: {integrity: sha512-utP+K+aSTtEdbWpC+4gxhdlPFwuEfDKq8ZrPFU65bbRJY+l706qjR7yaidBpo3MSeA/fzwbXWbKBI6ftOnP3OQ==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ react: '>=16.8'
+ react-dom: '>=16.8'
+ dependencies:
+ '@remix-run/router': 1.16.1
+ react: 18.2.0
+ react-dom: 18.2.0(react@18.2.0)
+ react-router: 6.23.1(react@18.2.0)
+ dev: false
+
+ /react-router@6.23.1(react@18.2.0):
+ resolution: {integrity: sha512-fzcOaRF69uvqbbM7OhvQyBTFDVrrGlsFdS3AL+1KfIBtGETibHzi3FkoTRyiDJnWNc2VxrfvR+657ROHjaNjqQ==}
+ engines: {node: '>=14.0.0'}
+ peerDependencies:
+ react: '>=16.8'
+ dependencies:
+ '@remix-run/router': 1.16.1
+ react: 18.2.0
+ dev: false
+
/react@18.2.0:
resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==}
engines: {node: '>=0.10.0'}
diff --git a/src/layout/ContentLayout/index.tsx b/src/layout/ContentLayout/index.tsx
new file mode 100644
index 0000000..328cb15
--- /dev/null
+++ b/src/layout/ContentLayout/index.tsx
@@ -0,0 +1,7 @@
+import { Outlet } from "react-router-dom";
+
+const ContentLayout = () => {
+ return