Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lcj-btp-java-app
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
郭智朋
lcj-btp-java-app
Commits
d0d0e2ab
Commit
d0d0e2ab
authored
Jan 29, 2025
by
guozhipeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录
parent
04722f7e
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
57 deletions
+19
-57
orders.zip
app/orders/dist/orders.zip
+0
-0
BaseController.js
app/router/main/webapp/controller/BaseController.js
+6
-27
Login.controller.js
app/router/main/webapp/controller/Login.controller.js
+1
-18
config.json
app/router/main/webapp/mockdata/config.json
+1
-1
orders.zip
app/router/orders/dist/orders.zip
+0
-0
xs-app.json
app/router/xs-app.json
+2
-2
OperateAuthFilter.java
...stomer/lianchuangjie/common/filter/OperateAuthFilter.java
+9
-9
No files found.
app/orders/dist/orders.zip
View file @
d0d0e2ab
No preview for this file type
app/router/main/webapp/controller/BaseController.js
View file @
d0d0e2ab
...
@@ -287,35 +287,14 @@ sap.ui.define(
...
@@ -287,35 +287,14 @@ sap.ui.define(
// initDict(){},
// initDict(){},
getBaseUrl
()
{
getBaseUrl
()
{
let
that
=
this
;
let
that
=
this
;
if
(
location
.
host
===
'localhost:8089'
){
// that.getSessionStorage().put('baseUrlCache', '');
}
let
baseUrlCache
=
this
.
getSessionStorage
().
get
(
'baseUrlCache'
);
let
baseUrlCache
=
this
.
getSessionStorage
().
get
(
'baseUrlCache'
);
if
(
this
.
isEmpty
(
baseUrlCache
))
{
if
(
this
.
isEmpty
(
baseUrlCache
))
{
jQuery
.
ajax
(
sap
.
ui
.
require
.
toUrl
(
"sap/ui/demo/mock/config.json"
),
{
var
protocol
=
window
.
location
.
protocol
;
dataType
:
"json"
,
var
hostname
=
window
.
location
.
hostname
;
async
:
false
,
var
port
=
window
.
location
.
port
?
':'
+
window
.
location
.
port
:
''
;
// 如果端口号不是默认,则添加':'和端口号
success
:
function
(
oData
)
{
baseUrlCache
=
protocol
+
'//'
+
hostname
+
port
+
"/"
;
baseUrlCache
=
oData
.
Config
.
baseUrl
console
.
log
(
"[baseUrlCache]"
,
baseUrlCache
);
that
.
getSessionStorage
().
put
(
'baseUrlCache'
,
baseUrlCache
);
let
currentEnvironment
=
that
.
getSessionStorage
().
get
(
'currentEnvironment'
)
if
(
currentEnvironment
){
baseUrlCache
=
oData
.
Config
[
currentEnvironment
]
}
if
(
!
oData
.
Config
.
isServerConfig
)
{
let
str
=
""
if
(
oData
.
Config
.
port
.
trim
())
{
str
=
":"
+
oData
.
Config
.
port
+
"/"
}
baseUrlCache
=
window
.
location
.
protocol
+
'//'
+
window
.
location
.
hostname
+
(
str
?
str
:
'/'
)
}
that
.
getSessionStorage
().
put
(
'baseUrlCache'
,
baseUrlCache
);
},
error
:
function
()
{
}
});
}
}
return
baseUrlCache
;
return
baseUrlCache
;
},
},
...
...
app/router/main/webapp/controller/Login.controller.js
View file @
d0d0e2ab
...
@@ -123,19 +123,6 @@ sap.ui.define([
...
@@ -123,19 +123,6 @@ sap.ui.define([
// return !!(sap.ui.Device.os.android || sap.ui.Device.os.ios || sap.ui.Device.os.windows.phone || sap.ui.Device.os.blackberry);
// return !!(sap.ui.Device.os.android || sap.ui.Device.os.ios || sap.ui.Device.os.windows.phone || sap.ui.Device.os.blackberry);
return
!!
(
sap
.
ui
.
Device
.
os
.
android
||
sap
.
ui
.
Device
.
os
.
ios
||
sap
.
ui
.
Device
.
os
.
blackberry
);
return
!!
(
sap
.
ui
.
Device
.
os
.
android
||
sap
.
ui
.
Device
.
os
.
ios
||
sap
.
ui
.
Device
.
os
.
blackberry
);
},
},
//获取cookie
getCookie
:
function
(
name
)
{
let
matches
=
document
.
cookie
.
match
(
new
RegExp
(
"(?:^|; )"
+
name
.
replace
(
/
([\.
$?*|{}
\(\)\[\]\\\/\+
^
])
/g
,
'
\\
$1'
)
+
"=([^;]*)"
));
return
matches
?
decodeURIComponent
(
matches
[
1
])
:
undefined
;
},
//设置cookie
setCookie
:
function
(
name
,
value
,
expireHours
)
{
var
cookieExp
=
new
Date
();
cookieExp
.
setHours
(
cookieExp
.
getHours
()
+
expireHours
);
document
.
cookie
=
name
+
"="
+
encodeURIComponent
(
value
)
+
"; path=/; expires="
+
cookieExp
.
toUTCString
();
},
// 登录
// 登录
onLogin
:
function
(
oEvent
)
{
onLogin
:
function
(
oEvent
)
{
// this.getRouter().navTo("menu", {}, true);
// this.getRouter().navTo("menu", {}, true);
...
@@ -150,21 +137,17 @@ sap.ui.define([
...
@@ -150,21 +137,17 @@ sap.ui.define([
MessageBox
.
warning
(
this
.
i18n
(
"Msg_input_username_password"
));
MessageBox
.
warning
(
this
.
i18n
(
"Msg_input_username_password"
));
return
;
return
;
}
}
console
.
log
(
"
JSESSIONID="
,
this
.
getCookie
(
'JSESSIONID'
)
);
console
.
log
(
"
onLoginUrl="
,
that
.
baseUrl
+
"login/login"
);
let
busyDialog
=
new
sap
.
m
.
BusyDialog
();
let
busyDialog
=
new
sap
.
m
.
BusyDialog
();
busyDialog
.
open
();
busyDialog
.
open
();
jQuery
.
ajax
({
jQuery
.
ajax
({
method
:
"POST"
,
method
:
"POST"
,
data
:
JSON
.
stringify
(
param
),
data
:
JSON
.
stringify
(
param
),
// url: "/login",
url
:
that
.
baseUrl
+
"login/login"
,
url
:
that
.
baseUrl
+
"login/login"
,
// url: "http://localhost:8080/login/login",
contentType
:
'application/json'
,
contentType
:
'application/json'
,
authorization
:
'Basic c2FiaW5lOnBhc3Nfc2FiaW5l'
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
){
success
:
function
(
data
){
// console.log('data',data)
// 关闭进度条
// 关闭进度条
busyDialog
.
close
();
busyDialog
.
close
();
// if(data.flag){
// if(data.flag){
...
...
app/router/main/webapp/mockdata/config.json
View file @
d0d0e2ab
...
@@ -5,6 +5,6 @@
...
@@ -5,6 +5,6 @@
"baseUrl_pre"
:
"https://lianchuangjie-pre.unibetter-ic.com/"
,
"baseUrl_pre"
:
"https://lianchuangjie-pre.unibetter-ic.com/"
,
"baseUrl_pro"
:
"https://sap.unibetter-ic.com/"
,
"baseUrl_pro"
:
"https://sap.unibetter-ic.com/"
,
"isServerConfig"
:
false
,
"isServerConfig"
:
false
,
"port"
:
"
8080
"
"port"
:
""
}
}
}
}
app/router/orders/dist/orders.zip
View file @
d0d0e2ab
No preview for this file type
app/router/xs-app.json
View file @
d0d0e2ab
{
{
"welcomeFile"
:
"app/index.html"
,
"welcomeFile"
:
"
/main/web
app/index.html"
,
"routes"
:
[
"routes"
:
[
{
{
"source"
:
"^/odata/(.*)"
,
"source"
:
"^/odata/(.*)"
,
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
"destination"
:
"srv-api"
"destination"
:
"srv-api"
},
},
{
{
"source"
:
"^/
app
/(.*)"
,
"source"
:
"^/
main
/(.*)"
,
"target"
:
"/$1"
,
"target"
:
"/$1"
,
"localDir"
:
"./main"
,
"localDir"
:
"./main"
,
"cacheControl"
:
"no-cache, no-store, must-revalidate"
"cacheControl"
:
"no-cache, no-store, must-revalidate"
...
...
srv/src/main/java/customer/lianchuangjie/common/filter/OperateAuthFilter.java
View file @
d0d0e2ab
...
@@ -95,19 +95,19 @@ public class OperateAuthFilter implements Filter {
...
@@ -95,19 +95,19 @@ public class OperateAuthFilter implements Filter {
Collection
<?
extends
GrantedAuthority
>
authorities
=
authentication
.
getAuthorities
();
//权限的集合
Collection
<?
extends
GrantedAuthority
>
authorities
=
authentication
.
getAuthorities
();
//权限的集合
Object
credentials
=
authentication
.
getCredentials
();
//获取凭证
Object
credentials
=
authentication
.
getCredentials
();
//获取凭证
Object
details
=
authentication
.
getDetails
();
//获取详细信息
Object
details
=
authentication
.
getDetails
();
//获取详细信息
org
.
springframework
.
security
.
core
.
userdetails
.
User
principal
=
(
org
.
springframework
.
security
.
core
.
userdetails
.
User
)
authentication
.
getPrincipal
();
//获取主体信息
org
.
springframework
.
security
.
core
.
userdetails
.
User
principal
=
(
org
.
springframework
.
security
.
core
.
userdetails
.
User
)
authentication
.
getPrincipal
();
//获取主体信息
//Collection<GrantedAuthority> authorities0 = principal.getAuthorities();
//Collection<GrantedAuthority> authorities0 = principal.getAuthorities();
boolean
isAuthenticated
=
authentication
.
isAuthenticated
();
//判断是否已认证
boolean
isAuthenticated
=
authentication
.
isAuthenticated
();
//判断是否已认证
log
.
info
(
"用户名:{}"
,
name
);
//log.info("用户名:{}", name);
log
.
info
(
"返回一个包含授予权限的集合:{}"
,
authorities
);
//Granted Authorities=[ROLE_ANONYMOUS]
//log.info("返回一个包含授予权限的集合:{}", authorities);//Granted Authorities=[ROLE_ANONYMOUS]
log
.
info
(
"获取凭证:{}"
,
credentials
);
//登录密码 Credentials=[PROTECTED],
//log.info("获取凭证:{}", credentials);//登录密码 Credentials=[PROTECTED],
log
.
info
(
"获取详细信息:{}"
,
details
);
//Details=WebAuthenticationDetails [RemoteIpAddress=127.0.0.1, SessionId=null],
//log.info("获取详细信息:{}", details);//Details=WebAuthenticationDetails [RemoteIpAddress=127.0.0.1, SessionId=null],
log
.
info
(
"判断是否已认证:{}"
,
isAuthenticated
);
//Authenticated=true,
//log.info("判断是否已认证:{}", isAuthenticated);//Authenticated=true,
log
.
info
(
"获取主体信息:{}"
,
principal
);
//登录账号 Principal=anonymousUser,
//log.info("获取主体信息:{}", principal);//登录账号 Principal=anonymousUser,
//log.info("获取主体信息getPassword:{}", principal.get("password"));
//log.info("获取主体信息isEnabled:{}", principal.isEnabled());
log
.
info
(
"获取主体信息getUsername:{}"
,
principal
.
getUsername
());
log
.
info
(
"获取主体信息getUsername:{}"
,
principal
.
getUsername
());
log
.
info
(
"获取主体信息getPassword:{}"
,
principal
.
getPassword
());
log
.
info
(
"获取主体信息getAuthorities:{}"
,
principal
.
getAuthorities
());
log
.
info
(
"获取主体信息getAuthorities:{}"
,
principal
.
getAuthorities
());
log
.
info
(
"获取主体信息isEnabled:{}"
,
principal
.
isEnabled
());
/*
/*
...
...
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