Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
h5
/
account
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 4a57188e
authored
Aug 09, 2021
by
limin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改获取TGT逻辑
1 parent
b6aa5d56
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
8 deletions
css/main.css
js/load.js
js/request.js
css/main.css
View file @
4a57188
...
@@ -89,7 +89,8 @@ header {
...
@@ -89,7 +89,8 @@ header {
main
{
main
{
flex
:
1
;
flex
:
1
;
min-height
:
calc
(
100%
-
60px
-
30px
);
/* min-height: calc(100% - 60px - 30px); */
min-height
:
calc
(
100%
-
60px
);
overflow
:
auto
;
overflow
:
auto
;
background-color
:
#f8f8f8
;
background-color
:
#f8f8f8
;
}
}
...
...
js/load.js
View file @
4a57188
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Author: limin
* @Date: 2021-07-15 15:46:53
* @Date: 2021-07-15 15:46:53
* @LastEditors: limin
* @LastEditors: limin
* @LastEditTime: 2021-0
7-23 15:23:54
* @LastEditTime: 2021-0
8-09 11:16:28
* @FilePath: \account\js\load.js
* @FilePath: \account\js\load.js
*/
*/
;(
function
load
()
{
;(
function
load
()
{
...
@@ -32,21 +32,41 @@ function loadLayConfig() {
...
@@ -32,21 +32,41 @@ function loadLayConfig() {
})
})
}
}
function
loadHeaderFooter
()
{
function
loadHeaderFooter
()
{
isAppend
()
&&
append
()
layui
.
use
([
'store'
],
function
()
{
var
isExternal
=
isAppend
()
var
store
=
layui
.
store
if
(
isExternal
){
//运营平台外部系统
append
()
}
else
{
//嵌入运营平台
var
token
=
store
.
get
(
'token'
)
if
(
token
||
isLoginPage
()){
return
}
var
t
=
qs
(
't'
)
if
(
!
t
){
throw
new
Error
(
'未获取到TGT,请检测'
)
}
store
.
set
(
'token'
,
sessionId
)
}
})
}
}
function
append
()
{
function
append
()
{
var
$
=
layui
.
$
var
$
=
layui
.
$
var
header
=
document
.
createElement
(
'header'
)
var
header
=
document
.
createElement
(
'header'
)
var
footer
=
document
.
createElement
(
'footer'
)
var
footer
=
document
.
createElement
(
'footer'
)
$
(
header
).
load
(
'/html/components/header.html'
)
$
(
header
).
load
(
'/html/components/header.html'
)
$
(
footer
).
load
(
'/html/components/footer.html'
)
//
$(footer).load('/html/components/footer.html')
$
(
'main'
).
before
(
header
).
after
(
footer
)
$
(
'main'
).
before
(
header
).
after
(
footer
)
}
}
function
isAppend
()
{
function
isAppend
()
{
return
!
isLoginPage
()
&&
self
==
top
}
function
isLoginPage
(){
var
_href
=
location
.
href
.
split
(
'/'
)
var
_href
=
location
.
href
.
split
(
'/'
)
var
_path
=
_href
.
slice
(
_href
.
length
-
1
,
_href
.
length
).
toString
()
var
_path
=
_href
.
slice
(
_href
.
length
-
1
,
_href
.
length
).
toString
()
return
_path
.
split
(
'?'
)[
0
]
!==
'login.html'
&&
self
==
top
return
_path
.
split
(
'?'
)[
0
]
===
'login.html'
}
}
function
loadConfig
()
{
function
loadConfig
()
{
...
@@ -57,7 +77,7 @@ function loadConfig() {
...
@@ -57,7 +77,7 @@ function loadConfig() {
}
}
var
ajax
=
layui
.
$
.
ajax
var
ajax
=
layui
.
$
.
ajax
ajax
({
ajax
({
url
:
'http
://192.168.3.171:7300
/mock/5be17454f31545347559d499/config/glsx-oss-account-config'
,
url
:
'http
s://oss-config.test.glsx.com.cn
/mock/5be17454f31545347559d499/config/glsx-oss-account-config'
,
async
:
false
,
async
:
false
,
success
:
function
(
res
)
{
success
:
function
(
res
)
{
store
.
setEx
(
'external'
,
res
.
external
,
10
*
60
*
1000
)
store
.
setEx
(
'external'
,
res
.
external
,
10
*
60
*
1000
)
...
...
js/request.js
View file @
4a57188
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
* @Author: limin
* @Author: limin
* @Date: 2021-07-19 10:15:48
* @Date: 2021-07-19 10:15:48
* @LastEditors: limin
* @LastEditors: limin
* @LastEditTime: 2021-0
7-22 17:45:23
* @LastEditTime: 2021-0
8-09 10:52:59
* @FilePath: \account\js\request.js
* @FilePath: \account\js\request.js
*/
*/
layui
.
define
([
'sha1'
,
'md5'
,
'helper'
],
function
(
exports
)
{
layui
.
define
([
'sha1'
,
'md5'
,
'helper'
],
function
(
exports
)
{
...
@@ -34,7 +34,7 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
...
@@ -34,7 +34,7 @@ layui.define(['sha1', 'md5', 'helper'], function (exports) {
shade
:
false
shade
:
false
})
//0代表加载的风格,支持0-2
})
//0代表加载的风格,支持0-2
var
token
=
store
.
get
(
'token'
)
var
token
=
store
.
get
(
'token'
)
request
.
setRequestHeader
(
'
sessionId
'
,
token
)
request
.
setRequestHeader
(
'
TGT
'
,
token
)
},
},
complete
:
function
()
{
complete
:
function
()
{
layer
.
close
(
loading
)
layer
.
close
(
loading
)
...
...
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