fix: correct Clash Verge Rev deep link parameter order to v1.8.0.7

This commit is contained in:
root 2026-04-27 22:26:22 +08:00
parent b83ad3089f
commit 605bdf1f96
3 changed files with 26 additions and 2 deletions

View file

@ -1 +1 @@
v1.8.0.6
v1.8.0.7

View file

@ -0,0 +1,24 @@
# Task Record
Date: 2026-04-27
Related Module: web/html/user.html
Change Type: Fix
## Background
The "Desktop" quick import button on `/panel/user` uses the `clash-verge://install-config` URL scheme to trigger subscription import in Clash Verge Rev. However, the Clash Verge Rev `extract_subscription_url` function in `scheme.rs` performs a raw string search for `url=` and takes everything to the end of the query string as the subscription URL. When `name` parameter is placed after `url`, the extracted URL becomes corrupted (e.g., `ENCODED_URL&name=ENCODED_NAME`), causing import to fail.
## Changes
- `web/html/user.html`: Swapped parameter order in `quickImportDesktop` method from `url=...&name=...` to `name=...&url=...`, ensuring the `url` parameter is the last query parameter so Clash Verge Rev correctly extracts only the subscription URL.
## Impact
- Only affects the Desktop (Clash Verge Rev) quick import button behavior
- No API, database, or build impact
- Android and iOS buttons unchanged
## Verification
- `gofmt -l -w .` passed with no changes to Go files
- `go vet ./...` passed
- HTML change is a one-line JS string change, no build needed
## Risks And Follow-Up
- Clash Verge Rev may fix their URL parsing in a future version; this parameter order remains compatible either way

View file

@ -235,7 +235,7 @@
this.$message.warning('{{ i18n "pages.user.noSubscription" }}');
return;
}
window.location.href = 'clash-verge://install-config?url=' + encodeURIComponent(url) + '&name=' + encodeURIComponent(this.username || 'Subscription');
window.location.href = 'clash-verge://install-config?name=' + encodeURIComponent(this.username || 'Subscription') + '&url=' + encodeURIComponent(url);
},
formatExpiryTime(timestamp) {
if (timestamp <= 0) return '{{ i18n "unlimited" }}';