Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
business-assistant
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 5e74ee83
authored
Oct 12, 2022
by
李伟康
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
登录拦截
1 parent
18ef5492
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
31 additions
and
16 deletions
api/usersApi/UsersApi.js
components/NavigationBar/NavigationBar.js
login/loading/loading.js
utils/Draw.js
utils/request/request.js
api/usersApi/UsersApi.js
View file @
5e74ee8
...
...
@@ -104,5 +104,13 @@ class UsersApi {
true
)
}
/**检查sessionId 是否过期 */
checkSession
()
{
return
api
.
post
({
method
:
'scrm.api.sso.login.status.check'
},
true
)
}
}
export
default
UsersApi
\ No newline at end of file
components/NavigationBar/NavigationBar.js
View file @
5e74ee8
...
...
@@ -54,7 +54,6 @@ Component({
if
(
showBack
&&
currentPages
.
length
>
1
)
this
.
setData
({
SHOWBACK
:
true
})
console
.
log
(
currentPages
.
length
,
showBack
)
let
navigationBarHeight
=
height
+
((
top
-
statusBarHeight
)
*
2
)
+
4
// 4
let
navigationBarPadding
=
screenWidth
-
right
let
navigationBarWidth
=
screenWidth
-
(
navigationBarPadding
*
2
+
width
)
-
width
...
...
login/loading/loading.js
View file @
5e74ee8
...
...
@@ -4,6 +4,8 @@ import {
import
{
getSessionId
,
}
from
'~/utils/cache/storageApi'
import
USERAPI
from
'~/api/usersApi/index'
Page
({
/**
...
...
@@ -38,19 +40,23 @@ Page({
targetPath
=
url
?
decodeURIComponent
(
url
)
:
''
}
=
this
.
options
wx
.
nextTick
(()
=>
{
wx
.
hideLoading
()
let
path
=
'pages.index'
,
obj
=
{}
if
(
targetPath
)
obj
.
targetPath
=
targetPath
if
(
sessionId
)
{
let
url
=
'pages.index'
,
obj
=
{}
if
(
targetPath
)
{
url
=
setRouteData
(
targetPath
).
url
obj
=
setRouteData
(
targetPath
).
obj
}
wx
.
$router
.
reLaunch
(
url
,
obj
)
}
else
{
let
obj
=
{}
if
(
targetPath
)
obj
.
targetPath
=
targetPath
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
}
USERAPI
.
checkSession
().
then
(({
code
})
=>
{
if
(
code
==
'0'
)
{
if
(
targetPath
)
{
path
=
setRouteData
(
targetPath
).
url
obj
=
setRouteData
(
targetPath
).
obj
}
wx
.
$router
.
reLaunch
(
path
,
obj
)
}
else
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
}
)
}
else
wx
.
$router
.
reLaunch
(
'login.index'
,
obj
)
})
},
...
...
utils/Draw.js
View file @
5e74ee8
...
...
@@ -310,7 +310,6 @@ class Draw {
}
return
type
[
textDecoration
][
textBaseline
]
}
setLineX
({
textAlign
,
text
,
...
...
@@ -324,7 +323,6 @@ class Draw {
}
return
type
[
textAlign
]
}
drawRadiusRect
({
borderRadius
,
height
,
...
...
utils/request/request.js
View file @
5e74ee8
...
...
@@ -46,7 +46,11 @@ class Request {
data
}
=
response
if
(
code
==
20
||
code
==
21
)
{
//重新登录
const
thisPage
=
wx
.
$router
.
getPageInstance
()
if
(
thisPage
.
route
==
'login/loading/loading'
)
{
resolve
(
data
)
return
}
else
wx
.
$router
.
reLaunch
(
'login.index'
)
}
else
{
if
(
returnAll
)
{
resolve
(
data
)
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment