diff --git a/package.json b/package.json index 9019548..4cb1b13 100644 --- a/package.json +++ b/package.json @@ -28,7 +28,7 @@ "unplugin-auto-import": "^19.3.0", "unplugin-vue-components": "^28.8.0", "vue": "^3.5.17", - "vue-i18n": "12.0.0-alpha.2", + "vue-i18n": "9.14.3", "vue-router": "^4.5.1" }, "devDependencies": { diff --git a/src/main/java/com/mingliqiye/disk/controller/IndexController.java b/src/main/java/com/mingliqiye/disk/controller/IndexController.java index 74a9e6d..d9718d5 100644 --- a/src/main/java/com/mingliqiye/disk/controller/IndexController.java +++ b/src/main/java/com/mingliqiye/disk/controller/IndexController.java @@ -1,8 +1,10 @@ package com.mingliqiye.disk.controller; +import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.tags.Tag; import java.io.InputStream; import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBody; @@ -11,8 +13,8 @@ import org.springframework.web.servlet.mvc.method.annotation.StreamingResponseBo @RequestMapping @Tag(name = "前端路由", description = "统一匹配路径指向VueRouter") public class IndexController { - - @RequestMapping(value = { "/", "/{path:^(?!static|apis|blob).*$}/**" }) + @Operation(summary = "VueRouter 主路由") + @GetMapping(value = { "/", "/{path:^(?!static|apis|blob).*$}/**" }) public ResponseEntity index() { StreamingResponseBody streamingResponseBody = s -> { try (InputStream stream = this.getClass().getResourceAsStream("/html/index.html")) { diff --git a/web-src/assets/index.sass b/web-src/assets/index.sass index c54d6be..d3b2e22 100644 --- a/web-src/assets/index.sass +++ b/web-src/assets/index.sass @@ -6,6 +6,7 @@ .n-collapse-item__header padding-top: 0 !important +.n-collapse-item__header-main padding-left: 10px !important .n-collapse-item__content-wrapper diff --git a/web-src/assets/index.scss b/web-src/assets/index.scss index f2f2e51..6e830c8 100644 --- a/web-src/assets/index.scss +++ b/web-src/assets/index.scss @@ -9,11 +9,13 @@ html { color: #3c3c3c; + --text-color: 60, 60, 60; font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "微软雅黑", Arial, sans-serif; } html.dark { color: #d5d5d5; + --text-color: 213, 213, 213; } .swagger-ui .info { diff --git a/web-src/components/OpenApiDoc.vue b/web-src/components/OpenApiDoc.vue index 812fc3c..5cc250c 100644 --- a/web-src/components/OpenApiDoc.vue +++ b/web-src/components/OpenApiDoc.vue @@ -45,13 +45,13 @@ - + - + @@ -105,7 +107,10 @@ import OpenApiDocSecuritySchemes from '@/components/OpenApiDocSecuritySchemes.vu const data = ref(); const tags = ref<{ - [key: string]: { data: { [key: string]: OpenAPIV3_1.PathItemObject }; description: string }; + [key: string]: { + data: { [key: string]: OpenAPIV3_1.PathItemObject }; + description: string; + }; }>({}); export type TFunctionType = (args: string) => string; export type getApiFunType = (args: string) => PromiseLike; @@ -123,7 +128,10 @@ onMounted(() => { for (const model in models) { for (const i of models[model]?.tags) { if (!tags.value[i]) { - tags.value[i] = { data: {}, description: data.value?.tags?.find((is) => is.name === i)?.description }; + tags.value[i] = { + data: {}, + description: data.value?.tags?.find((is) => is.name === i)?.description, + }; } tags.value[i].data[pathsKey] = models; } @@ -140,8 +148,13 @@ function hashback(to: RouteLocationNormalizedGeneric) { const tab = to.hash.split('+')?.[0].replace('#', ''); setTimeout(() => { tabValue.value = tab; - document.getElementById(to.hash.replace('#', ''))?.scrollIntoView(); - }, 100); + setTimeout(()=>{ + const ele = document.getElementById(to.hash.replace('#', '')); + ele?.scrollIntoView(); + const ele2 = ele?.children[0].children[0]; + ele2?.click() + },100) + }, 100 ); } const removeAfterEach = router.afterEach(hashback); diff --git a/web-src/components/OpenApiDocMethod.vue b/web-src/components/OpenApiDocMethod.vue index c8f6d9e..6c0af44 100644 --- a/web-src/components/OpenApiDocMethod.vue +++ b/web-src/components/OpenApiDocMethod.vue @@ -28,12 +28,17 @@ +