Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tabulator-another-web
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
tabulator-another-web
Commits
6c72db9f
Commit
6c72db9f
authored
May 19, 2025
by
xiaoye
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
更好的匹配url方法
parent
02e6308a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
src/pages/main.vue
src/pages/main.vue
+6
-3
src/pages/tournament.vue
src/pages/tournament.vue
+4
-7
No files found.
src/pages/main.vue
View file @
6c72db9f
...
@@ -275,7 +275,7 @@
...
@@ -275,7 +275,7 @@
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
500
)));
page
.
tournament
=
true
;
page
.
tournament
=
true
;
const
url
=
window
.
location
.
href
.
split
(
'
/?
'
);
const
url
=
window
.
location
.
href
.
split
(
'
/?
'
);
window
.
location
.
replace
(
`
${
url
[
0
]
}
/tournament/
${
search
.
result
.
tournaments
[
v
].
id
}
/?
${
url
[
1
]
??
''
}
`)
window
.
location
.
replace
(
`
${
url
[
0
]
.
replace
(
/
\/?
$/
,
''
)}
/tournament/
${
search
.
result
.
tournaments
[
v
].
id
}${
url
[
1
]
?
`/?
${
url
[
1
]}
`
:
''
}
`
);
},
},
menu
:
async
():
Promise
<
void
>
=>
{
menu
:
async
():
Promise
<
void
>
=>
{
page
.
tournament
=
false
;
page
.
tournament
=
false
;
...
@@ -535,12 +535,15 @@
...
@@ -535,12 +535,15 @@
// @ts-ignore
// @ts-ignore
emitter
.
on
(
tournamentReload
,
tournament
.
init
);
emitter
.
on
(
tournamentReload
,
tournament
.
init
);
const url = window.location.
href.match(/tournament\/(\d+)[^\/]*\/\?
/);
const
url
=
window
.
location
.
pathname
.
match
(
/
\/
tournament
\/([^\/]
+
)(?=\/
|$
)
/
);
if
(
url
&&
!
isNaN
(
parseInt
(
url
[
1
])))
{
if
(
url
&&
!
isNaN
(
parseInt
(
url
[
1
])))
{
page
.
menu
=
false
;
page
.
menu
=
false
;
page
.
tournament
=
true
;
page
.
tournament
=
true
;
}
else
{
}
else
{
search.on();
if
(
window
.
location
.
pathname
.
length
>
1
)
window
.
location
.
replace
(
window
.
location
.
href
.
replace
(
window
.
location
.
pathname
,
''
))
else
search
.
on
();
}
}
});
});
...
...
src/pages/tournament.vue
View file @
6c72db9f
...
@@ -329,12 +329,9 @@
...
@@ -329,12 +329,9 @@
height
:
0
,
height
:
0
,
loading
:
false
,
loading
:
false
,
clear
:
async
()
:
Promise
<
void
>=>
{
clear
:
async
()
:
Promise
<
void
>=>
{
const
url
=
window
.
location
.
href
.
match
(
/
(\/
tournament
\/[^\/]
+
)(?=\/\?)
/
);
tournament
.
this
=
undefined
;
if
(
url
)
{
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
450
)));
tournament
.
this
=
undefined
;
window
.
location
.
replace
(
window
.
location
.
href
.
replace
(
window
.
location
.
pathname
,
''
))
await
(
new
Promise
(
resolve
=>
setTimeout
(
resolve
,
450
)));
window
.
location
.
replace
(
window
.
location
.
href
.
replace
(
url
[
1
],
''
));
}
}
,
}
,
get
:
async
(
id
:
number
)
:
Promise
<
void
>
=>
{
get
:
async
(
id
:
number
)
:
Promise
<
void
>
=>
{
const
t
=
await
Tabulator
.
Tournament
.
Find
(
Mycard
.
token
,
id
);
const
t
=
await
Tabulator
.
Tournament
.
Find
(
Mycard
.
token
,
id
);
...
@@ -377,7 +374,7 @@
...
@@ -377,7 +374,7 @@
}
);
}
);
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
const
url
=
window
.
location
.
href
.
match
(
/tournament
\/(\d
+
)[^\/]
*
\/\?
/
);
const
url
=
window
.
location
.
pathname
.
match
(
/
\/
tournament
\/([^\/]
+
)(?=\/
|$
)
/
);
url
&&
!
isNaN
(
parseInt
(
url
[
1
]))
?
page
.
get
(
parseInt
(
url
[
1
]))
:
page
.
clear
();
url
&&
!
isNaN
(
parseInt
(
url
[
1
]))
?
page
.
get
(
parseInt
(
url
[
1
]))
:
page
.
clear
();
// @ts-ignore
// @ts-ignore
emitter
.
on
(
updateTournament
,
participant
.
update
);
emitter
.
on
(
updateTournament
,
participant
.
update
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment