Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
U
uni-pdtravel
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
panyongping
uni-pdtravel
Commits
75f4af3b
Commit
75f4af3b
authored
Feb 28, 2023
by
潘永坪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录请求优化
parent
5060c547
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
20 deletions
+15
-20
login.vue
pages/login/login.vue
+15
-11
orderPayment.vue
pages/payment/orderPayment/orderPayment.vue
+0
-6
ourPayment.vue
pages/payment/ourPayment/ourPayment.vue
+0
-3
No files found.
pages/login/login.vue
View file @
75f4af3b
...
...
@@ -5,11 +5,21 @@
<
script
>
export
default
{
data
()
{
return
{}
return
{
timer
:
null
,
}
},
onLoad
()
{
this
.
login
()
},
// 一般页面用onUnload
// tabbar页面用onHide
onUnload
()
{
if
(
this
.
timer
)
{
clearTimeout
(
this
.
timer
)
this
.
timer
=
null
}
},
methods
:{
//---登录
login
(){
...
...
@@ -65,7 +75,7 @@ export default {
}
}
else
{
uni
.
showToast
({
title
:
res
.
message
+
'请退出并重新登录'
,
title
:
res
.
message
,
icon
:
'none'
})
}
...
...
@@ -75,16 +85,13 @@ export default {
title
:
'登录失败,请退出并重新登录'
,
icon
:
'none'
})
let
timer
=
setTimeout
(()
=>
{
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
_this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
clearTimeout
(
timer
)
})
})
}
else
{
uni
.
showToast
({
title
:
res
.
message
+
'请退出并重新登录'
,
title
:
res
.
message
,
icon
:
'none'
})
}
...
...
@@ -94,12 +101,9 @@ export default {
title
:
'登录失败,请退出并重新登录'
,
icon
:
'none'
})
let
timer
=
setTimeout
(()
=>
{
_this
.
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
clearTimeout
(
timer
)
})
})
}
}
...
...
pages/payment/orderPayment/orderPayment.vue
View file @
75f4af3b
...
...
@@ -160,12 +160,6 @@ export default {
title
:
'登录失败'
,
icon
:
'none'
})
let
timer
=
setTimeout
(()
=>
{
_this
.
login
()
},
2000
)
_this
.
$once
(
'hook:beforeDestroy'
,
()
=>
{
clearTimeout
(
timer
)
})
})
}
}
...
...
pages/payment/ourPayment/ourPayment.vue
View file @
75f4af3b
...
...
@@ -255,9 +255,6 @@
title
:
"登录失败"
,
icon
:
"none"
})
setTimeout
(()
=>
{
_this
.
login
()
},
1000
)
})
}
}
...
...
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