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
772bb099
You need to sign in or sign up before continuing.
Commit
772bb099
authored
Apr 14, 2025
by
lei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:首页跳转地址,用户登录授权等问题
parent
95ab0b39
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
26 deletions
+38
-26
index.html
index.html
+3
-4
http.js
sdk/http.js
+8
-8
apiKeyMap.js
sdk/jssdk2/apiKeyMap.js
+1
-1
index.js
sdk/jssdk2/index.js
+26
-13
No files found.
index.html
View file @
772bb099
...
...
@@ -29,10 +29,10 @@
<body>
<!-- 获取授权用户信息 本地token等操作 -->
<
!-- <
script
<script
type=
"text/javascript"
src=
"sdk/jssdk2/index.js"
></script>
-->
></script>
<div
id=
"app"
...
...
@@ -107,8 +107,7 @@
@
click=
"showPopup('showPopup4completionDate')"
style=
"position: absolute; top: -0.08rem; right: 0.4rem"
>
<span
class=
"formValue"
>
{{showDate|formatterData}}
</span
><van-icon
name=
"arrow-down"
/>
<span
class=
"formValue"
>
{{showDate|formatterData}}
</span><van-icon
name=
"arrow-down"
/>
</div>
<van-popup
v-model=
"showPopup4completionDate"
...
...
sdk/http.js
View file @
772bb099
...
...
@@ -39,9 +39,9 @@ var http2 = {
}
// if (gemhoUtil.getCookie('token')) {
extraData
.
header
=
{
//
Authorization: gemhoUtil.getCookie('token')
Authorization
:
'
Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiMTU4YjM0M2MtNTFmMS00ZDYzLTk0ZWUtNzcxZWRkYTAxMjFmIn0.ehBDVx2ldKNypKcQ4Vnzzii7Dy9El8gRBRQ1Fs_Lq0tkp-zCxSHoEesF5YsWD5weKSaYdAYj_3gXQk-P832QrA
'
,
Authorization
:
gemhoUtil
.
getCookie
(
'
token
'
)
//
Authorization:
//
'Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJhZG1pbiIsImxvZ2luX3VzZXJfa2V5IjoiMTU4YjM0M2MtNTFmMS00ZDYzLTk0ZWUtNzcxZWRkYTAxMjFmIn0.ehBDVx2ldKNypKcQ4Vnzzii7Dy9El8gRBRQ1Fs_Lq0tkp-zCxSHoEesF5YsWD5weKSaYdAYj_3gXQk-P832QrA',
// }
}
...
...
sdk/jssdk2/apiKeyMap.js
View file @
772bb099
sdk/jssdk2/index.js
View file @
772bb099
...
...
@@ -7,6 +7,7 @@ window.onload = function () {
// loadingType: 'spinner',
// });
// if(!localStorage.getItem('token')){
if
(
!
gemhoUtil
.
getCookie
(
'
token
'
))
{
getUserInfo
()
}
...
...
@@ -19,7 +20,7 @@ function getUserInfo() {
loadingType
:
'
spinner
'
,
})
lightAppJssdk
.
user
.
getUserInfoWithEncryptedParamByAppId
({
appId
:
'
gqyjglptxiefn
'
,
//"gqyjglptxiefn", // 接入方在成功创建应用后自动生成
appId
:
'
whsdsjzxsfrzdjqwsczptsr
'
,
//"gqyjglptxiefn", // 接入方在成功创建应用后自动生成
success
:
async
(
data
)
=>
{
if
(
data
==
'
未登录
'
)
onLoginApp
()
else
{
...
...
@@ -34,6 +35,8 @@ function getUserInfo() {
})
return
}
console
.
log
(
data
,
'
用户授权请求成功的数据
'
);
if
(
typeof
data
==
'
string
'
)
data
=
JSON
.
parse
(
data
)
// console.log('用户授权请求成功的数据', data)
...
...
@@ -52,11 +55,11 @@ function getUserInfo() {
let
aes_encrypt_result
=
sm2_decrypt_result
.
data
let
aes_decrypt_result
=
aes_Decrypt
(
aes_encrypt_result
,
appword
)
if
(
!
aes_decrypt_result
)
{
//
console.log('授权用户信息为空')
console
.
log
(
'
授权用户信息为空
'
)
return
}
let
tempResult
=
JSON
.
parse
(
aes_decrypt_result
)
//
console.log('授权用户信息', tempResult)
console
.
log
(
'
授权用户信息
'
,
tempResult
)
let
reqParammm
=
{
sex
:
tempResult
.
sex
,
mobile
:
tempResult
.
mobile
,
...
...
@@ -70,27 +73,37 @@ function getUserInfo() {
// 请求获取高区应急后台真是token,传参,授权获取的用户信息
http2
.
post
(
{
serviceId
:
'
gqyjglptbind
'
,
interfacePublicKey
:
'
0450567ffc64139658baa28c5c9bc0415200b476baa3bcc3f9dc9dbbf8dbcff2fb5e93319127685469c84784d235220c0347e695fbf66c5ffede33e645bea8b3f0
'
,
interfacePrivateKey
:
'
00b92f5f2a7c40cb07d225f2e90df9b8b23569658e4f9e04dd0a4bf4a5b374063b
'
,
serviceId
:
API_KEY_MAP
[
'
login
'
][
'
id
'
],
interfacePublicKey
:
API_KEY_MAP
[
'
login
'
][
'
publicKey
'
],
interfacePrivateKey
:
API_KEY_MAP
[
'
login
'
][
'
privateKey
'
],
reqParams
:
reqParammm
,
},
function
(
res
)
{
if
(
res
)
{
//
console.log('sdk2用户信息绑定接口回调数据', JSON.parse(res))
console
.
log
(
'
sdk2用户信息绑定接口回调数据
'
,
JSON
.
parse
(
res
))
var
result
=
JSON
.
parse
(
res
)
// 存储后台返回token存储本地localstorage
// localStorage.setItem('token', result.token)
if
(
result
.
code
==
200
)
{
gemhoUtil
.
setCookie
(
'
token
'
,
result
.
token
,
1
)
// 存储1天后过期
}
else
if
(
result
.
code
==
500
)
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
'
服务器错误,请联系管理员
'
,
})
}
else
{
vant
.
Dialog
.
alert
({
title
:
'
信息提示
'
,
message
:
result
.
msg
,
})
}
}
vant
.
Toast
.
clear
()
}
)
}
},
fail
:
function
(
data
)
{},
fail
:
function
(
data
)
{
},
})
}
...
...
@@ -148,8 +161,8 @@ function onLoginApp() {
*/
function
oncloseWindow
()
{
lightAppJssdk
.
navigation
.
close
({
success
:
function
(
data
)
{},
fail
:
function
(
data
)
{},
success
:
function
(
data
)
{
},
fail
:
function
(
data
)
{
},
})
}
...
...
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