@axiosleo/koapp
Advanced tools
@@ -22,3 +22,3 @@ { | ||
| "dependencies": { | ||
| "@axiosleo/koapp": "^1.1.0", | ||
| "@axiosleo/koapp": "^1.1.1", | ||
| "@axiosleo/orm-mysql": "^0.11.2", | ||
@@ -25,0 +25,0 @@ "cluster": "^0.7.7", |
+1
-1
@@ -12,3 +12,3 @@ #!/usr/bin/env node | ||
| bin: 'koapp', | ||
| version: '1.1.0', | ||
| version: '1.1.1', | ||
| commands_dir: path.join(__dirname, '../commands'), | ||
@@ -15,0 +15,0 @@ }); |
+23
-4
@@ -121,4 +121,4 @@ 'use strict'; | ||
| const url = new URL(context.url, 'http://localhost'); | ||
| let d = path.join(dir, url.pathname); | ||
| printer.yellow(_fixed('[' + context.method + ']', 12, 'r')).green(context.url).println(); | ||
| let d = path.join(dir, decodeURIComponent(url.pathname)); | ||
| printer.yellow(_fixed('[' + context.method + ']', 12, 'r')).green(decodeURIComponent(context.url)).println(); | ||
| if (!await _exists(d)) { | ||
@@ -204,4 +204,18 @@ if (!this.html404Content) { | ||
| if (url.pathname !== '/') { | ||
| // 计算正确的上级目录路径 | ||
| let parentPath = url.pathname; | ||
| // 移除末尾的斜杠(如果有) | ||
| if (parentPath.endsWith('/')) { | ||
| parentPath = parentPath.slice(0, -1); | ||
| } | ||
| // 获取上级目录路径 | ||
| const lastSlashIndex = parentPath.lastIndexOf('/'); | ||
| parentPath = lastSlashIndex > 0 ? parentPath.substring(0, lastSlashIndex) : '/'; | ||
| // 确保路径以斜杠结尾(除了根目录) | ||
| if (parentPath !== '/' && !parentPath.endsWith('/')) { | ||
| parentPath += '/'; | ||
| } | ||
| fileItemsHTML += ` | ||
| <div class="file-item" data-type="folder" onclick="window.location.href='../'"> | ||
| <div class="file-item" data-type="folder" onclick="window.location.href='${parentPath}'"> | ||
| <div class="file-icon folder">📁</div> | ||
@@ -218,3 +232,8 @@ <div class="file-info"> | ||
| let p = url.pathname === '/' ? '.' : url.pathname; | ||
| p = p + '/' + f.filename; | ||
| // 确保路径正确拼接,避免双斜杠 | ||
| if (p.endsWith('/')) { | ||
| p = p + f.filename; | ||
| } else { | ||
| p = p + '/' + f.filename; | ||
| } | ||
| const fileType = this.getFileType(f.filename, f.is_dir, f.ext); | ||
@@ -221,0 +240,0 @@ const fileIcon = this.getFileIcon(fileType); |
+1
-1
| { | ||
| "name": "@axiosleo/koapp", | ||
| "version": "1.1.0", | ||
| "version": "1.1.1", | ||
| "description": "", | ||
@@ -5,0 +5,0 @@ "author": "AxiosLeo", |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
155890
0.52%4050
0.45%4
-20%