diff --git a/src/components/play/SelectRegion.vue b/src/components/play/SelectRegion.vue
index 4852e6c..07f19d9 100644
--- a/src/components/play/SelectRegion.vue
+++ b/src/components/play/SelectRegion.vue
@@ -16,7 +16,7 @@
+
+
diff --git a/src/views/refund/RefundManagement.vue b/src/views/refund/RefundManagement.vue
index 787af35..cfddf57 100644
--- a/src/views/refund/RefundManagement.vue
+++ b/src/views/refund/RefundManagement.vue
@@ -187,9 +187,8 @@
- - 支持直接输入链接编号,如:
RUC74NCV
- - 支持输入完整链接URL,如:
http://localhost:5173/play?code=RUC74NCV
- - 系统会自动从URL中提取链接编号
+ - 支持直接输入链接编号,如:
6DJWZ4MA
+ - 支持粘贴完整链接URL,系统会自动识别并提取编号
- 支持使用粘贴按钮或Ctrl+V快速粘贴
@@ -343,7 +342,7 @@ export default {
// 移除首尾空格
const trimmed = input.trim()
- // 如果是URL,尝试提取code参数
+ // 方式1: 尝试从旧格式URL提取 (play?code=xxx)
try {
if (trimmed.includes('play?code=')) {
const url = new URL(trimmed)
@@ -354,23 +353,48 @@ export default {
// 如果URL解析失败,继续下面的处理
}
- // 尝试从各种URL格式中提取代码
+ // 方式2: 尝试从查询参数中提取 code=
if (trimmed.includes('code=')) {
const match = trimmed.match(/code=([^&\s]+)/)
if (match) return match[1]
}
- // 如果包含路径分隔符,取最后一个部分
+ // 方式3: 尝试从新格式URL提取 (play/CODE 或 play/CODE?t=xxx)
+ // 匹配 /play/CODE 格式,CODE后面可能跟查询参数
+ const playPathMatch = trimmed.match(/\/play\/([A-Z0-9]+)(?:\?|$|\/)/i)
+ if (playPathMatch) {
+ return playPathMatch[1]
+ }
+
+ // 方式4: 如果包含路径分隔符,取最后一个部分(去除查询参数)
if (trimmed.includes('/')) {
const parts = trimmed.split('/')
- const lastPart = parts[parts.length - 1]
+ let lastPart = parts[parts.length - 1]
+
+ // 去除查询参数部分
+ if (lastPart.includes('?')) {
+ lastPart = lastPart.split('?')[0]
+ }
+
+ // 去除hash部分
+ if (lastPart.includes('#')) {
+ lastPart = lastPart.split('#')[0]
+ }
+
if (lastPart && lastPart.length >= 6) {
return lastPart
}
}
- // 直接返回输入(假设就是代码)
- return trimmed
+ // 方式5: 直接返回输入(假设就是代码,去除可能的查询参数)
+ let result = trimmed
+ if (result.includes('?')) {
+ result = result.split('?')[0]
+ }
+ if (result.includes('#')) {
+ result = result.split('#')[0]
+ }
+ return result
}
// 查询