Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
GaoQuYingJiH5-ASD
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
xinzhedeai
GaoQuYingJiH5-ASD
Commits
8f8607ed
Commit
8f8607ed
authored
Apr 15, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:登录判断,有token时直接进入界面
parent
7be58656
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
43 deletions
+14
-43
home.js
home.js
+9
-1
index.html
index.html
+2
-41
index.js
sdk/jssdk2/index.js
+3
-1
No files found.
home.js
View file @
8f8607ed
...
...
@@ -134,7 +134,7 @@ window.onload = function () {
// }
let
param
=
{
accessType
:
this
.
accessType
,
merId
:
this
.
userInfo
.
us
erId
,
merId
:
this
.
userInfo
.
m
erId
,
}
if
(
this
.
userInfo
.
userType
===
'
shop
'
)
{
param
=
{
...
...
@@ -143,6 +143,14 @@ window.onload = function () {
unitName
:
this
.
userInfo
.
unitName
,
smallPlaceTypeName
:
this
.
userInfo
.
smallPlaceTypeName
,
}
if
(
toData
==
'
check_info
'
)
{
param
=
{
...
param
,
accessType
:
'
shop
'
,
flag
:
'
ADD
'
,
pageName
:
'
home
'
,
}
}
}
let
url
=
gemhoUtil
.
setParameter
(
`src/_
${
toData
}
.html`
,
param
)
gemhoUtil
.
navigatePage
(
url
,
'
跳转中...
'
)
...
...
index.html
View file @
8f8607ed
...
...
@@ -29,46 +29,7 @@
<div
id=
"app"
class=
"page_wrapper"
>
<van-button
type=
"primary"
@
click=
"goHome"
>
进入主页
</van-button
>
<div>
{{token}}
</div>
<div>
欢迎您:{{userName}}
</div>
<van-button
type=
"primary"
@
click=
"getuserinfo"
>
获取用户信息
</van-button
>
</div>
></div>
</body>
<script>
new
Vue
({
el
:
'
#app
'
,
data
()
{
return
{
token
:
''
,
// 存储token
userName
:
''
,
}
},
mounted
()
{
// 获取token
this
.
token
=
gemhoUtil
.
getCookie
(
'
token
'
)
this
.
userName
=
gemhoUtil
.
getCookie
(
'
username
'
)
},
methods
:
{
goHome
()
{
// 跳转到主页
gemhoUtil
.
navigatePage
(
'
home.html
'
,
'
跳转中...
'
)
},
getuserinfo
()
{
this
.
token
=
gemhoUtil
.
getCookie
(
'
token
'
)
this
.
userName
=
gemhoUtil
.
getCookie
(
'
username
'
)
},
},
})
</script>
<script></script>
</html>
sdk/jssdk2/index.js
View file @
8f8607ed
...
...
@@ -10,6 +10,8 @@ window.onload = function () {
if
(
!
gemhoUtil
.
getCookie
(
'
token
'
))
{
getUserInfo
()
}
else
{
gemhoUtil
.
navigatePage
(
'
home.html
'
,
'
跳转中...
'
)
}
}
...
...
@@ -72,7 +74,6 @@ function getUserInfo() {
// loginname: 'zjb'// aes_decrypt_result.loginname
}
// 请求获取高区应急后台真是token,传参,授权获取的用户信息
gemhoUtil
.
setCookie
(
'
username
'
,
reqParammm
.
name
,
1
)
// 存储1天后过期
http2
.
post
(
{
serviceId
:
API_KEY_MAP
[
'
login
'
][
'
id
'
],
...
...
@@ -89,6 +90,7 @@ function getUserInfo() {
// localStorage.setItem('token', result.token)
if
(
result
.
code
==
200
)
{
gemhoUtil
.
setCookie
(
'
token
'
,
result
.
token
,
1
)
// 存储1天后过期
gemhoUtil
.
navigatePage
(
'
home.html
'
,
'
跳转中...
'
)
}
else
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
...
...
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