File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
web-service/src/main/java/cn/qaiu/lz/web/controller Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change 2121 <span style =" margin-left : 10px ;" >正在检查访问权限...</span >
2222 </div >
2323
24- <div v-if =" !loading && !authChecking && !authed " class =" playground-auth-overlay" >
24+ <div v-if =" shouldShowAuthUI " class =" playground-auth-overlay" >
2525 <div class =" playground-auth-card" >
2626 <div class =" auth-icon" >
2727 <el-icon :size =" 50" ><Lock /></el-icon >
@@ -787,6 +787,11 @@ async function parseById(
787787 const editorTheme = computed (() => {
788788 return isDarkMode .value ? ' vs-dark' : ' vs' ;
789789 });
790+
791+ // 计算属性:是否需要显示密码输入界面
792+ const shouldShowAuthUI = computed (() => {
793+ return ! loading .value && ! authChecking .value && ! authed .value ;
794+ });
790795
791796 // 编辑器配置
792797 const editorOptions = {
@@ -1613,6 +1618,7 @@ curl "${baseUrl}/json/parser?url=${encodeURIComponent(exampleUrl)}"</pre>
16131618 testing,
16141619 isDarkMode,
16151620 editorTheme,
1621+ shouldShowAuthUI,
16161622 editorOptions,
16171623 // 加载和认证
16181624 loading,
Original file line number Diff line number Diff line change @@ -311,10 +311,17 @@ public Future<JsonObject> test(RoutingContext ctx) {
311311 /**
312312 * 获取types.js文件内容
313313 *
314+ * @param ctx 路由上下文
314315 * @param response HTTP响应
315316 */
316317 @ RouteMapping (value = "/types.js" , method = RouteMethod .GET )
317- public void getTypesJs (HttpServerResponse response ) {
318+ public void getTypesJs (RoutingContext ctx , HttpServerResponse response ) {
319+ // 权限检查
320+ if (!checkAuth (ctx )) {
321+ ResponseUtil .fireJsonResultResponse (response , JsonResult .error ("未授权访问" ));
322+ return ;
323+ }
324+
318325 try (InputStream inputStream = getClass ().getClassLoader ()
319326 .getResourceAsStream ("custom-parsers/types.js" )) {
320327
You can’t perform that action at this time.
0 commit comments