Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
dj-simple
/
merchants
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 3b3b6fef
authored
Mar 27, 2025
by
huyue
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改接口请求为添加sessionId的方式
1 parent
e7596b2a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
9 deletions
js/request.js
js/request.js
View file @
3b3b6fe
...
...
@@ -29,13 +29,14 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
type
:
'post'
,
async
:
true
,
//false同步方式,true为异步方式
dataType
:
'json'
,
beforeSend
:
function
(
request
)
{
// loading = layer.load(0, {
// shade: false
// }) //0代表加载的风格,支持0-2
var
token
=
store
.
get
(
'token'
)
request
.
setRequestHeader
(
'TGT'
,
token
)
},
// beforeSend: function (request) {
// // loading = layer.load(0, {
// // shade: false
// // }) //0代表加载的风格,支持0-2
// // var token = store.get('token')
// // console.log(token, 'token');
// // request.setRequestHeader('TGT', token)
// },
complete
:
function
()
{
// layer.close(loading)
},
...
...
@@ -53,9 +54,11 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
}
function
request
(
params
,
success
,
config
,
noSignAttr
,
isOtherUrl
)
{
var
token
=
store
.
get
(
'token'
)
noSignAttr
=
noSignAttr
||
[]
params
=
params
||
{}
params
.
sessionAuth
=
'st'
// params.sessionAuth = 'st'
params
.
sessionId
=
token
config
=
config
||
{}
var
common
=
store
.
getEx
(
'external'
)
var
settings
=
helper
.
clone
(
true
,
defaultSettings
)
...
...
@@ -81,8 +84,10 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
}
else
{
msg
(
result
.
message
)
if
(
result
.
errId
==
'21'
)
{
window
.
parent
.
postMessage
({
type
:
'logout'
},
'*'
);
//TGT失效
goLogin
&&
goLogin
()
//
goLogin && goLogin()
}
}
}
...
...
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