Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pptist
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
viitto
pptist
Commits
4ad9d894
Commit
4ad9d894
authored
May 22, 2024
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增健康检测机制
parent
70343bb6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
1 deletion
+18
-1
App.vue
src/App.vue
+13
-1
UserService.ts
src/services/UserService.ts
+5
-0
No files found.
src/App.vue
View file @
4ad9d894
...
...
@@ -6,14 +6,16 @@
<
script
lang=
"ts"
setup
>
import
{
onMounted
,
ref
,
provide
}
from
'vue'
;
import
{
deleteDiscardedDB
}
from
'./utils/database'
;
import
{
useFontStore
,
useMainStore
,
useSnapshotStore
}
from
'@/store'
import
{
useFontStore
,
useMainStore
,
useSnapshotStore
,
useUserStore
}
from
'@/store'
import
{
LOCALSTORAGE_KEY_DISCARDED_DB
}
from
'@/configs/storage'
;
import
{
storeToRefs
}
from
'pinia'
;
import
{
injectKeyTemplate
}
from
'./types/injectKey'
;
import
UserServices
from
'./services/UserService'
;
const
snapshotStore
=
useSnapshotStore
()
const
mainStore
=
useMainStore
()
const
{
databaseId
}
=
storeToRefs
(
mainStore
)
const
{
token
}
=
storeToRefs
(
useUserStore
())
const
searchData
=
ref
({}
as
any
)
provide
(
injectKeyTemplate
,
searchData
)
const
autoSave
=
ref
(
0
)
...
...
@@ -38,6 +40,16 @@ window.addEventListener('unload', () => {
localStorage
.
setItem
(
LOCALSTORAGE_KEY_DISCARDED_DB
,
newDiscardedDB
)
})
useFontStore
().
loadAllFonts
()
const
healthCheckHandler
=
async
()
=>
{
if
(
token
.
value
&&
token
.
value
!=
''
){
await
UserServices
.
CollectAsync
()
}
}
setInterval
(()
=>
{
healthCheckHandler
()
},
1000
*
60
)
</
script
>
<
style
lang=
"scss"
>
...
...
src/services/UserService.ts
View file @
4ad9d894
...
...
@@ -7,6 +7,11 @@ class UserServices{
let
msg
=
{
t
}
return
Api
.
Post
(
"travel_auto_login"
,
msg
)
}
static
async
CollectAsync
():
Promise
<
HttpResponse
>
{
let
msg
=
{}
return
Api
.
Post
(
"travel_collect"
,
msg
)
}
static
async
PasswordLoginAsync
(
account
:
string
,
pwd
:
string
,
tid
:
string
=
''
):
Promise
<
HttpResponse
>
{
let
msg
=
{
account
,
pwd
,
tid
}
...
...
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