create-bubbles 0.1.10 → 0.1.12
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/dist/index.js +2 -1
- package/package.json +1 -1
- package/template-nextjs-vinext-eslint/src/app/layout.tsx +4 -7
- package/template-nextjs-vinext-eslint/src/app/uno-css.tsx +7 -0
- package/template-nextjs-vinext-eslint/uno.config.ts +4 -6
- package/template-vp-monorepo-react-nestjs/.oxfmtrc.jsonc +8 -0
- package/template-vp-monorepo-react-nestjs/.oxlintrc.jsonc +3 -0
- package/template-vp-monorepo-react-nestjs/.specs//351/234/200/346/261/202.md +5 -0
- package/template-vp-monorepo-react-nestjs/.vite-hooks/commit-msg +1 -0
- package/template-vp-monorepo-react-nestjs/.vite-hooks/pre-commit +1 -0
- package/template-vp-monorepo-react-nestjs/.vscode/extensions.json +3 -0
- package/template-vp-monorepo-react-nestjs/README.md +29 -0
- package/template-vp-monorepo-react-nestjs/apps/service/.oxlintrc.jsonc +3 -0
- package/template-vp-monorepo-react-nestjs/apps/web/.env +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/.oxlintrc.jsonc +4 -0
- package/{template-vue-vite-biome → template-vp-monorepo-react-nestjs/apps/web}/index.html +4 -4
- package/template-vp-monorepo-react-nestjs/apps/web/package.json +39 -0
- package/template-vp-monorepo-react-nestjs/apps/web/public/favicon.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/public/icons.svg +24 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/App.tsx +24 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/hero.png +0 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/react.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/assets/vite.svg +1 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/main.tsx +5 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/pages/home/index.tsx +17 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/router/index.tsx +25 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/styles/index.css +7 -0
- package/template-vp-monorepo-react-nestjs/apps/web/src/types/auto-imports.d.ts +58 -0
- package/{template-vue-vite-biome → template-vp-monorepo-react-nestjs/apps/web}/tsconfig.json +5 -9
- package/template-vp-monorepo-react-nestjs/apps/web/vite.config.ts +32 -0
- package/template-vp-monorepo-react-nestjs/commitlint.config.js +0 -0
- package/template-vp-monorepo-react-nestjs/package.json +20 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/README.md +23 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/package.json +39 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/src/index.ts +3 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tests/index.test.ts +6 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tsconfig.json +20 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/tsdown.config.ts +9 -0
- package/template-vp-monorepo-react-nestjs/packages/utils/vite.config.ts +7 -0
- package/template-vp-monorepo-react-nestjs/pnpm-workspace.yaml +23 -0
- package/template-vp-monorepo-react-nestjs/tsconfig.json +9 -0
- package/template-vp-monorepo-react-nestjs/vite.config.ts +8 -0
- package/template-vp-react/.env +1 -0
- package/template-vp-react/.oxfmtrc.jsonc +8 -0
- package/template-vp-react/.oxlintrc.jsonc +11 -0
- package/template-vp-react/.vite-hooks/commit-msg +1 -0
- package/template-vp-react/.vite-hooks/pre-commit +1 -0
- package/template-vp-react/.vscode/extensions.json +3 -0
- package/template-vp-react/commitlint.config.js +0 -0
- package/template-vp-react/index.html +13 -0
- package/template-vp-react/package.json +41 -0
- package/template-vp-react/public/favicon.svg +1 -0
- package/template-vp-react/public/icons.svg +24 -0
- package/template-vp-react/src/App.tsx +24 -0
- package/template-vp-react/src/assets/hero.png +0 -0
- package/template-vp-react/src/assets/react.svg +1 -0
- package/template-vp-react/src/assets/vite.svg +1 -0
- package/template-vp-react/src/components/Loading/PageLoading.tsx +11 -0
- package/template-vp-react/src/main.tsx +5 -0
- package/template-vp-react/src/pages/home/index.tsx +17 -0
- package/template-vp-react/src/router/index.tsx +25 -0
- package/template-vp-react/src/styles/index.css +7 -0
- package/template-vp-react/src/types/auto-imports.d.ts +58 -0
- package/template-vp-react/tsconfig.json +32 -0
- package/template-vp-react/vite.config.ts +35 -0
- package/template-vue-vite-eslint/package.json +29 -33
- package/template-vue-vite-eslint/src/main.ts +0 -1
- package/template-vue-vite-eslint/src/styles/index.scss +0 -3
- package/template-vue-vite-eslint/src/types/components.d.ts +0 -4
- package/template-vue-vite-eslint/src/utils/request/index.ts +4 -4
- package/template-vue-vite-eslint/vite.config.ts +2 -4
- package/template-vue-rsbuild-biome/.env +0 -5
- package/template-vue-rsbuild-biome/.env.development +0 -1
- package/template-vue-rsbuild-biome/.env.production +0 -1
- package/template-vue-rsbuild-biome/.prettierignore +0 -4
- package/template-vue-rsbuild-biome/.prettierrc +0 -18
- package/template-vue-rsbuild-biome/.vscode/settings.json +0 -13
- package/template-vue-rsbuild-biome/README.md +0 -29
- package/template-vue-rsbuild-biome/biome.json +0 -109
- package/template-vue-rsbuild-biome/index.html +0 -7
- package/template-vue-rsbuild-biome/lefthook.yml +0 -11
- package/template-vue-rsbuild-biome/package.json +0 -36
- package/template-vue-rsbuild-biome/rsbuild.config.ts +0 -41
- package/template-vue-rsbuild-biome/src/App.vue +0 -3
- package/template-vue-rsbuild-biome/src/index.ts +0 -13
- package/template-vue-rsbuild-biome/src/router/guard/index.tsx +0 -6
- package/template-vue-rsbuild-biome/src/router/guard/permissionGuard.ts +0 -8
- package/template-vue-rsbuild-biome/src/router/index.tsx +0 -14
- package/template-vue-rsbuild-biome/src/router/modules/index.tsx +0 -10
- package/template-vue-rsbuild-biome/src/store/index.ts +0 -7
- package/template-vue-rsbuild-biome/src/store/modules/user.ts +0 -17
- package/template-vue-rsbuild-biome/src/styles/index.css +0 -16
- package/template-vue-rsbuild-biome/src/types/auto-import.d.ts +0 -78
- package/template-vue-rsbuild-biome/src/types/components.d.ts +0 -15
- package/template-vue-rsbuild-biome/src/types/env.d.ts +0 -17
- package/template-vue-rsbuild-biome/src/utils/env.ts +0 -10
- package/template-vue-rsbuild-biome/src/utils/request/core/index.ts +0 -166
- package/template-vue-rsbuild-biome/src/utils/request/core/utils.ts +0 -38
- package/template-vue-rsbuild-biome/src/utils/request/index.ts +0 -39
- package/template-vue-rsbuild-biome/src/views/home/index.vue +0 -14
- package/template-vue-rsbuild-biome/tsconfig.json +0 -29
- package/template-vue-rsbuild-biome/uno.config.ts +0 -9
- package/template-vue-vite-biome/.env +0 -4
- package/template-vue-vite-biome/.env.development +0 -1
- package/template-vue-vite-biome/.env.production +0 -1
- package/template-vue-vite-biome/.gitlab-ci.yml +0 -84
- package/template-vue-vite-biome/.vscode/settings.json +0 -10
- package/template-vue-vite-biome/README.md +0 -3
- package/template-vue-vite-biome/biome.json +0 -109
- package/template-vue-vite-biome/commitlint.config.js +0 -1
- package/template-vue-vite-biome/lefthook.yml +0 -11
- package/template-vue-vite-biome/package.json +0 -50
- package/template-vue-vite-biome/public/vite.svg +0 -1
- package/template-vue-vite-biome/src/App.vue +0 -19
- package/template-vue-vite-biome/src/assets/icon/vue.svg +0 -1
- package/template-vue-vite-biome/src/components/Icon/svg-icon.vue +0 -29
- package/template-vue-vite-biome/src/layout/default/index.vue +0 -3
- package/template-vue-vite-biome/src/main.ts +0 -15
- package/template-vue-vite-biome/src/router/guard/index.ts +0 -7
- package/template-vue-vite-biome/src/router/guard/permissionGuard.ts +0 -13
- package/template-vue-vite-biome/src/router/index.ts +0 -17
- package/template-vue-vite-biome/src/router/modules/index.ts +0 -31
- package/template-vue-vite-biome/src/store/index.ts +0 -10
- package/template-vue-vite-biome/src/store/modules/user.ts +0 -17
- package/template-vue-vite-biome/src/styles/element-plus-variables.css +0 -4
- package/template-vue-vite-biome/src/styles/index.scss +0 -31
- package/template-vue-vite-biome/src/styles/variables.scss +0 -3
- package/template-vue-vite-biome/src/types/vite-env.d.ts +0 -13
- package/template-vue-vite-biome/src/utils/env.ts +0 -10
- package/template-vue-vite-biome/src/utils/request/core/index.ts +0 -166
- package/template-vue-vite-biome/src/utils/request/core/utils.ts +0 -38
- package/template-vue-vite-biome/src/utils/request/index.ts +0 -39
- package/template-vue-vite-biome/src/views/home/index.vue +0 -16
- package/template-vue-vite-biome/src/views/login/index.vue +0 -11
- package/template-vue-vite-biome/src/views/model/index.vue +0 -7
- package/template-vue-vite-biome/uno.config.ts +0 -10
- package/template-vue-vite-biome/vite.config.ts +0 -51
- package/template-vue-vite-eslint/.vscode/settings.json +0 -62
- package/template-vue-vite-eslint/src/styles/element-plus-variables.css +0 -3
- package/template-vue-vite-eslint/src/styles/plus-pro-components-variables.css +0 -3
- package/template-vue-vite-eslint/src/types/index.d.ts +0 -1
- /package/{template-vue-rsbuild-biome/public → template-vp-monorepo-react-nestjs/apps/web/src/router/modules}/.gitkeep +0 -0
- /package/{template-vue-vite-biome/src/styles/font.scss → template-vp-react/src/router/modules/.gitkeep} +0 -0
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
// Generated by unplugin-vue-components
|
|
4
|
-
// Read more: https://github.com/vuejs/core/pull/3399
|
|
5
|
-
// biome-ignore lint: disable
|
|
6
|
-
export {}
|
|
7
|
-
|
|
8
|
-
/* prettier-ignore */
|
|
9
|
-
declare module 'vue' {
|
|
10
|
-
export interface GlobalComponents {
|
|
11
|
-
ElButton: typeof import('element-plus/es')['ElButton']
|
|
12
|
-
RouterLink: typeof import('vue-router')['RouterLink']
|
|
13
|
-
RouterView: typeof import('vue-router')['RouterView']
|
|
14
|
-
}
|
|
15
|
-
}
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 通过一个文件导出所有的环境变量这样方便统一修改
|
|
3
|
-
* @returns
|
|
4
|
-
*/
|
|
5
|
-
export const envVariables = {
|
|
6
|
-
PUBLIC_PORT: import.meta.env.PUBLIC_PORT,
|
|
7
|
-
PUBLIC_PATH: import.meta.env.PUBLIC_PATH,
|
|
8
|
-
PUBLIC_APP_NAME: import.meta.env.PUBLIC_APP_NAME,
|
|
9
|
-
PUBLIC_API_AFFIX: import.meta.env.PUBLIC_API_AFFIX,
|
|
10
|
-
}
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import { type AlovaGenerics, type AlovaOptions, createAlova } from 'alova'
|
|
2
|
-
import { deepMergeObject, isReadableStream } from './utils'
|
|
3
|
-
import adapterFetch from 'alova/fetch'
|
|
4
|
-
|
|
5
|
-
interface statusMap {
|
|
6
|
-
success?: number
|
|
7
|
-
unAuthorized?: number
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
interface codeMap {
|
|
11
|
-
success?: number[]
|
|
12
|
-
unAuthorized?: number[]
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export interface baseRequestOption<AG extends AlovaGenerics> {
|
|
16
|
-
baseUrl?: string
|
|
17
|
-
timeout?: number
|
|
18
|
-
commonHeaders?: Record<string, string | (() => string)>
|
|
19
|
-
statusMap?: statusMap
|
|
20
|
-
codeMap?: codeMap
|
|
21
|
-
responseDataKey?: string
|
|
22
|
-
responseMessageKey?: string
|
|
23
|
-
isTransformResponse?: boolean
|
|
24
|
-
isShowSuccessMessage?: boolean
|
|
25
|
-
successDefaultMessage?: string
|
|
26
|
-
isShowErrorMessage?: boolean
|
|
27
|
-
errorDefaultMessage?: string
|
|
28
|
-
statesHook?: AlovaOptions<AG>['statesHook']
|
|
29
|
-
successMessageFunc?: (message: string) => void
|
|
30
|
-
errorMessageFunc?: (message: string) => void
|
|
31
|
-
unAuthorizedResponseFunc?: () => void
|
|
32
|
-
requestAdapter?: AlovaOptions<AG>['requestAdapter']
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export interface CustomConfig {
|
|
36
|
-
isTransformResponse?: boolean
|
|
37
|
-
isShowSuccessMessage?: boolean
|
|
38
|
-
isShowErrorMessage?: boolean
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
type requestOption = baseRequestOption<AlovaGenerics> & CustomConfig
|
|
42
|
-
|
|
43
|
-
export const createInstance = (option: requestOption) => {
|
|
44
|
-
const defaultOption: requestOption = {
|
|
45
|
-
baseUrl: '/',
|
|
46
|
-
timeout: 0,
|
|
47
|
-
statusMap: {
|
|
48
|
-
success: 200,
|
|
49
|
-
unAuthorized: 401,
|
|
50
|
-
},
|
|
51
|
-
codeMap: {
|
|
52
|
-
success: [200],
|
|
53
|
-
unAuthorized: [401],
|
|
54
|
-
},
|
|
55
|
-
responseDataKey: 'data',
|
|
56
|
-
responseMessageKey: 'message',
|
|
57
|
-
isTransformResponse: true,
|
|
58
|
-
isShowSuccessMessage: false,
|
|
59
|
-
successDefaultMessage: '操作成功',
|
|
60
|
-
isShowErrorMessage: true,
|
|
61
|
-
errorDefaultMessage: '服务异常',
|
|
62
|
-
requestAdapter: adapterFetch(),
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const mergeOption: baseRequestOption<AlovaGenerics> & CustomConfig = deepMergeObject(
|
|
66
|
-
defaultOption,
|
|
67
|
-
option,
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
const instance = createAlova({
|
|
71
|
-
baseURL: mergeOption.baseUrl,
|
|
72
|
-
timeout: mergeOption.timeout,
|
|
73
|
-
statesHook: mergeOption?.statesHook,
|
|
74
|
-
requestAdapter: mergeOption.requestAdapter as AlovaOptions<AlovaGenerics>['requestAdapter'],
|
|
75
|
-
beforeRequest: async (method) => {
|
|
76
|
-
for (const [key, value] of Object.entries(option?.commonHeaders ?? {})) {
|
|
77
|
-
method.config.headers[key] = typeof value === 'function' ? value() : value
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
responded: {
|
|
81
|
-
onSuccess: async (response) => {
|
|
82
|
-
if (!mergeOption?.isTransformResponse) return response
|
|
83
|
-
const { status } = response
|
|
84
|
-
|
|
85
|
-
// 判断响应类型:如果使用 adapterFetch,response.data 是可读流,则调用 json();否则直接使用 response.data
|
|
86
|
-
const data =
|
|
87
|
-
response?.body && isReadableStream(response.body)
|
|
88
|
-
? await response.json() // adapterFetch 的响应,使用 json() 解析可读流
|
|
89
|
-
: response.data // 其他适配器的响应
|
|
90
|
-
// 不成功的情况
|
|
91
|
-
if (status !== mergeOption.statusMap?.success) {
|
|
92
|
-
// 如果后端使用status 字段来表示未授权,则返回401
|
|
93
|
-
if (mergeOption?.statusMap?.unAuthorized === status) {
|
|
94
|
-
mergeOption?.unAuthorizedResponseFunc?.()
|
|
95
|
-
}
|
|
96
|
-
return Promise.reject(response)
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const {
|
|
100
|
-
responseDataKey,
|
|
101
|
-
codeMap,
|
|
102
|
-
isShowSuccessMessage,
|
|
103
|
-
responseMessageKey,
|
|
104
|
-
isShowErrorMessage,
|
|
105
|
-
} = mergeOption
|
|
106
|
-
const {
|
|
107
|
-
code,
|
|
108
|
-
[responseDataKey as string]: responseData,
|
|
109
|
-
[responseMessageKey as string]: responseMessage,
|
|
110
|
-
} = data
|
|
111
|
-
if (!codeMap?.success?.includes(+code)) {
|
|
112
|
-
// code unAuthorized 处理
|
|
113
|
-
if (codeMap?.unAuthorized?.includes(+code)) {
|
|
114
|
-
mergeOption?.unAuthorizedResponseFunc?.()
|
|
115
|
-
return Promise.reject(response)
|
|
116
|
-
}
|
|
117
|
-
// 其他错误直接打印msg
|
|
118
|
-
|
|
119
|
-
const errorMessage = data[responseMessageKey as string] ?? mergeOption.errorDefaultMessage
|
|
120
|
-
if (isShowErrorMessage) mergeOption?.errorMessageFunc?.(errorMessage)
|
|
121
|
-
return Promise.reject(response)
|
|
122
|
-
}
|
|
123
|
-
if (isShowSuccessMessage)
|
|
124
|
-
mergeOption?.successMessageFunc?.(responseMessage ?? mergeOption.successDefaultMessage)
|
|
125
|
-
return responseData
|
|
126
|
-
},
|
|
127
|
-
onError: (error) => {
|
|
128
|
-
if (mergeOption?.isShowErrorMessage)
|
|
129
|
-
mergeOption.errorMessageFunc?.(
|
|
130
|
-
error.response?.data?.message ?? mergeOption?.errorDefaultMessage,
|
|
131
|
-
)
|
|
132
|
-
},
|
|
133
|
-
// onComplete: (_method) => {},
|
|
134
|
-
},
|
|
135
|
-
})
|
|
136
|
-
|
|
137
|
-
return instance
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
// 🚀 创建双重调用实例的工厂函数
|
|
141
|
-
export const createDualCallInstance = (baseConfig: baseRequestOption<AlovaGenerics>) => {
|
|
142
|
-
// 创建默认实例
|
|
143
|
-
const defaultInstance = createInstance(baseConfig)
|
|
144
|
-
|
|
145
|
-
// 双重调用函数
|
|
146
|
-
const dualInstance = (option?: CustomConfig) => {
|
|
147
|
-
if (option) {
|
|
148
|
-
// 合并配置并创建新实例
|
|
149
|
-
const mergedConfig = { ...baseConfig, ...option }
|
|
150
|
-
return createInstance(mergedConfig)
|
|
151
|
-
}
|
|
152
|
-
return defaultInstance
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// 🎯 直接绑定 HTTP 方法,无需复杂类型注释
|
|
156
|
-
dualInstance.Get = defaultInstance.Get.bind(defaultInstance)
|
|
157
|
-
dualInstance.Post = defaultInstance.Post.bind(defaultInstance)
|
|
158
|
-
dualInstance.Put = defaultInstance.Put.bind(defaultInstance)
|
|
159
|
-
dualInstance.Delete = defaultInstance.Delete.bind(defaultInstance)
|
|
160
|
-
dualInstance.Patch = defaultInstance.Patch.bind(defaultInstance)
|
|
161
|
-
dualInstance.Head = defaultInstance.Head.bind(defaultInstance)
|
|
162
|
-
dualInstance.Options = defaultInstance.Options.bind(defaultInstance)
|
|
163
|
-
dualInstance.Request = defaultInstance.Request.bind(defaultInstance)
|
|
164
|
-
|
|
165
|
-
return dualInstance
|
|
166
|
-
}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
export const deepMergeObject = <T = any>(source: T, target: Partial<T>): T => {
|
|
2
|
-
const isObject = (obj: any): obj is Record<string, any> =>
|
|
3
|
-
obj && typeof obj === 'object' && !Array.isArray(obj)
|
|
4
|
-
|
|
5
|
-
const merge = (src: any, tgt: any): any => {
|
|
6
|
-
if (isObject(src) && isObject(tgt)) {
|
|
7
|
-
Object.keys(tgt).forEach((key) => {
|
|
8
|
-
if (isObject(tgt[key])) {
|
|
9
|
-
src[key] = merge(src[key] || {}, tgt[key])
|
|
10
|
-
} else {
|
|
11
|
-
src[key] = tgt[key]
|
|
12
|
-
}
|
|
13
|
-
})
|
|
14
|
-
}
|
|
15
|
-
return src
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
return merge({ ...source }, target)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* 判断一个变量是不是可读流
|
|
23
|
-
* @param data
|
|
24
|
-
*/
|
|
25
|
-
export const isReadableStream = (data: unknown): boolean => {
|
|
26
|
-
if (!(data instanceof ReadableStream)) {
|
|
27
|
-
return false
|
|
28
|
-
}
|
|
29
|
-
if (typeof data.locked !== 'boolean') return false
|
|
30
|
-
|
|
31
|
-
const instanceFunc = ['cancel', 'getReader', 'pipeThrough', 'pipeTo', 'tee'] as const
|
|
32
|
-
|
|
33
|
-
for (const func of instanceFunc) {
|
|
34
|
-
if (typeof data[func] !== 'function') return false
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return true
|
|
38
|
-
}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { envVariables } from '../env'
|
|
2
|
-
import { createDualCallInstance } from './core'
|
|
3
|
-
import { router } from '@/router'
|
|
4
|
-
import { ElMessage } from 'element-plus'
|
|
5
|
-
import 'element-plus/es/components/message/style/css'
|
|
6
|
-
import vueHook from 'alova/vue'
|
|
7
|
-
import { axiosRequestAdapter } from '@alova/adapter-axios'
|
|
8
|
-
|
|
9
|
-
const getBaseConfig = (): Parameters<typeof createDualCallInstance>[0] => {
|
|
10
|
-
return {
|
|
11
|
-
baseUrl: `/${envVariables.PUBLIC_PORT}`,
|
|
12
|
-
statusMap: {
|
|
13
|
-
success: 200,
|
|
14
|
-
unAuthorized: 401,
|
|
15
|
-
},
|
|
16
|
-
codeMap: {
|
|
17
|
-
success: [200],
|
|
18
|
-
},
|
|
19
|
-
responseDataKey: 'data',
|
|
20
|
-
responseMessageKey: 'msg',
|
|
21
|
-
commonHeaders: {},
|
|
22
|
-
successMessageFunc: (msg: string) => {
|
|
23
|
-
ElMessage.success(msg)
|
|
24
|
-
},
|
|
25
|
-
errorMessageFunc: (msg: string) => {
|
|
26
|
-
ElMessage.error(msg)
|
|
27
|
-
},
|
|
28
|
-
unAuthorizedResponseFunc: () => {
|
|
29
|
-
router.push('/login')
|
|
30
|
-
ElMessage.error('登录过期或未登录')
|
|
31
|
-
},
|
|
32
|
-
statesHook: vueHook,
|
|
33
|
-
requestAdapter: axiosRequestAdapter(),
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
const alovaRequest = createDualCallInstance(getBaseConfig())
|
|
38
|
-
|
|
39
|
-
export default alovaRequest
|
|
@@ -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
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
PUBLIC_API_URL = 'http://localhost:8080'
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
PUBLIC_API_URL = 'http://localhost:8080'
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
.send_dingtalk_notification: &send_dingtalk_notification |
|
|
2
|
-
case "$CI_JOB_STAGE" in
|
|
3
|
-
"build")
|
|
4
|
-
stage_name="构建"
|
|
5
|
-
;;
|
|
6
|
-
"deploy")
|
|
7
|
-
stage_name="部署"
|
|
8
|
-
;;
|
|
9
|
-
esac
|
|
10
|
-
|
|
11
|
-
if [ "$CI_JOB_STATUS" == "success" ]; then
|
|
12
|
-
title="==✅ ${stage_name}成功=="
|
|
13
|
-
else
|
|
14
|
-
title="==❌ ${stage_name}失败=="
|
|
15
|
-
fi
|
|
16
|
-
|
|
17
|
-
curl -s -X POST ${DINGTALK_WEBHOOK} \
|
|
18
|
-
-H "Content-Type: application/json" \
|
|
19
|
-
-d "{
|
|
20
|
-
\"msgtype\": \"markdown\",
|
|
21
|
-
\"markdown\": {
|
|
22
|
-
\"title\": \"GitLab CI/CD 通知\",
|
|
23
|
-
\"text\": \"### ${title}\n\n- **项目**: ${CI_PROJECT_NAME}\n- **项目地址**: ${CI_PROJECT_URL}\n- **阶段**: ${stage_name}\n- **任务**: [查看详情](${CI_JOB_URL})\n- **分支**: ${CI_COMMIT_REF_NAME}\n- **提交人**: ${CI_COMMIT_AUTHOR}\n- **提交信息**: ${CI_COMMIT_MESSAGE}\n- **时间**: $(date '+%Y-%m-%d %H:%M:%S')\"
|
|
24
|
-
}
|
|
25
|
-
}"
|
|
26
|
-
|
|
27
|
-
stages:
|
|
28
|
-
- build
|
|
29
|
-
- deploy
|
|
30
|
-
|
|
31
|
-
variables:
|
|
32
|
-
DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model'
|
|
33
|
-
MOCK_DEPLOY_PATH: '/usr/local/bee/web/pipe-network/pipe-network-model-mock'
|
|
34
|
-
DINGTALK_WEBHOOK: 'https://oapi.dingtalk.com/robot/send?access_token=${DING_TALK_ACCESS_TOKEN}'
|
|
35
|
-
|
|
36
|
-
cache:
|
|
37
|
-
paths:
|
|
38
|
-
- node_modules/
|
|
39
|
-
|
|
40
|
-
# 打包
|
|
41
|
-
build:
|
|
42
|
-
stage: build
|
|
43
|
-
script:
|
|
44
|
-
- cd ${CI_PROJECT_DIR}
|
|
45
|
-
- whoami
|
|
46
|
-
- echo "===== 开始构建 ====="
|
|
47
|
-
- pnpm install
|
|
48
|
-
- pnpm build
|
|
49
|
-
- echo "===== 构建完成 ====="
|
|
50
|
-
only:
|
|
51
|
-
- dev
|
|
52
|
-
- mock
|
|
53
|
-
artifacts:
|
|
54
|
-
paths:
|
|
55
|
-
- dist/
|
|
56
|
-
after_script:
|
|
57
|
-
#钉钉通知
|
|
58
|
-
- *send_dingtalk_notification
|
|
59
|
-
|
|
60
|
-
# 部署
|
|
61
|
-
deploy:
|
|
62
|
-
stage: deploy
|
|
63
|
-
needs: ['build']
|
|
64
|
-
only:
|
|
65
|
-
- dev
|
|
66
|
-
- mock
|
|
67
|
-
script:
|
|
68
|
-
- echo "-----------------开始部署------------------"
|
|
69
|
-
- |
|
|
70
|
-
if [ "$CI_COMMIT_BRANCH" == "dev" ]; then
|
|
71
|
-
ssh root@192.168.2.245 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理245失败"; exit 1; }
|
|
72
|
-
scp -r dist/* root@192.168.2.245:$DEPLOY_PATH || { echo "❌ 传输到245失败"; exit 1; }
|
|
73
|
-
ssh root@192.168.2.57 "rm -rf $DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
|
|
74
|
-
scp -r dist/* root@192.168.2.57:$DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
|
|
75
|
-
elif [ "$CI_COMMIT_BRANCH" == "mock" ]; then
|
|
76
|
-
ssh root@192.168.2.57 "rm -rf $MOCK_DEPLOY_PATH/*" || { echo "❌ 清理57失败"; exit 1; }
|
|
77
|
-
scp -r dist/* root@192.168.2.57:$MOCK_DEPLOY_PATH || { echo "❌ 传输到57失败"; exit 1; }
|
|
78
|
-
else
|
|
79
|
-
echo "没有匹配到需要部署的分支或标签,跳过部署"
|
|
80
|
-
exit 0
|
|
81
|
-
fi
|
|
82
|
-
after_script:
|
|
83
|
-
#钉钉通知
|
|
84
|
-
- *send_dingtalk_notification
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"editor.formatOnSave": true,
|
|
3
|
-
"editor.defaultFormatter": "biomejs.biome",
|
|
4
|
-
"editor.codeActionsOnSave": {
|
|
5
|
-
"source.organizeImports.biome": "explicit",
|
|
6
|
-
"source.fixAll.biome": "explicit"
|
|
7
|
-
},
|
|
8
|
-
"oxc.enable": false,
|
|
9
|
-
"typescript.tsdk": "node_modules\\typescript\\lib"
|
|
10
|
-
}
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
|
|
3
|
-
"files": {
|
|
4
|
-
"ignoreUnknown": true,
|
|
5
|
-
"includes": ["**", "!public/**/*", "!node_modules/**/*", "!dist/**/*"]
|
|
6
|
-
},
|
|
7
|
-
"formatter": {
|
|
8
|
-
"enabled": true,
|
|
9
|
-
"indentStyle": "space",
|
|
10
|
-
"lineWidth": 100,
|
|
11
|
-
"indentWidth": 2
|
|
12
|
-
},
|
|
13
|
-
"linter": {
|
|
14
|
-
"rules": {
|
|
15
|
-
"style": {
|
|
16
|
-
"useImportType": "off",
|
|
17
|
-
"useNumberNamespace": "off",
|
|
18
|
-
"useNodejsImportProtocol": "off",
|
|
19
|
-
"noNonNullAssertion": "off",
|
|
20
|
-
"noUnusedTemplateLiteral": "off",
|
|
21
|
-
"useConst": {
|
|
22
|
-
"level": "warn",
|
|
23
|
-
"fix": "unsafe"
|
|
24
|
-
}
|
|
25
|
-
},
|
|
26
|
-
"complexity": {
|
|
27
|
-
"noUselessTypeConstraint": "off",
|
|
28
|
-
"noForEach": "off",
|
|
29
|
-
"useDateNow": "off"
|
|
30
|
-
},
|
|
31
|
-
"correctness": {
|
|
32
|
-
"useExhaustiveDependencies": "off",
|
|
33
|
-
"useHookAtTopLevel": "off",
|
|
34
|
-
"noUnusedFunctionParameters": "off",
|
|
35
|
-
"noUnusedVariables": "off",
|
|
36
|
-
"useUniqueElementIds": "off",
|
|
37
|
-
"useParseIntRadix": "off"
|
|
38
|
-
},
|
|
39
|
-
"security": {
|
|
40
|
-
"noDangerouslySetInnerHtml": "off"
|
|
41
|
-
},
|
|
42
|
-
"suspicious": {
|
|
43
|
-
"noGlobalIsNan": "off",
|
|
44
|
-
"noGlobalIsFinite": "off",
|
|
45
|
-
"noExplicitAny": "off",
|
|
46
|
-
"noArrayIndexKey": "off",
|
|
47
|
-
"noConfusingVoidType": "off",
|
|
48
|
-
"noThenProperty": "off",
|
|
49
|
-
"noTemplateCurlyInString": "off"
|
|
50
|
-
},
|
|
51
|
-
"performance": {
|
|
52
|
-
"noDelete": "off",
|
|
53
|
-
"noAccumulatingSpread": "off",
|
|
54
|
-
"noDynamicNamespaceImportAccess": "off"
|
|
55
|
-
},
|
|
56
|
-
"a11y": {
|
|
57
|
-
"noAriaHiddenOnFocusable": "off",
|
|
58
|
-
"noLabelWithoutControl": "off",
|
|
59
|
-
"useFocusableInteractive": "off",
|
|
60
|
-
"useKeyWithClickEvents": "off",
|
|
61
|
-
"useSemanticElements": "off",
|
|
62
|
-
"noStaticElementInteractions": "off",
|
|
63
|
-
"useAriaPropsSupportedByRole": "off",
|
|
64
|
-
"useAriaPropsForRole": "off",
|
|
65
|
-
"useValidAnchor": "off",
|
|
66
|
-
"useMediaCaption": "off"
|
|
67
|
-
},
|
|
68
|
-
"nursery": {
|
|
69
|
-
"useSortedClasses": {
|
|
70
|
-
"level": "warn",
|
|
71
|
-
"fix": "safe"
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"css": {
|
|
77
|
-
"formatter": {
|
|
78
|
-
"quoteStyle": "single"
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
"javascript": {
|
|
82
|
-
"jsxRuntime": "reactClassic",
|
|
83
|
-
"formatter": {
|
|
84
|
-
"quoteStyle": "single",
|
|
85
|
-
"semicolons": "asNeeded"
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
"assist": {
|
|
89
|
-
"enabled": true,
|
|
90
|
-
"actions": {
|
|
91
|
-
"source": {
|
|
92
|
-
"organizeImports": {
|
|
93
|
-
"level": "on",
|
|
94
|
-
"options": {
|
|
95
|
-
"identifierOrder": "natural",
|
|
96
|
-
"groups": [
|
|
97
|
-
[":NODE:", ":BUN:"],
|
|
98
|
-
":BLANK_LINE:",
|
|
99
|
-
["react", "react-dom/**", "react-dom", "react-router", "react-router-dom"],
|
|
100
|
-
["vue", "vue-router"],
|
|
101
|
-
":BLANK_LINE:",
|
|
102
|
-
["@/**", "**"]
|
|
103
|
-
]
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default { extends: ['@commitlint/config-conventional'] }
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
pre-commit:
|
|
2
|
-
commands:
|
|
3
|
-
check:
|
|
4
|
-
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc,vue}"
|
|
5
|
-
run: npx @biomejs/biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off --diagnostic-level=warn {staged_files}
|
|
6
|
-
stage_fixed: true
|
|
7
|
-
|
|
8
|
-
commit-msg:
|
|
9
|
-
commands:
|
|
10
|
-
"lint commit message":
|
|
11
|
-
run: npx commitlint --edit {1}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "template-vue-rolldown-oxlint",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "vite",
|
|
8
|
-
"build": "vue-tsc -b && vite build",
|
|
9
|
-
"preview": "vite preview",
|
|
10
|
-
"format": "biome format --write",
|
|
11
|
-
"check": "biome check --write"
|
|
12
|
-
},
|
|
13
|
-
"dependencies": {
|
|
14
|
-
"@alova/adapter-axios": "^2.0.16",
|
|
15
|
-
"@element-plus/icons-vue": "^2.3.2",
|
|
16
|
-
"@vueuse/core": "^13.9.0",
|
|
17
|
-
"alova": "^3.3.4",
|
|
18
|
-
"axios": "^1.12.2",
|
|
19
|
-
"dayjs": "^1.11.18",
|
|
20
|
-
"echarts": "^6.0.0",
|
|
21
|
-
"element-plus": "^2.11.5",
|
|
22
|
-
"nprogress": "^0.2.0",
|
|
23
|
-
"pinia": "^3.0.3",
|
|
24
|
-
"pinia-plugin-persistedstate": "^4.5.0",
|
|
25
|
-
"plus-pro-components": "^0.1.30",
|
|
26
|
-
"radashi": "^12.7.0",
|
|
27
|
-
"vue": "^3.5.22",
|
|
28
|
-
"vue-router": "^4.6.3"
|
|
29
|
-
},
|
|
30
|
-
"devDependencies": {
|
|
31
|
-
"@biomejs/biome": "^2.2.6",
|
|
32
|
-
"@commitlint/cli": "^20.1.0",
|
|
33
|
-
"@commitlint/config-conventional": "^20.0.0",
|
|
34
|
-
"@plus-pro-components/resolver": "^0.0.3",
|
|
35
|
-
"@types/nprogress": "^0.2.3",
|
|
36
|
-
"@vitejs/plugin-vue": "^6.0.1",
|
|
37
|
-
"@vue/tsconfig": "^0.8.1",
|
|
38
|
-
"fast-glob": "^3.3.3",
|
|
39
|
-
"lefthook": "^1.13.6",
|
|
40
|
-
"sass": "^1.93.2",
|
|
41
|
-
"typescript": "~5.9.3",
|
|
42
|
-
"unocss": "^66.5.4",
|
|
43
|
-
"unplugin-auto-import": "^20.2.0",
|
|
44
|
-
"unplugin-vue-components": "^30.0.0",
|
|
45
|
-
"vite": "npm:rolldown-vite@7.1.17",
|
|
46
|
-
"vite-plugin-inspect": "^11.3.3",
|
|
47
|
-
"vite-plugin-svg-icons": "^2.0.1",
|
|
48
|
-
"vue-tsc": "^3.1.1"
|
|
49
|
-
}
|
|
50
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="31.88" height="32" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 257"><defs><linearGradient id="IconifyId1813088fe1fbc01fb466" x1="-.828%" x2="57.636%" y1="7.652%" y2="78.411%"><stop offset="0%" stop-color="#41D1FF"></stop><stop offset="100%" stop-color="#BD34FE"></stop></linearGradient><linearGradient id="IconifyId1813088fe1fbc01fb467" x1="43.376%" x2="50.316%" y1="2.242%" y2="89.03%"><stop offset="0%" stop-color="#FFEA83"></stop><stop offset="8.333%" stop-color="#FFDD35"></stop><stop offset="100%" stop-color="#FFA800"></stop></linearGradient></defs><path fill="url(#IconifyId1813088fe1fbc01fb466)" d="M255.153 37.938L134.897 252.976c-2.483 4.44-8.862 4.466-11.382.048L.875 37.958c-2.746-4.814 1.371-10.646 6.827-9.67l120.385 21.517a6.537 6.537 0 0 0 2.322-.004l117.867-21.483c5.438-.991 9.574 4.796 6.877 9.62Z"></path><path fill="url(#IconifyId1813088fe1fbc01fb467)" d="M185.432.063L96.44 17.501a3.268 3.268 0 0 0-2.634 3.014l-5.474 92.456a3.268 3.268 0 0 0 3.997 3.378l24.777-5.718c2.318-.535 4.413 1.507 3.936 3.838l-7.361 36.047c-.495 2.426 1.782 4.5 4.151 3.78l15.304-4.649c2.372-.72 4.652 1.36 4.15 3.788l-11.698 56.621c-.732 3.542 3.979 5.473 5.943 2.437l1.313-2.028l72.516-144.72c1.215-2.423-.88-5.186-3.54-4.672l-25.505 4.922c-2.396.462-4.435-1.77-3.759-4.114l16.646-57.705c.677-2.35-1.37-4.583-3.769-4.113Z"></path></svg>
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
3
|
-
import plusZhCn from 'plus-pro-components/es/locale/lang/zh-cn'
|
|
4
|
-
|
|
5
|
-
const locale = {
|
|
6
|
-
...zhCn,
|
|
7
|
-
...plusZhCn,
|
|
8
|
-
}
|
|
9
|
-
</script>
|
|
10
|
-
|
|
11
|
-
<template>
|
|
12
|
-
<el-config-provider
|
|
13
|
-
:locale="locale"
|
|
14
|
-
>
|
|
15
|
-
<RouterView />
|
|
16
|
-
</el-config-provider>
|
|
17
|
-
</template>
|
|
18
|
-
|
|
19
|
-
<style scoped></style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="currentColor" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="currentColor" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|