create-bubbles 0.1.22 → 0.1.23

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.
Files changed (54) hide show
  1. package/dist/index.mjs +5 -0
  2. package/package.json +1 -1
  3. package/template-vp-monorepo-react-nestjs/.vscode/settings.json +3 -2
  4. package/template-vp-monorepo-react-nestjs/apps/server/src/database/schema.ts +63 -4
  5. package/template-vp-monorepo-react-nestjs/vite.config.ts +2 -1
  6. package/template-vp-vue-eslint-vapor/.env +6 -0
  7. package/template-vp-vue-eslint-vapor/.env.development +2 -0
  8. package/template-vp-vue-eslint-vapor/.env.production +2 -0
  9. package/template-vp-vue-eslint-vapor/.vite-hooks/commit-msg +1 -0
  10. package/template-vp-vue-eslint-vapor/.vite-hooks/pre-commit +1 -0
  11. package/template-vp-vue-eslint-vapor/.vscode/extensions.json +3 -0
  12. package/template-vp-vue-eslint-vapor/AGENTS.md +16 -0
  13. package/template-vp-vue-eslint-vapor/README.md +93 -0
  14. package/template-vp-vue-eslint-vapor/commitlint.config.js +1 -0
  15. package/template-vp-vue-eslint-vapor/eslint.config.js +13 -0
  16. package/template-vp-vue-eslint-vapor/index.html +13 -0
  17. package/template-vp-vue-eslint-vapor/package.json +64 -0
  18. package/template-vp-vue-eslint-vapor/pnpm-workspace.yaml +2 -0
  19. package/template-vp-vue-eslint-vapor/public/vite.svg +1 -0
  20. package/template-vp-vue-eslint-vapor/src/App.vue +7 -0
  21. package/template-vp-vue-eslint-vapor/src/api/index.ts +12 -0
  22. package/template-vp-vue-eslint-vapor/src/assets/icon/home.svg +3 -0
  23. package/template-vp-vue-eslint-vapor/src/assets/icon/logo.svg +1 -0
  24. package/template-vp-vue-eslint-vapor/src/assets/image/.gitkeep +0 -0
  25. package/template-vp-vue-eslint-vapor/src/components/Icon/svg-icon.vue +29 -0
  26. package/template-vp-vue-eslint-vapor/src/hooks/chart/lib.ts +57 -0
  27. package/template-vp-vue-eslint-vapor/src/hooks/chart/useEcharts.ts +65 -0
  28. package/template-vp-vue-eslint-vapor/src/layout/default/header/index.vue +57 -0
  29. package/template-vp-vue-eslint-vapor/src/layout/default/index.vue +138 -0
  30. package/template-vp-vue-eslint-vapor/src/main.ts +19 -0
  31. package/template-vp-vue-eslint-vapor/src/router/guard/index.ts +7 -0
  32. package/template-vp-vue-eslint-vapor/src/router/guard/permissionGuard.ts +13 -0
  33. package/template-vp-vue-eslint-vapor/src/router/index.ts +18 -0
  34. package/template-vp-vue-eslint-vapor/src/router/interface.ts +9 -0
  35. package/template-vp-vue-eslint-vapor/src/router/modules/index.ts +33 -0
  36. package/template-vp-vue-eslint-vapor/src/store/index.ts +11 -0
  37. package/template-vp-vue-eslint-vapor/src/store/modules/user.ts +17 -0
  38. package/template-vp-vue-eslint-vapor/src/styles/font.scss +0 -0
  39. package/template-vp-vue-eslint-vapor/src/styles/index.scss +29 -0
  40. package/template-vp-vue-eslint-vapor/src/styles/variables.scss +3 -0
  41. package/template-vp-vue-eslint-vapor/src/types/vite-env.d.ts +15 -0
  42. package/template-vp-vue-eslint-vapor/src/utils/env.ts +11 -0
  43. package/template-vp-vue-eslint-vapor/src/utils/request/core/index.ts +425 -0
  44. package/template-vp-vue-eslint-vapor/src/utils/request/core/utils.ts +39 -0
  45. package/template-vp-vue-eslint-vapor/src/utils/request/index.ts +44 -0
  46. package/template-vp-vue-eslint-vapor/src/views/example/echart/config.ts +1794 -0
  47. package/template-vp-vue-eslint-vapor/src/views/example/echart/index.vue +20 -0
  48. package/template-vp-vue-eslint-vapor/src/views/example/tree-chart.vue +16 -0
  49. package/template-vp-vue-eslint-vapor/src/views/home/index.vue +16 -0
  50. package/template-vp-vue-eslint-vapor/src/views/login/index.vue +9 -0
  51. package/template-vp-vue-eslint-vapor/tsconfig.json +32 -0
  52. package/template-vp-vue-eslint-vapor/tsconfig.tsbuildinfo +1 -0
  53. package/template-vp-vue-eslint-vapor/uno.config.ts +17 -0
  54. package/template-vp-vue-eslint-vapor/vite.config.ts +66 -0
@@ -0,0 +1,425 @@
1
+ import {
2
+ deepMergeObject,
3
+ isPlainObject,
4
+ isReadableStream,
5
+ tryParseJsonString,
6
+ } from './utils'
7
+ import type {
8
+ AlovaGlobalCacheAdapter,
9
+ AlovaOptions,
10
+ AlovaRequestAdapter,
11
+ GlobalCacheConfig,
12
+ StatesExport,
13
+ StatesHook,
14
+ } from 'alova'
15
+ import { createAlova } from 'alova'
16
+ import type { FetchRequestInit } from 'alova/fetch'
17
+ import adapterFetch from 'alova/fetch'
18
+
19
+ type MaybePromise<T> = T | Promise<T>
20
+ type HeaderValue =
21
+ | string
22
+ | number
23
+ | boolean
24
+ | null
25
+ | undefined
26
+ | (() => MaybePromise<string | number | boolean | null | undefined>)
27
+ type StatusMatcher<RE> = number | number[] | ((status: number, response: RE) => boolean)
28
+ type CodeMatcher = Array<number | string>
29
+
30
+ export interface StatusMap<RE = unknown> {
31
+ success?: StatusMatcher<RE>
32
+ unAuthorized?: StatusMatcher<RE>
33
+ }
34
+
35
+ export interface CodeMap {
36
+ success?: CodeMatcher
37
+ unAuthorized?: CodeMatcher
38
+ }
39
+
40
+ export interface RequestMeta {
41
+ isWrapped?: boolean
42
+ isTransformResponse?: boolean
43
+ isShowSuccessMessage?: boolean
44
+ isShowErrorMessage?: boolean
45
+ }
46
+
47
+ export interface BaseRequestOption<
48
+ RC extends object = FetchRequestInit,
49
+ RE = Response,
50
+ RH = Headers,
51
+ SE extends StatesExport<any> = StatesExport<any>,
52
+ > extends RequestMeta {
53
+ baseUrl?: string
54
+ timeout?: number
55
+ commonHeaders?: () => Record<string, HeaderValue>
56
+ statusMap?: StatusMap<RE>
57
+ codeMap?: CodeMap
58
+ responseCodeKey?: string
59
+ responseDataKey?: string
60
+ responseMessageKey?: string
61
+ cacheFor?: GlobalCacheConfig<any> | null
62
+ cacheLogger?: boolean
63
+ statesHook?: StatesHook<SE>
64
+ successDefaultMessage?: string
65
+ errorDefaultMessage?: string
66
+ successMessageFunc?: (message: string) => void
67
+ errorMessageFunc?: (message: string) => void
68
+ unAuthorizedResponseFunc?: () => void
69
+ requestAdapter?: AlovaRequestAdapter<RC, RE, RH>
70
+ l1Cache?: AlovaGlobalCacheAdapter
71
+ l2Cache?: AlovaGlobalCacheAdapter
72
+ storageAdapter?: AlovaGlobalCacheAdapter
73
+ }
74
+
75
+ export type baseRequestOption<
76
+ RC extends object = FetchRequestInit,
77
+ RE = Response,
78
+ RH = Headers,
79
+ SE extends StatesExport<any> = StatesExport<any>,
80
+ > = BaseRequestOption<RC, RE, RH, SE>
81
+
82
+ export type RequestOption<
83
+ RC extends object = FetchRequestInit,
84
+ RE = Response,
85
+ RH = Headers,
86
+ SE extends StatesExport<any> = StatesExport<any>,
87
+ > = BaseRequestOption<RC, RE, RH, SE>
88
+
89
+ type RequestAlovaGenerics<RC extends object, RE, RH, SE extends StatesExport<any>> = {
90
+ Responded: unknown
91
+ Transformed: unknown
92
+ RequestConfig: RC
93
+ Response: RE
94
+ ResponseHeader: RH
95
+ L1Cache: AlovaGlobalCacheAdapter
96
+ L2Cache: AlovaGlobalCacheAdapter
97
+ StatesExport: SE
98
+ }
99
+
100
+ type ResolvedRequestOption<RC extends object, RE, RH, SE extends StatesExport<any>> = Required<
101
+ Pick<
102
+ BaseRequestOption<RC, RE, RH, SE>,
103
+ | 'baseUrl'
104
+ | 'statusMap'
105
+ | 'codeMap'
106
+ | 'responseCodeKey'
107
+ | 'responseDataKey'
108
+ | 'responseMessageKey'
109
+ | 'isWrapped'
110
+ | 'isTransformResponse'
111
+ | 'isShowSuccessMessage'
112
+ | 'successDefaultMessage'
113
+ | 'isShowErrorMessage'
114
+ | 'errorDefaultMessage'
115
+ | 'cacheLogger'
116
+ >
117
+ > &
118
+ BaseRequestOption<RC, RE, RH, SE>
119
+
120
+ const DEFAULT_SUCCESS_MESSAGE = '操作成功'
121
+ const DEFAULT_ERROR_MESSAGE = '服务异常'
122
+
123
+ const defaultRequestOption: BaseRequestOption<any, any, any, any> = {
124
+ baseUrl: '/',
125
+ timeout: undefined,
126
+ statusMap: {
127
+ success: 200,
128
+ unAuthorized: 401,
129
+ },
130
+ codeMap: {
131
+ success: [200],
132
+ unAuthorized: [401],
133
+ },
134
+ responseCodeKey: 'code',
135
+ responseDataKey: 'data',
136
+ responseMessageKey: 'message',
137
+ isWrapped: true,
138
+ isTransformResponse: true,
139
+ isShowSuccessMessage: false,
140
+ successDefaultMessage: DEFAULT_SUCCESS_MESSAGE,
141
+ isShowErrorMessage: true,
142
+ errorDefaultMessage: DEFAULT_ERROR_MESSAGE,
143
+ cacheFor: null,
144
+ cacheLogger: true,
145
+ requestAdapter: adapterFetch() as AlovaRequestAdapter<any, any, any>,
146
+ }
147
+
148
+ function getMethodMeta(method: unknown): RequestMeta {
149
+ const methodRecord = method as { meta?: RequestMeta; config?: { meta?: RequestMeta } } | undefined
150
+ return methodRecord?.config?.meta ?? methodRecord?.meta ?? {}
151
+ }
152
+
153
+ function getMetaFlag(meta: RequestMeta, key: keyof RequestMeta, fallback: boolean): boolean {
154
+ const value = meta[key]
155
+ return typeof value === 'boolean' ? value : fallback
156
+ }
157
+
158
+ function isMatchedStatus<RE>(
159
+ status: number,
160
+ matcher: StatusMatcher<RE> | undefined,
161
+ response: RE,
162
+ ): boolean {
163
+ if (matcher === undefined) return status >= 200 && status < 300
164
+
165
+ if (typeof matcher === 'function') return matcher(status, response)
166
+
167
+ return Array.isArray(matcher) ? matcher.includes(status) : matcher === status
168
+ }
169
+
170
+ function isMatchedCode(code: unknown, matcher: CodeMatcher | undefined): boolean {
171
+ if (!matcher?.length) return true
172
+
173
+ return matcher.some((item) => String(item) === String(code))
174
+ }
175
+
176
+ function getResponseStatus(response: unknown): number {
177
+ const responseRecord = response as { status?: unknown; statusCode?: unknown }
178
+ const status = responseRecord.statusCode ?? responseRecord.status
179
+ return typeof status === 'number' ? status : Number(status)
180
+ }
181
+
182
+ function getResponseMessage(data: unknown, messageKey: string, defaultMessage: string): string {
183
+ if (!isPlainObject(data)) return defaultMessage
184
+
185
+ const message = data[messageKey] ?? data.message ?? data.msg
186
+ if (typeof message === 'string') return message || defaultMessage
187
+ if (typeof message === 'number') return String(message)
188
+
189
+ return defaultMessage
190
+ }
191
+
192
+ function getResponseField(data: unknown, key: string): unknown {
193
+ return isPlainObject(data) ? data[key] : undefined
194
+ }
195
+
196
+ async function parseFetchResponse(response: {
197
+ status?: number
198
+ body?: unknown
199
+ headers?: Headers | Record<string, unknown>
200
+ clone?: () => Response
201
+ json?: () => Promise<unknown>
202
+ text?: () => Promise<string>
203
+ }): Promise<unknown> {
204
+ if (response.status === 204) return undefined
205
+
206
+ const reader = typeof response.clone === 'function' ? response.clone() : response
207
+ const contentType = getHeaderValue(response.headers, 'content-type')
208
+
209
+ if (contentType.includes('application/json') && typeof reader.json === 'function')
210
+ return reader.json()
211
+
212
+ if (contentType.startsWith('text/') && typeof reader.text === 'function')
213
+ return tryParseJsonString(await reader.text())
214
+
215
+ if (typeof reader.json === 'function') {
216
+ try {
217
+ return await reader.json()
218
+ } catch {
219
+ // Fall through to text parsing.
220
+ }
221
+ }
222
+
223
+ if (typeof reader.text === 'function') return tryParseJsonString(await reader.text())
224
+
225
+ return undefined
226
+ }
227
+
228
+ function getHeaderValue(
229
+ headers: Headers | Record<string, unknown> | undefined,
230
+ key: string,
231
+ ): string {
232
+ if (!headers) return ''
233
+
234
+ if (typeof Headers !== 'undefined' && headers instanceof Headers) return headers.get(key) ?? ''
235
+
236
+ const headerRecord = headers as Record<string, unknown>
237
+ const value =
238
+ headerRecord[key] ?? headerRecord[key.toLowerCase()] ?? headerRecord[key.toUpperCase()]
239
+ return typeof value === 'string' ? value : ''
240
+ }
241
+
242
+ async function getResponseData(response: unknown): Promise<unknown> {
243
+ const responseRecord = response as {
244
+ body?: unknown
245
+ data?: unknown
246
+ json?: () => Promise<unknown>
247
+ text?: () => Promise<string>
248
+ }
249
+
250
+ if ('data' in responseRecord && !isReadableStream(responseRecord.body))
251
+ return tryParseJsonString(responseRecord.data)
252
+
253
+ if (
254
+ isReadableStream(responseRecord.body) ||
255
+ typeof responseRecord.json === 'function' ||
256
+ typeof responseRecord.text === 'function'
257
+ ) {
258
+ return parseFetchResponse(responseRecord)
259
+ }
260
+
261
+ return response
262
+ }
263
+
264
+ async function resolveHeaderValue(value: HeaderValue): Promise<string | undefined> {
265
+ const resolved = typeof value === 'function' ? await value() : value
266
+ if (resolved === null || resolved === undefined) return undefined
267
+ return String(resolved)
268
+ }
269
+
270
+ function setHeader(target: unknown, key: string, value: string): void {
271
+ if (typeof Headers !== 'undefined' && target instanceof Headers) {
272
+ target.set(key, value)
273
+ return
274
+ }
275
+
276
+ if (Array.isArray(target)) {
277
+ target.push([key, value])
278
+ return
279
+ }
280
+
281
+ ;(target as Record<string, string>)[key] = value
282
+ }
283
+
284
+ function resolveConfig<RC extends object, RE, RH, SE extends StatesExport<any>>(
285
+ option: BaseRequestOption<RC, RE, RH, SE>,
286
+ ): ResolvedRequestOption<RC, RE, RH, SE> {
287
+ return deepMergeObject(defaultRequestOption, option) as ResolvedRequestOption<RC, RE, RH, SE>
288
+ }
289
+
290
+ export function createInstance<
291
+ RC extends object = FetchRequestInit,
292
+ RE = Response,
293
+ RH = Headers,
294
+ SE extends StatesExport<any> = StatesExport<any>,
295
+ >(option: RequestOption<RC, RE, RH, SE> = {}) {
296
+ const config = resolveConfig(option)
297
+
298
+ const alovaOptions: AlovaOptions<RequestAlovaGenerics<RC, RE, RH, SE>> = {
299
+ baseURL: config.baseUrl,
300
+ timeout: config.timeout,
301
+ cacheFor: config.cacheFor as GlobalCacheConfig<any>,
302
+ cacheLogger: config.cacheLogger,
303
+ statesHook: config.statesHook,
304
+ requestAdapter: config.requestAdapter!,
305
+ l1Cache: config.l1Cache,
306
+ l2Cache: config.l2Cache ?? config.storageAdapter,
307
+ beforeRequest: async (method) => {
308
+ const methodConfig = method.config as { headers?: unknown }
309
+ const headers = methodConfig.headers ?? {}
310
+ methodConfig.headers = headers
311
+
312
+ for (const [key, value] of Object.entries(config.commonHeaders?.() ?? {})) {
313
+ const resolvedValue = await resolveHeaderValue(value)
314
+ if (resolvedValue !== undefined) setHeader(headers, key, resolvedValue)
315
+ }
316
+ },
317
+ responded: {
318
+ onSuccess: async (response, method) => {
319
+ const meta = getMethodMeta(method)
320
+ const shouldTransform = getMetaFlag(meta, 'isTransformResponse', config.isTransformResponse)
321
+ const showSuccess = getMetaFlag(meta, 'isShowSuccessMessage', config.isShowSuccessMessage)
322
+ const showError = getMetaFlag(meta, 'isShowErrorMessage', config.isShowErrorMessage)
323
+ const isWrapped = getMetaFlag(meta, 'isWrapped', config.isWrapped)
324
+
325
+ if (!shouldTransform) return response
326
+
327
+ const status = getResponseStatus(response)
328
+ const data = await getResponseData(response)
329
+
330
+ if (!isMatchedStatus(status, config.statusMap.success, response)) {
331
+ if (isMatchedStatus(status, config.statusMap.unAuthorized, response))
332
+ config.unAuthorizedResponseFunc?.()
333
+
334
+ if (showError) {
335
+ config.errorMessageFunc?.(
336
+ getResponseMessage(data, config.responseMessageKey, config.errorDefaultMessage),
337
+ )
338
+ }
339
+ return Promise.reject(response)
340
+ }
341
+
342
+ if (!isWrapped) {
343
+ if (showSuccess) config.successMessageFunc?.(config.successDefaultMessage)
344
+ return data
345
+ }
346
+
347
+ const code = getResponseField(data, config.responseCodeKey)
348
+ const responseData = getResponseField(data, config.responseDataKey)
349
+ const responseMessage = getResponseMessage(
350
+ data,
351
+ config.responseMessageKey,
352
+ config.successDefaultMessage,
353
+ )
354
+
355
+ if (!isMatchedCode(code, config.codeMap.success)) {
356
+ if (isMatchedCode(code, config.codeMap.unAuthorized)) config.unAuthorizedResponseFunc?.()
357
+
358
+ if (showError) {
359
+ config.errorMessageFunc?.(
360
+ getResponseMessage(data, config.responseMessageKey, config.errorDefaultMessage),
361
+ )
362
+ }
363
+ return Promise.reject(response)
364
+ }
365
+
366
+ if (showSuccess) config.successMessageFunc?.(responseMessage)
367
+
368
+ return responseData
369
+ },
370
+ onError: (error, method) => {
371
+ const meta = getMethodMeta(method)
372
+ const showError = getMetaFlag(meta, 'isShowErrorMessage', config.isShowErrorMessage)
373
+
374
+ if (showError) {
375
+ config.errorMessageFunc?.(
376
+ error instanceof Error ? error.message : config.errorDefaultMessage,
377
+ )
378
+ }
379
+ return Promise.reject(error)
380
+ },
381
+ },
382
+ }
383
+
384
+ return createAlova(alovaOptions)
385
+ }
386
+
387
+ export type RequestInstance<
388
+ RC extends object = FetchRequestInit,
389
+ RE = Response,
390
+ RH = Headers,
391
+ SE extends StatesExport<any> = StatesExport<any>,
392
+ > = ReturnType<typeof createInstance<RC, RE, RH, SE>>
393
+
394
+ export type DualCallInstance<
395
+ RC extends object = FetchRequestInit,
396
+ RE = Response,
397
+ RH = Headers,
398
+ SE extends StatesExport<any> = StatesExport<any>,
399
+ > = RequestInstance<RC, RE, RH, SE> &
400
+ ((option?: RequestOption<RC, RE, RH, SE>) => RequestInstance<RC, RE, RH, SE>)
401
+
402
+ export function createDualCallInstance<
403
+ RC extends object = FetchRequestInit,
404
+ RE = Response,
405
+ RH = Headers,
406
+ SE extends StatesExport<any> = StatesExport<any>,
407
+ >(baseConfig: BaseRequestOption<RC, RE, RH, SE>): DualCallInstance<RC, RE, RH, SE> {
408
+ const defaultInstance = createInstance(baseConfig)
409
+ const dualInstance = ((option?: RequestOption<RC, RE, RH, SE>) => {
410
+ if (!option) return defaultInstance
411
+ return createInstance(deepMergeObject(baseConfig, option))
412
+ }) as DualCallInstance<RC, RE, RH, SE>
413
+
414
+ Object.assign(dualInstance, defaultInstance)
415
+ dualInstance.Get = defaultInstance.Get.bind(defaultInstance)
416
+ dualInstance.Post = defaultInstance.Post.bind(defaultInstance)
417
+ dualInstance.Put = defaultInstance.Put.bind(defaultInstance)
418
+ dualInstance.Delete = defaultInstance.Delete.bind(defaultInstance)
419
+ dualInstance.Patch = defaultInstance.Patch.bind(defaultInstance)
420
+ dualInstance.Head = defaultInstance.Head.bind(defaultInstance)
421
+ dualInstance.Options = defaultInstance.Options.bind(defaultInstance)
422
+ dualInstance.Request = defaultInstance.Request.bind(defaultInstance)
423
+
424
+ return dualInstance
425
+ }
@@ -0,0 +1,39 @@
1
+ export function deepMergeObject<T = any>(source: T, target: Partial<T>): T {
2
+ const merge = (src: any, tgt: any): any => {
3
+ if (!isPlainObject(src) || !isPlainObject(tgt)) return tgt === undefined ? src : tgt
4
+
5
+ const result = { ...src }
6
+ for (const key of Object.keys(tgt)) {
7
+ const targetValue = tgt[key]
8
+ result[key] = isPlainObject(targetValue) ? merge(result[key], targetValue) : targetValue
9
+ }
10
+
11
+ return result
12
+ }
13
+
14
+ return merge(source, target)
15
+ }
16
+
17
+ export function isPlainObject(data: unknown): data is Record<string, any> {
18
+ return Object.prototype.toString.call(data) === '[object Object]'
19
+ }
20
+
21
+ export function isReadableStream(data: unknown): boolean {
22
+ if (typeof ReadableStream === 'undefined') return false
23
+ return data instanceof ReadableStream
24
+ }
25
+
26
+ export function tryParseJsonString(data: unknown): unknown {
27
+ if (typeof data !== 'string') return data
28
+
29
+ const value = data.trim()
30
+ if (!value) return data
31
+
32
+ if (!value.startsWith('{') && !value.startsWith('[')) return data
33
+
34
+ try {
35
+ return JSON.parse(value)
36
+ } catch {
37
+ return data
38
+ }
39
+ }
@@ -0,0 +1,44 @@
1
+ import { axiosRequestAdapter } from '@alova/adapter-axios'
2
+ import vueHook from 'alova/vue'
3
+ import { message } from 'antdv-next'
4
+
5
+ import { router } from '@/router'
6
+
7
+ import { envVariables } from '../env'
8
+ import { createDualCallInstance } from './core'
9
+
10
+ function getBaseConfig() {
11
+ return {
12
+ baseUrl: `/${envVariables.API_AFFIX}`,
13
+ statusMap: {
14
+ success: 200,
15
+ unAuthorized: 401,
16
+ },
17
+ codeMap: {
18
+ success: [200],
19
+ unAuthorized: [401],
20
+ },
21
+ responseCodeKey: 'code',
22
+ responseDataKey: 'data',
23
+ responseMessageKey: 'msg',
24
+ commonHeaders: () => ({}),
25
+ isWrapped: true,
26
+ isTransformResponse: true,
27
+ successMessageFunc: (msg: string) => {
28
+ message.success(msg)
29
+ },
30
+ errorMessageFunc: (msg: string) => {
31
+ message.error(msg)
32
+ },
33
+ unAuthorizedResponseFunc: () => {
34
+ router.push('/login')
35
+ message.error('登录过期或未登录')
36
+ },
37
+ statesHook: vueHook,
38
+ requestAdapter: axiosRequestAdapter(),
39
+ }
40
+ }
41
+
42
+ const alovaRequest = createDualCallInstance(getBaseConfig())
43
+
44
+ export default alovaRequest