Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mingPayMobile
Overview
Overview
Details
Activity
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
fengzhaoyu
mingPayMobile
Commits
20563565
Commit
20563565
authored
Oct 25, 2019
by
liang ce
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
token 判断问题
parent
8551d7d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
http.js
API/http.js
+1
-1
login.js
API/login.js
+2
-2
No files found.
API/http.js
View file @
20563565
...
...
@@ -15,7 +15,7 @@ const $http = (url, data, type, loadingType) => {
let
mingUserId
=
dd
.
getStorageSync
({
key
:
'mingUserId'
}).
data
// 时间戳未过期
// if(!!hasToken && ((new Date()).getTime() - hasToken.loginTime < hasToken.expires_in * 1000)){
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
)
<
1
*
1000
){
if
(
!!
hasToken
&&
((
new
Date
()).
getTime
()
-
hasToken
.
loginTime
)
<
(
hasToken
.
expires_in
-
300
)
*
1000
){
data
.
orgId
=
dd
.
corpId
;
let
sendData
=
''
;
for
(
let
key
in
data
){
...
...
API/login.js
View file @
20563565
const
login
=
()
=>
{
const
app
=
getApp
()
let
mingUserId
=
dd
.
getStorageSync
({
key
:
'mingUserId'
}).
data
// 有token
if
(
(
dd
.
getStorageSync
({
key
:
'token'
}).
data
&&
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
)
)
{
// 有token
if
(
dd
.
getStorageSync
({
key
:
'token'
}).
data
&&
dd
.
getStorageSync
({
key
:
'token'
}).
data
.
access_token
)
{
let
hasToken
=
dd
.
getStorageSync
({
key
:
'token'
}).
data
;
// token
let
expires_in
=
hasToken
.
expires_in
||
''
;
// 过期时效
let
loginTime
=
hasToken
.
expires_in
||
''
;
// 用户登陆时间
...
...
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