Bladeren bron

fix(mobile): 修复下载页静态资源路径(Web 2.4.440)

Co-authored-by: Cursor <cursoragent@cursor.com>
YY968XX 1 dag geleden
bovenliggende
commit
10011e7586

+ 1 - 1
Web/package.json

@@ -1,7 +1,7 @@
 {
 {
 	"name": "admin.net",
 	"name": "admin.net",
 	"type": "module",
 	"type": "module",
-	"version": "2.4.439",
+	"version": "2.4.440",
 	"packageManager": "pnpm@10.32.1",
 	"packageManager": "pnpm@10.32.1",
 	"lastBuildTime": "2026.03.15",
 	"lastBuildTime": "2026.03.15",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",
 	"description": "Admin.NET 站在巨人肩膀上的 .NET 通用权限开发框架",

+ 5 - 5
Web/src/views/app/downloadEntry.spec.ts

@@ -4,19 +4,19 @@ import { buildAppDownloadPageUrl, resolveAppDownloadHashEntry } from './download
 describe('APP download browser handoff entry', () => {
 describe('APP download browser handoff entry', () => {
 	it('builds a hash-free QR URL that external browsers preserve', () => {
 	it('builds a hash-free QR URL that external browsers preserve', () => {
 		expect(buildAppDownloadPageUrl('https://42.236.69.208/', 'a+b_c')).toBe(
 		expect(buildAppDownloadPageUrl('https://42.236.69.208/', 'a+b_c')).toBe(
-			'https://42.236.69.208/app/download?t=a%2Bb_c',
+			'https://42.236.69.208/app-download?t=a%2Bb_c',
 		);
 		);
 	});
 	});
 
 
 	it('restores the internal hash route while preserving the outer path and ticket', () => {
 	it('restores the internal hash route while preserving the outer path and ticket', () => {
-		expect(resolveAppDownloadHashEntry('/app/download', '?t=a%2Bb_c', '')).toBe(
-			'/app/download?t=a%2Bb_c#/app/download?t=a%2Bb_c',
+		expect(resolveAppDownloadHashEntry('/app-download', '?t=a%2Bb_c', '')).toBe(
+			'/app-download?t=a%2Bb_c#/app/download?t=a%2Bb_c',
 		);
 		);
 	});
 	});
 
 
 	it('does not rewrite unrelated or already-restored locations', () => {
 	it('does not rewrite unrelated or already-restored locations', () => {
 		expect(resolveAppDownloadHashEntry('/', '?t=token', '')).toBeNull();
 		expect(resolveAppDownloadHashEntry('/', '?t=token', '')).toBeNull();
-		expect(resolveAppDownloadHashEntry('/app/download', '?t=token', '#/app/download?t=token')).toBeNull();
-		expect(resolveAppDownloadHashEntry('/app/download', '', '')).toBeNull();
+		expect(resolveAppDownloadHashEntry('/app-download', '?t=token', '#/app/download?t=token')).toBeNull();
+		expect(resolveAppDownloadHashEntry('/app-download', '', '')).toBeNull();
 	});
 	});
 });
 });

+ 1 - 1
Web/src/views/app/downloadEntry.ts

@@ -1,4 +1,4 @@
-export const APP_DOWNLOAD_ENTRY_PATH = '/app/download';
+export const APP_DOWNLOAD_ENTRY_PATH = '/app-download';
 
 
 export function buildAppDownloadPageUrl(origin: string, ticket: string): string {
 export function buildAppDownloadPageUrl(origin: string, ticket: string): string {
 	const url = new URL(APP_DOWNLOAD_ENTRY_PATH, origin);
 	const url = new URL(APP_DOWNLOAD_ENTRY_PATH, origin);

+ 2 - 2
docker/nginx/default.conf

@@ -8,7 +8,7 @@ server {
     gzip on;
     gzip on;
     gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
     gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
 
 
-    location = /app/download {
+    location = /app-download {
         access_log off;
         access_log off;
         add_header Cache-Control "no-store" always;
         add_header Cache-Control "no-store" always;
         add_header X-Content-Type-Options "nosniff" always;
         add_header X-Content-Type-Options "nosniff" always;
@@ -68,7 +68,7 @@ server {
     gzip on;
     gzip on;
     gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
     gzip_types text/plain text/css application/json application/javascript application/xml image/svg+xml;
 
 
-    location = /app/download {
+    location = /app-download {
         access_log off;
         access_log off;
         add_header Cache-Control "no-store" always;
         add_header Cache-Control "no-store" always;
         add_header Strict-Transport-Security "max-age=31536000" always;
         add_header Strict-Transport-Security "max-age=31536000" always;

+ 1 - 1
server/Admin.NET.Test/Security/AppReleaseSecurityTests.cs

@@ -220,7 +220,7 @@ public class AppReleaseSecurityTests
         var root = FindRepositoryRoot();
         var root = FindRepositoryRoot();
         var nginx = File.ReadAllText(Path.Combine(root, "docker", "nginx", "default.conf"));
         var nginx = File.ReadAllText(Path.Combine(root, "docker", "nginx", "default.conf"));
         var appReleaseLocations = nginx.Split("location ^~ /prod-api/api/sysAppRelease/ {", StringSplitOptions.None);
         var appReleaseLocations = nginx.Split("location ^~ /prod-api/api/sysAppRelease/ {", StringSplitOptions.None);
-        var downloadPageLocations = nginx.Split("location = /app/download {", StringSplitOptions.None);
+        var downloadPageLocations = nginx.Split("location = /app-download {", StringSplitOptions.None);
 
 
         Assert.True(appReleaseLocations.Length >= 3);
         Assert.True(appReleaseLocations.Length >= 3);
         Assert.All(appReleaseLocations.Skip(1), location =>
         Assert.All(appReleaseLocations.Skip(1), location =>