chore: update alova version

This commit is contained in:
chansee97 2024-08-03 07:02:28 +08:00
parent 70c43a276c
commit de4cd17548
8 changed files with 28 additions and 28 deletions

View File

@ -112,6 +112,7 @@
"documentsVite": "Vite", "documentsVite": "Vite",
"documentsVue": "Vue", "documentsVue": "Vue",
"documentsVueuse": "VueUse (external link)", "documentsVueuse": "VueUse (external link)",
"documentsNova": "Nova docs",
"echarts": "Echarts", "echarts": "Echarts",
"editor": "Editor", "editor": "Editor",
"editorMd": "MarkDown editor", "editorMd": "MarkDown editor",

View File

@ -140,6 +140,7 @@
"documentsVue": "Vue", "documentsVue": "Vue",
"documentsVite": "Vite", "documentsVite": "Vite",
"documentsVueuse": "VueUse外链", "documentsVueuse": "VueUse外链",
"documentsNova": "Nova 文档",
"permission": "权限", "permission": "权限",
"permissionDemo": "权限示例", "permissionDemo": "权限示例",
"justSuper": "super可见", "justSuper": "super可见",

View File

@ -1,7 +1,7 @@
{ {
"name": "nova-admin", "name": "nova-admin",
"type": "module", "type": "module",
"version": "0.9.6", "version": "0.9.7",
"private": true, "private": true,
"description": "a clean and concise back-end management template based on Vue3, Vite5, Typescript, and Naive UI.", "description": "a clean and concise back-end management template based on Vue3, Vite5, Typescript, and Naive UI.",
"author": { "author": {
@ -50,42 +50,41 @@
"sizecheck": "npx vite-bundle-visualizer" "sizecheck": "npx vite-bundle-visualizer"
}, },
"dependencies": { "dependencies": {
"@alova/scene-vue": "^1.6.0",
"@vueuse/core": "^10.11.0", "@vueuse/core": "^10.11.0",
"alova": "^2.21.3", "alova": "^3.0.4",
"colord": "^2.9.3", "colord": "^2.9.3",
"echarts": "^5.5.1", "echarts": "^5.5.1",
"md-editor-v3": "^4.15.2", "md-editor-v3": "^4.15.2",
"pinia": "^2.1.7", "pinia": "^2.2.0",
"pinia-plugin-persistedstate": "^3.2.1", "pinia-plugin-persistedstate": "^3.2.1",
"quill": "^2.0.2", "quill": "^2.0.2",
"radash": "^12.1.0", "radash": "^12.1.0",
"vue": "^3.4.33", "vue": "^3.4.35",
"vue-i18n": "^9.13.1", "vue-i18n": "^9.13.1",
"vue-router": "^4.4.0" "vue-router": "^4.4.2"
}, },
"devDependencies": { "devDependencies": {
"@antfu/eslint-config": "^2.23.0", "@antfu/eslint-config": "^2.24.1",
"@iconify-json/icon-park-outline": "^1.1.15", "@iconify-json/icon-park-outline": "^1.1.15",
"@iconify/vue": "^4.1.2", "@iconify/vue": "^4.1.2",
"@types/node": "^20.14.11", "@types/node": "^22.1.0",
"@vitejs/plugin-vue": "^5.0.5", "@vitejs/plugin-vue": "^5.1.2",
"@vitejs/plugin-vue-jsx": "^4.0.0", "@vitejs/plugin-vue-jsx": "^4.0.0",
"eslint": "^9.7.0", "eslint": "^9.8.0",
"lint-staged": "^15.2.7", "lint-staged": "^15.2.7",
"naive-ui": "^2.39.0", "naive-ui": "^2.39.0",
"sass": "^1.77.8", "sass": "^1.77.8",
"simple-git-hooks": "^2.11.1", "simple-git-hooks": "^2.11.1",
"typescript": "^5.5.3", "typescript": "^5.5.4",
"unocss": "^0.61.5", "unocss": "^0.61.9",
"unplugin-auto-import": "^0.18.0", "unplugin-auto-import": "^0.18.2",
"unplugin-icons": "^0.19.0", "unplugin-icons": "^0.19.1",
"unplugin-vue-components": "^0.27.3", "unplugin-vue-components": "^0.27.3",
"vite": "^5.3.4", "vite": "^5.3.5",
"vite-bundle-visualizer": "^1.2.1", "vite-bundle-visualizer": "^1.2.1",
"vite-plugin-compression": "^0.5.1", "vite-plugin-compression": "^0.5.1",
"vite-plugin-vue-devtools": "7.3.6", "vite-plugin-vue-devtools": "7.3.7",
"vue-tsc": "^2.0.26" "vue-tsc": "^2.0.29"
}, },
"simple-git-hooks": { "simple-git-hooks": {
"pre-commit": "pnpm lint-staged" "pre-commit": "pnpm lint-staged"

View File

@ -36,7 +36,7 @@ export function withoutToken() {
/* 接口数据转换 */ /* 接口数据转换 */
export function dictData() { export function dictData() {
return request.Get('/getDictData', { return request.Get('/getDictData', {
transformData(rawData, _headers) { transform(rawData, _headers) {
const response = rawData as any const response = rawData as any
return { return {
...response, ...response,
@ -61,10 +61,7 @@ export function getBlob(url: string) {
/* 带进度的下载文件 */ /* 带进度的下载文件 */
export function downloadFile(url: string) { export function downloadFile(url: string) {
const methodInstance = blankInstance.Get<Blob>(url, { const methodInstance = blankInstance.Get<Blob>(url)
// 开启下载进度
enableDownload: true,
})
methodInstance.meta = { methodInstance.meta = {
// 标识为blob数据 // 标识为blob数据
isBlob: true, isBlob: true,

View File

@ -1,7 +1,7 @@
import { createAlova } from 'alova' import { createAlova } from 'alova'
import VueHook from 'alova/vue' import VueHook from 'alova/vue'
import GlobalFetch from 'alova/GlobalFetch' import adapterFetch from 'alova/fetch'
import { createServerTokenAuthentication } from '@alova/scene-vue' import { createServerTokenAuthentication } from 'alova/client'
import { import {
handleBusinessError, handleBusinessError,
handleRefreshToken, handleRefreshToken,
@ -50,8 +50,8 @@ export function createAlovaInstance(
return createAlova({ return createAlova({
statesHook: VueHook, statesHook: VueHook,
requestAdapter: GlobalFetch(), requestAdapter: adapterFetch(),
localCache: null, cacheFor: null,
baseURL: _alovaConfig.baseURL, baseURL: _alovaConfig.baseURL,
timeout: _alovaConfig.timeout, timeout: _alovaConfig.timeout,

View File

@ -1,5 +1,5 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRequest } from 'alova' import { useRequest } from 'alova/client'
import { import {
downloadFile, downloadFile,
} from '@/service' } from '@/service'

View File

@ -15,6 +15,7 @@ async function expiredToken() {
<template> <template>
<n-card title="Token Expiration" size="small"> <n-card title="Token Expiration" size="small">
注意观察第二次的请求token已刷新
<n-button type="error" @click="expiredToken"> <n-button type="error" @click="expiredToken">
click click
</n-button> </n-button>

View File

@ -1,5 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import { useRequest } from 'alova' import { useRequest } from 'alova/client'
import { import {
fetchGet, fetchGet,
} from '@/service' } from '@/service'