create-bubbles 0.0.18 → 0.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template-react-rsbuild/package.json +10 -10
- package/template-react-rsbuild/src/pages/home/index.tsx +1 -1
- package/template-vue-rsbuild/package.json +9 -9
- package/template-vue-rsbuild/src/router/modules/index.tsx +1 -1
- package/template-vue-rsbuild/src/types/auto-import.d.ts +2 -0
- package/template-vue-rsbuild/src/views/home/index.vue +1 -1
- package/template-vue-rsbuild-eslint/.env +0 -3
- package/template-vue-rsbuild-eslint/.env.development +0 -0
- package/template-vue-rsbuild-eslint/.env.production +0 -0
- package/template-vue-rsbuild-eslint/.gitignore +0 -13
- package/template-vue-rsbuild-eslint/.prettierignore +0 -4
- package/template-vue-rsbuild-eslint/.prettierrc +0 -17
- package/template-vue-rsbuild-eslint/.vscode/extensions.json +0 -3
- package/template-vue-rsbuild-eslint/README.md +0 -29
- package/template-vue-rsbuild-eslint/biome.json +0 -110
- package/template-vue-rsbuild-eslint/index.html +0 -7
- package/template-vue-rsbuild-eslint/package.json +0 -31
- package/template-vue-rsbuild-eslint/postcss.config.mjs +0 -5
- package/template-vue-rsbuild-eslint/public/.gitkeep +0 -0
- package/template-vue-rsbuild-eslint/rsbuild.config.ts +0 -28
- package/template-vue-rsbuild-eslint/src/App.vue +0 -29
- package/template-vue-rsbuild-eslint/src/env.d.ts +0 -17
- package/template-vue-rsbuild-eslint/src/index.css +0 -6
- package/template-vue-rsbuild-eslint/src/index.ts +0 -15
- package/template-vue-rsbuild-eslint/src/router/guard/index.tsx +0 -6
- package/template-vue-rsbuild-eslint/src/router/guard/permissionGuard.ts +0 -8
- package/template-vue-rsbuild-eslint/src/router/index.tsx +0 -14
- package/template-vue-rsbuild-eslint/src/router/modules/index.tsx +0 -10
- package/template-vue-rsbuild-eslint/src/store/index.ts +0 -7
- package/template-vue-rsbuild-eslint/src/store/modules/user.ts +0 -16
- package/template-vue-rsbuild-eslint/src/styles/index.css +0 -16
- package/template-vue-rsbuild-eslint/src/types/auto-import.d.ts +0 -91
- package/template-vue-rsbuild-eslint/src/utils/request/axios.ts +0 -83
- package/template-vue-rsbuild-eslint/src/utils/request/index.ts +0 -77
- package/template-vue-rsbuild-eslint/src/views/home/index.vue +0 -13
- package/template-vue-rsbuild-eslint/tsconfig.json +0 -29
- package/template-vue-rsbuild-eslint/uno.config.ts +0 -9
package/package.json
CHANGED
|
@@ -14,29 +14,29 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@ant-design/icons-vue": "^7.0.1",
|
|
16
16
|
"ahooks": "^3.8.4",
|
|
17
|
-
"antd": "^5.
|
|
18
|
-
"axios": "^1.
|
|
17
|
+
"antd": "^5.25.1",
|
|
18
|
+
"axios": "^1.9.0",
|
|
19
19
|
"dayjs": "^1.11.13",
|
|
20
20
|
"react": "^19.1.0",
|
|
21
21
|
"react-dom": "^19.1.0",
|
|
22
|
-
"react-router": "^7.
|
|
22
|
+
"react-router": "^7.6.0",
|
|
23
23
|
"zustand": "^5.0.3"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@biomejs/biome": "^1.9.4",
|
|
27
|
-
"@commitlint/config-conventional": "^19.8.
|
|
27
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
28
28
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
29
|
-
"@rsbuild/core": "^1.3.
|
|
30
|
-
"@rsbuild/plugin-react": "^1.
|
|
29
|
+
"@rsbuild/core": "^1.3.20",
|
|
30
|
+
"@rsbuild/plugin-react": "^1.3.1",
|
|
31
31
|
"@rsbuild/plugin-sass": "^1.3.1",
|
|
32
32
|
"@rsbuild/plugin-svgr": "^1.2.0",
|
|
33
|
-
"@types/react": "^19.1.
|
|
34
|
-
"@types/react-dom": "^19.1.
|
|
35
|
-
"@unocss/postcss": "66.1.
|
|
33
|
+
"@types/react": "^19.1.4",
|
|
34
|
+
"@types/react-dom": "^19.1.5",
|
|
35
|
+
"@unocss/postcss": "66.1.2",
|
|
36
36
|
"lefthook": "^1.11.10",
|
|
37
37
|
"prettier": "^3.5.3",
|
|
38
38
|
"typescript": "^5.8.3",
|
|
39
|
-
"unocss": "66.1.
|
|
39
|
+
"unocss": "66.1.2",
|
|
40
40
|
"unplugin-auto-import": "^19.1.2"
|
|
41
41
|
}
|
|
42
42
|
}
|
|
@@ -12,21 +12,21 @@
|
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
14
|
"ant-design-vue": "^4.2.6",
|
|
15
|
-
"pinia": "^3.0.
|
|
16
|
-
"vue": "^3.5.
|
|
17
|
-
"vue-router": "^4.5.
|
|
15
|
+
"pinia": "^3.0.2",
|
|
16
|
+
"vue": "^3.5.14",
|
|
17
|
+
"vue-router": "^4.5.1"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@biomejs/biome": "^1.9.4",
|
|
21
21
|
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
22
|
-
"@rsbuild/core": "^1.3.
|
|
22
|
+
"@rsbuild/core": "^1.3.20",
|
|
23
23
|
"@rsbuild/plugin-sass": "^1.3.1",
|
|
24
24
|
"@rsbuild/plugin-vue": "^1.0.7",
|
|
25
|
-
"@unocss/postcss": "^
|
|
26
|
-
"lefthook": "^1.11.
|
|
25
|
+
"@unocss/postcss": "^66.1.2",
|
|
26
|
+
"lefthook": "^1.11.12",
|
|
27
27
|
"prettier": "^3.5.3",
|
|
28
|
-
"typescript": "^5.8.
|
|
29
|
-
"unocss": "^
|
|
30
|
-
"unplugin-auto-import": "^19.
|
|
28
|
+
"typescript": "^5.8.3",
|
|
29
|
+
"unocss": "^66.1.2",
|
|
30
|
+
"unplugin-auto-import": "^19.2.0"
|
|
31
31
|
}
|
|
32
32
|
}
|
|
File without changes
|
|
File without changes
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"singleQuote": true,
|
|
3
|
-
"jsxSingleQuote": false,
|
|
4
|
-
"trailingComma": "all",
|
|
5
|
-
"printWidth": 100,
|
|
6
|
-
"proseWrap": "never",
|
|
7
|
-
"importOrder": ["^(vue|vue-router)$", "^([a-z]|@[a-z])", "", ".*"],
|
|
8
|
-
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
|
|
9
|
-
"overrides": [
|
|
10
|
-
{
|
|
11
|
-
"files": ".prettierrc",
|
|
12
|
-
"options": {
|
|
13
|
-
"parser": "json"
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
# Rsbuild project
|
|
2
|
-
|
|
3
|
-
## Setup
|
|
4
|
-
|
|
5
|
-
Install the dependencies:
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
pnpm install
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Get started
|
|
12
|
-
|
|
13
|
-
Start the dev server:
|
|
14
|
-
|
|
15
|
-
```bash
|
|
16
|
-
pnpm dev
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
Build the app for production:
|
|
20
|
-
|
|
21
|
-
```bash
|
|
22
|
-
pnpm build
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Preview the production build locally:
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
pnpm preview
|
|
29
|
-
```
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"files": {
|
|
3
|
-
"ignoreUnknown": true,
|
|
4
|
-
"ignore": [
|
|
5
|
-
"dist/*",
|
|
6
|
-
"es/**/*",
|
|
7
|
-
"lib/**/*",
|
|
8
|
-
"node_modules",
|
|
9
|
-
"server",
|
|
10
|
-
"scripts/previewEditor/**/*",
|
|
11
|
-
"package.json"
|
|
12
|
-
]
|
|
13
|
-
},
|
|
14
|
-
"formatter": {
|
|
15
|
-
"enabled": true,
|
|
16
|
-
"indentStyle": "space",
|
|
17
|
-
"lineWidth": 100,
|
|
18
|
-
"indentWidth": 2
|
|
19
|
-
},
|
|
20
|
-
"javascript": {
|
|
21
|
-
"formatter": {
|
|
22
|
-
"quoteStyle": "single",
|
|
23
|
-
"semicolons": "asNeeded"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"organizeImports": {
|
|
27
|
-
"enabled": false
|
|
28
|
-
},
|
|
29
|
-
"linter": {
|
|
30
|
-
"rules": {
|
|
31
|
-
"style": {
|
|
32
|
-
"useImportType": "off",
|
|
33
|
-
"useNumberNamespace": "off",
|
|
34
|
-
"useNodejsImportProtocol": "off",
|
|
35
|
-
"noNonNullAssertion": "off",
|
|
36
|
-
"noUnusedTemplateLiteral": "off"
|
|
37
|
-
},
|
|
38
|
-
"complexity": {
|
|
39
|
-
"noUselessTypeConstraint": "off",
|
|
40
|
-
"noForEach": "off"
|
|
41
|
-
},
|
|
42
|
-
"correctness": {
|
|
43
|
-
"useExhaustiveDependencies": "off"
|
|
44
|
-
},
|
|
45
|
-
"suspicious": {
|
|
46
|
-
"noGlobalIsNan": "off",
|
|
47
|
-
"noGlobalIsFinite": "off",
|
|
48
|
-
"noExplicitAny": "off",
|
|
49
|
-
"noArrayIndexKey": "off",
|
|
50
|
-
"noConfusingVoidType": "off",
|
|
51
|
-
"noThenProperty": "off"
|
|
52
|
-
},
|
|
53
|
-
"performance": {
|
|
54
|
-
"noDelete": "off",
|
|
55
|
-
"noAccumulatingSpread": "off"
|
|
56
|
-
},
|
|
57
|
-
"a11y": {
|
|
58
|
-
"noAriaHiddenOnFocusable": "off",
|
|
59
|
-
"noLabelWithoutControl": "off",
|
|
60
|
-
"useFocusableInteractive": "off",
|
|
61
|
-
"useKeyWithClickEvents": "off",
|
|
62
|
-
"useSemanticElements": "off"
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
"css": {
|
|
67
|
-
"formatter": {
|
|
68
|
-
"quoteStyle": "single"
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
"overrides": [
|
|
72
|
-
{
|
|
73
|
-
"include": ["**/*.test.ts", "**/*.test.tsx", "tests/**/*", "scripts/**/*", ".dumi/**/*"],
|
|
74
|
-
"linter": {
|
|
75
|
-
"rules": {
|
|
76
|
-
"style": {
|
|
77
|
-
"noParameterAssign": "off"
|
|
78
|
-
},
|
|
79
|
-
"suspicious": {
|
|
80
|
-
"noThenProperty": "off",
|
|
81
|
-
"noImplicitAnyLet": "off"
|
|
82
|
-
},
|
|
83
|
-
"complexity": {
|
|
84
|
-
"noUselessFragments": "off"
|
|
85
|
-
},
|
|
86
|
-
"a11y": {
|
|
87
|
-
"useValidAnchor": "off",
|
|
88
|
-
"useAnchorContent": "off",
|
|
89
|
-
"useKeyWithClickEvents": "off"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
"include": ["components/*/demo/*"],
|
|
96
|
-
"linter": {
|
|
97
|
-
"rules": {
|
|
98
|
-
"correctness": {
|
|
99
|
-
"noVoidTypeReturn": "off"
|
|
100
|
-
},
|
|
101
|
-
"a11y": {
|
|
102
|
-
"useValidAnchor": "off",
|
|
103
|
-
"useAnchorContent": "off",
|
|
104
|
-
"useKeyWithClickEvents": "off"
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
]
|
|
110
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-vue",
|
|
3
|
-
"version": "1.0.0",
|
|
4
|
-
"private": true,
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rsbuild build",
|
|
8
|
-
"check": "biome check --write",
|
|
9
|
-
"dev": "rsbuild dev --open",
|
|
10
|
-
"format": "prettier --write .",
|
|
11
|
-
"preview": "rsbuild preview"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"ant-design-vue": "^4.2.6",
|
|
15
|
-
"pinia": "^3.0.1",
|
|
16
|
-
"vue": "^3.5.13",
|
|
17
|
-
"vue-router": "^4.5.0"
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@biomejs/biome": "^1.9.4",
|
|
21
|
-
"@ianvs/prettier-plugin-sort-imports": "^4.4.1",
|
|
22
|
-
"@rsbuild/core": "^1.3.1",
|
|
23
|
-
"@rsbuild/plugin-vue": "^1.0.7",
|
|
24
|
-
"@unocss/postcss": "^65.5.0",
|
|
25
|
-
"lefthook": "^1.11.6",
|
|
26
|
-
"prettier": "^3.5.3",
|
|
27
|
-
"typescript": "^5.8.2",
|
|
28
|
-
"unocss": "^65.5.0",
|
|
29
|
-
"unplugin-auto-import": "^19.1.2"
|
|
30
|
-
}
|
|
31
|
-
}
|
|
File without changes
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from '@rsbuild/core'
|
|
2
|
-
import { pluginVue } from '@rsbuild/plugin-vue'
|
|
3
|
-
import AutoImport from 'unplugin-auto-import/rspack'
|
|
4
|
-
|
|
5
|
-
export default defineConfig({
|
|
6
|
-
html: {
|
|
7
|
-
template: './index.html',
|
|
8
|
-
},
|
|
9
|
-
resolve: {
|
|
10
|
-
alias: {
|
|
11
|
-
'@': './src',
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
server: {
|
|
15
|
-
port: process.env.PUBLIC_PORT,
|
|
16
|
-
},
|
|
17
|
-
plugins: [pluginVue()],
|
|
18
|
-
tools: {
|
|
19
|
-
rspack: {
|
|
20
|
-
plugins: [
|
|
21
|
-
AutoImport({
|
|
22
|
-
imports: ['vue', 'vue-router'],
|
|
23
|
-
dts: './src/types/auto-import.d.ts',
|
|
24
|
-
}),
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
})
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="content">
|
|
3
|
-
<h1 class="text-#fff">Rsbuild with Vue</h1>
|
|
4
|
-
<p class="text-50px text-amber">Start building amazing things with Rsbuild.</p>
|
|
5
|
-
</div>
|
|
6
|
-
</template>
|
|
7
|
-
|
|
8
|
-
<style scoped>
|
|
9
|
-
.content {
|
|
10
|
-
display: flex;
|
|
11
|
-
min-height: 100vh;
|
|
12
|
-
line-height: 1.1;
|
|
13
|
-
text-align: center;
|
|
14
|
-
flex-direction: column;
|
|
15
|
-
justify-content: center;
|
|
16
|
-
background-color: #000;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
.content h1 {
|
|
20
|
-
font-size: 3.6rem;
|
|
21
|
-
font-weight: 700;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
.content p {
|
|
25
|
-
font-size: 1.2rem;
|
|
26
|
-
font-weight: 400;
|
|
27
|
-
opacity: 0.5;
|
|
28
|
-
}
|
|
29
|
-
</style>
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/// <reference types="@rsbuild/core/types" />
|
|
2
|
-
|
|
3
|
-
declare module '*.vue' {
|
|
4
|
-
import type { DefineComponent } from 'vue'
|
|
5
|
-
|
|
6
|
-
// biome-ignore lint/complexity/noBannedTypes: reason
|
|
7
|
-
const component: DefineComponent<{}, {}, any>
|
|
8
|
-
export default component
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
interface ImportMetaEnv {
|
|
12
|
-
readonly PUBLIC_PATH: string
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
interface ImportMeta {
|
|
16
|
-
readonly env: ImportMetaEnv
|
|
17
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { createApp } from 'vue'
|
|
2
|
-
|
|
3
|
-
import App from './App.vue'
|
|
4
|
-
|
|
5
|
-
import '@/styles/index.css'
|
|
6
|
-
|
|
7
|
-
import { setupRouter } from './router'
|
|
8
|
-
import { setupStore } from './store'
|
|
9
|
-
|
|
10
|
-
const app = createApp(App)
|
|
11
|
-
|
|
12
|
-
setupRouter(app)
|
|
13
|
-
setupStore(app)
|
|
14
|
-
|
|
15
|
-
app.mount('#root')
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createRouter, createWebHistory } from 'vue-router'
|
|
2
|
-
import { routes } from './modules'
|
|
3
|
-
import type { App } from 'vue'
|
|
4
|
-
|
|
5
|
-
export const router = createRouter({
|
|
6
|
-
history: createWebHistory(import.meta.env.PUBLIC_PATH),
|
|
7
|
-
routes: routes,
|
|
8
|
-
strict: true,
|
|
9
|
-
scrollBehavior: () => ({ left: 0, top: 0 }),
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
export const setupRouter = (app: App) => {
|
|
13
|
-
app.use(router)
|
|
14
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { defineStore } from 'pinia'
|
|
2
|
-
import { store } from '..'
|
|
3
|
-
|
|
4
|
-
export const useUserStore = defineStore('user', {
|
|
5
|
-
state: () => {
|
|
6
|
-
return {
|
|
7
|
-
name: 'admin',
|
|
8
|
-
token: 'admin',
|
|
9
|
-
avatar: 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif',
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
export function useUserStoreWithOut() {
|
|
15
|
-
return useUserStore(store)
|
|
16
|
-
}
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
/* prettier-ignore */
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
// noinspection JSUnusedGlobalSymbols
|
|
5
|
-
// Generated by unplugin-auto-import
|
|
6
|
-
// biome-ignore lint: disable
|
|
7
|
-
export {}
|
|
8
|
-
declare global {
|
|
9
|
-
const EffectScope: typeof import('vue')['EffectScope']
|
|
10
|
-
const computed: typeof import('vue')['computed']
|
|
11
|
-
const createApp: typeof import('vue')['createApp']
|
|
12
|
-
const customRef: typeof import('vue')['customRef']
|
|
13
|
-
const defineAsyncComponent: typeof import('vue')['defineAsyncComponent']
|
|
14
|
-
const defineComponent: typeof import('vue')['defineComponent']
|
|
15
|
-
const effectScope: typeof import('vue')['effectScope']
|
|
16
|
-
const getCurrentInstance: typeof import('vue')['getCurrentInstance']
|
|
17
|
-
const getCurrentScope: typeof import('vue')['getCurrentScope']
|
|
18
|
-
const h: typeof import('vue')['h']
|
|
19
|
-
const inject: typeof import('vue')['inject']
|
|
20
|
-
const isProxy: typeof import('vue')['isProxy']
|
|
21
|
-
const isReactive: typeof import('vue')['isReactive']
|
|
22
|
-
const isReadonly: typeof import('vue')['isReadonly']
|
|
23
|
-
const isRef: typeof import('vue')['isRef']
|
|
24
|
-
const markRaw: typeof import('vue')['markRaw']
|
|
25
|
-
const nextTick: typeof import('vue')['nextTick']
|
|
26
|
-
const onActivated: typeof import('vue')['onActivated']
|
|
27
|
-
const onBeforeMount: typeof import('vue')['onBeforeMount']
|
|
28
|
-
const onBeforeRouteLeave: typeof import('vue-router')['onBeforeRouteLeave']
|
|
29
|
-
const onBeforeRouteUpdate: typeof import('vue-router')['onBeforeRouteUpdate']
|
|
30
|
-
const onBeforeUnmount: typeof import('vue')['onBeforeUnmount']
|
|
31
|
-
const onBeforeUpdate: typeof import('vue')['onBeforeUpdate']
|
|
32
|
-
const onDeactivated: typeof import('vue')['onDeactivated']
|
|
33
|
-
const onErrorCaptured: typeof import('vue')['onErrorCaptured']
|
|
34
|
-
const onMounted: typeof import('vue')['onMounted']
|
|
35
|
-
const onRenderTracked: typeof import('vue')['onRenderTracked']
|
|
36
|
-
const onRenderTriggered: typeof import('vue')['onRenderTriggered']
|
|
37
|
-
const onScopeDispose: typeof import('vue')['onScopeDispose']
|
|
38
|
-
const onServerPrefetch: typeof import('vue')['onServerPrefetch']
|
|
39
|
-
const onUnmounted: typeof import('vue')['onUnmounted']
|
|
40
|
-
const onUpdated: typeof import('vue')['onUpdated']
|
|
41
|
-
const onWatcherCleanup: typeof import('vue')['onWatcherCleanup']
|
|
42
|
-
const provide: typeof import('vue')['provide']
|
|
43
|
-
const reactive: typeof import('vue')['reactive']
|
|
44
|
-
const readonly: typeof import('vue')['readonly']
|
|
45
|
-
const ref: typeof import('vue')['ref']
|
|
46
|
-
const resolveComponent: typeof import('vue')['resolveComponent']
|
|
47
|
-
const shallowReactive: typeof import('vue')['shallowReactive']
|
|
48
|
-
const shallowReadonly: typeof import('vue')['shallowReadonly']
|
|
49
|
-
const shallowRef: typeof import('vue')['shallowRef']
|
|
50
|
-
const toRaw: typeof import('vue')['toRaw']
|
|
51
|
-
const toRef: typeof import('vue')['toRef']
|
|
52
|
-
const toRefs: typeof import('vue')['toRefs']
|
|
53
|
-
const toValue: typeof import('vue')['toValue']
|
|
54
|
-
const triggerRef: typeof import('vue')['triggerRef']
|
|
55
|
-
const unref: typeof import('vue')['unref']
|
|
56
|
-
const useAttrs: typeof import('vue')['useAttrs']
|
|
57
|
-
const useCssModule: typeof import('vue')['useCssModule']
|
|
58
|
-
const useCssVars: typeof import('vue')['useCssVars']
|
|
59
|
-
const useId: typeof import('vue')['useId']
|
|
60
|
-
const useLink: typeof import('vue-router')['useLink']
|
|
61
|
-
const useModel: typeof import('vue')['useModel']
|
|
62
|
-
const useRoute: typeof import('vue-router')['useRoute']
|
|
63
|
-
const useRouter: typeof import('vue-router')['useRouter']
|
|
64
|
-
const useSlots: typeof import('vue')['useSlots']
|
|
65
|
-
const useTemplateRef: typeof import('vue')['useTemplateRef']
|
|
66
|
-
const watch: typeof import('vue')['watch']
|
|
67
|
-
const watchEffect: typeof import('vue')['watchEffect']
|
|
68
|
-
const watchPostEffect: typeof import('vue')['watchPostEffect']
|
|
69
|
-
const watchSyncEffect: typeof import('vue')['watchSyncEffect']
|
|
70
|
-
}
|
|
71
|
-
// for type re-export
|
|
72
|
-
declare global {
|
|
73
|
-
// @ts-ignore
|
|
74
|
-
export type {
|
|
75
|
-
Component,
|
|
76
|
-
ComponentPublicInstance,
|
|
77
|
-
ComputedRef,
|
|
78
|
-
DirectiveBinding,
|
|
79
|
-
ExtractDefaultPropTypes,
|
|
80
|
-
ExtractPropTypes,
|
|
81
|
-
ExtractPublicPropTypes,
|
|
82
|
-
InjectionKey,
|
|
83
|
-
PropType,
|
|
84
|
-
Ref,
|
|
85
|
-
MaybeRef,
|
|
86
|
-
MaybeRefOrGetter,
|
|
87
|
-
VNode,
|
|
88
|
-
WritableComputedRef,
|
|
89
|
-
} from 'vue'
|
|
90
|
-
import('vue')
|
|
91
|
-
}
|
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { message } from 'ant-design-vue'
|
|
2
|
-
import axios, { type AxiosResponse } from 'axios'
|
|
3
|
-
|
|
4
|
-
import { router } from '@/router'
|
|
5
|
-
import { useUserStore } from '@/store/modules/user'
|
|
6
|
-
|
|
7
|
-
export interface CustomConfig {
|
|
8
|
-
/** 直接返回响应体 */
|
|
9
|
-
isTransformResponse?: boolean
|
|
10
|
-
// 成功需要提示
|
|
11
|
-
isShowSuccessMsg?: boolean
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export enum CodeEnum {
|
|
15
|
-
SUCCESS = 200,
|
|
16
|
-
UNAUTHORIZED = 401,
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
const unAuthFunc = () => {
|
|
20
|
-
message.error('暂未登录或登录已过期,请重新登录')
|
|
21
|
-
router.navigate('/login')
|
|
22
|
-
}
|
|
23
|
-
export default (customConfig?: CustomConfig) => {
|
|
24
|
-
const userStore = useUserStore()
|
|
25
|
-
const token = userStore.token
|
|
26
|
-
|
|
27
|
-
const instance = axios.create({
|
|
28
|
-
baseURL: import.meta.env.PUBLIC_API_AFFIX,
|
|
29
|
-
})
|
|
30
|
-
|
|
31
|
-
instance.interceptors.request.use(
|
|
32
|
-
(config) => {
|
|
33
|
-
config.headers.set('X-Access-Token', token)
|
|
34
|
-
config.headers.set('Allow-Control-Allow-Origin', '*')
|
|
35
|
-
return config
|
|
36
|
-
},
|
|
37
|
-
(error) => {
|
|
38
|
-
message.error('请求错误')
|
|
39
|
-
return Promise.reject(error)
|
|
40
|
-
},
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
interface ResponseData<T = any> {
|
|
44
|
-
code: number
|
|
45
|
-
message: string
|
|
46
|
-
requestId: string
|
|
47
|
-
responseTime: number
|
|
48
|
-
result: T
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
instance.interceptors.response.use(
|
|
52
|
-
(response: AxiosResponse<ResponseData>) => {
|
|
53
|
-
const { status, data } = response
|
|
54
|
-
if (status === 200) {
|
|
55
|
-
if (customConfig?.isTransformResponse === false) return data
|
|
56
|
-
const { code, message: msg } = data
|
|
57
|
-
if (code === CodeEnum.SUCCESS) {
|
|
58
|
-
if (customConfig?.isShowSuccessMsg) {
|
|
59
|
-
message.success(msg)
|
|
60
|
-
}
|
|
61
|
-
return data.result
|
|
62
|
-
}
|
|
63
|
-
message.error(msg)
|
|
64
|
-
return Promise.reject(data)
|
|
65
|
-
}
|
|
66
|
-
if (status === CodeEnum.UNAUTHORIZED) {
|
|
67
|
-
unAuthFunc()
|
|
68
|
-
} else return Promise.reject(data.message)
|
|
69
|
-
},
|
|
70
|
-
(error) => {
|
|
71
|
-
const response = error.response
|
|
72
|
-
const { status, data } = response
|
|
73
|
-
if (status === CodeEnum.UNAUTHORIZED) {
|
|
74
|
-
unAuthFunc()
|
|
75
|
-
} else {
|
|
76
|
-
message.error(data?.message || '系统异常')
|
|
77
|
-
return Promise.reject(error)
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
return instance
|
|
83
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import type { AxiosRequestConfig } from 'axios'
|
|
2
|
-
|
|
3
|
-
import request, { type CustomConfig } from './axios'
|
|
4
|
-
|
|
5
|
-
interface createAxiosType {
|
|
6
|
-
get: <T = any>(
|
|
7
|
-
config: {
|
|
8
|
-
url: string
|
|
9
|
-
params?: AxiosRequestConfig['params']
|
|
10
|
-
config?: AxiosRequestConfig<any>
|
|
11
|
-
},
|
|
12
|
-
option?: CustomConfig,
|
|
13
|
-
) => Promise<T>
|
|
14
|
-
post: <T = any>(
|
|
15
|
-
config: {
|
|
16
|
-
url: string
|
|
17
|
-
data?: AxiosRequestConfig['data']
|
|
18
|
-
params?: AxiosRequestConfig['params']
|
|
19
|
-
config?: AxiosRequestConfig<any>
|
|
20
|
-
},
|
|
21
|
-
option?: CustomConfig,
|
|
22
|
-
) => Promise<T>
|
|
23
|
-
put: <T = any>(
|
|
24
|
-
config: {
|
|
25
|
-
url: string
|
|
26
|
-
data?: AxiosRequestConfig['data']
|
|
27
|
-
config?: AxiosRequestConfig<any>
|
|
28
|
-
},
|
|
29
|
-
option?: CustomConfig,
|
|
30
|
-
) => Promise<T>
|
|
31
|
-
delete: <T = any>(
|
|
32
|
-
config: {
|
|
33
|
-
url: string
|
|
34
|
-
data?: AxiosRequestConfig['data']
|
|
35
|
-
config?: AxiosRequestConfig<any>
|
|
36
|
-
},
|
|
37
|
-
option?: CustomConfig,
|
|
38
|
-
) => Promise<T>
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const createAxios: createAxiosType = {
|
|
42
|
-
get: (config, option) =>
|
|
43
|
-
request(option).get(config.url, {
|
|
44
|
-
params: config.params,
|
|
45
|
-
...config?.config,
|
|
46
|
-
}),
|
|
47
|
-
post: (
|
|
48
|
-
config: {
|
|
49
|
-
url: string
|
|
50
|
-
params?: Record<string, string>
|
|
51
|
-
data?: any
|
|
52
|
-
config?: AxiosRequestConfig<any>
|
|
53
|
-
},
|
|
54
|
-
option?: CustomConfig,
|
|
55
|
-
) => {
|
|
56
|
-
let url = config.url
|
|
57
|
-
if (config.params instanceof Object) {
|
|
58
|
-
url += '?'
|
|
59
|
-
const entries = Object.entries(config.params)
|
|
60
|
-
for (let i = 0; i < entries.length; i++) {
|
|
61
|
-
const [key, value] = entries[i]
|
|
62
|
-
url += `${key}=${value}${i < entries.length - 1 ? '&' : ''}`
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
return request(option).post(url, config?.data, config?.config)
|
|
66
|
-
},
|
|
67
|
-
put: (
|
|
68
|
-
config: { url: string; data?: any; config?: AxiosRequestConfig<any> },
|
|
69
|
-
option?: CustomConfig,
|
|
70
|
-
) => request(option).put(config.url, config?.data, config?.config),
|
|
71
|
-
delete: (
|
|
72
|
-
config: { url: string; config?: AxiosRequestConfig<any> },
|
|
73
|
-
customConfig?: CustomConfig,
|
|
74
|
-
) => request(customConfig).delete(config.url, config?.config),
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
export default createAxios
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"lib": ["DOM", "ES2020"],
|
|
4
|
-
"jsx": "preserve",
|
|
5
|
-
"target": "ES2020",
|
|
6
|
-
"noEmit": true,
|
|
7
|
-
"skipLibCheck": true,
|
|
8
|
-
"jsxImportSource": "vue",
|
|
9
|
-
"useDefineForClassFields": true,
|
|
10
|
-
|
|
11
|
-
/* modules */
|
|
12
|
-
"module": "ESNext",
|
|
13
|
-
"isolatedModules": true,
|
|
14
|
-
"resolveJsonModule": true,
|
|
15
|
-
"moduleResolution": "Bundler",
|
|
16
|
-
"allowImportingTsExtensions": true,
|
|
17
|
-
|
|
18
|
-
/* type checking */
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUnusedLocals": true,
|
|
21
|
-
"noUnusedParameters": true,
|
|
22
|
-
|
|
23
|
-
"baseUrl": ".",
|
|
24
|
-
"paths": {
|
|
25
|
-
"@": ["src"]
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"include": ["src"]
|
|
29
|
-
}
|