Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jd-activity
Project
Project
Details
Activity
Releases
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
曾水平
jd-activity
Commits
2b09573a
Commit
2b09573a
authored
Jul 15, 2022
by
陈孝伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
兰蔻免登代码提交
parent
49233d86
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
1013 additions
and
0 deletions
+1013
-0
IndexController.java
...a/cn/com/duiba/jdactivity/controller/IndexController.java
+14
-0
Open2LankouController.java
...om/duiba/jdactivity/controller/Open2LankouController.java
+713
-0
autologin.html
src/main/resources/templates/lankou/autologin.html
+143
-0
autologin3.html
src/main/resources/templates/lankou/autologin3.html
+143
-0
No files found.
src/main/java/cn/com/duiba/jdactivity/controller/IndexController.java
View file @
2b09573a
...
...
@@ -44,6 +44,20 @@ public class IndexController {
return
modelAndView
;
}
@GetMapping
(
"/lankou/autologin"
)
public
ModelAndView
lankouAutologin
()
{
ModelAndView
modelAndView
=
new
ModelAndView
();
modelAndView
.
setViewName
(
"lankou/autologin"
);
return
modelAndView
;
}
@GetMapping
(
"/lankou/autologin3"
)
public
ModelAndView
lankouAutologin3
()
{
ModelAndView
modelAndView
=
new
ModelAndView
();
modelAndView
.
setViewName
(
"lankou/autologin3"
);
return
modelAndView
;
}
@GetMapping
(
"/jdshare"
)
public
ModelAndView
jdshare
()
{
ModelAndView
modelAndView
=
new
ModelAndView
();
...
...
src/main/java/cn/com/duiba/jdactivity/controller/Open2LankouController.java
0 → 100644
View file @
2b09573a
This diff is collapsed.
Click to expand it.
src/main/resources/templates/lankou/autologin.html
0 → 100644
View file @
2b09573a
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
正在加载..
</title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<script
src=
"//yun.duiba.com.cn/aurora/assets/4c37d75a75d8e7534d9e3b056911ba06ac5bf8f8.js"
></script>
<!-- <script src="//yun.duiba.com.cn/js-libs/vConsole/3.3.4/vconsole.min.js"></script> -->
<!-- jquery.min.js -->
<script
src=
"//h5static.m.jd.com/act/jm-jdshare/2.0.0/jm-jdshare.js"
></script>
<script
src=
"//s3.pstatp.com/cdn/expire-1-M/jquery/3.3.1/jquery.min.js"
></script>
<script>
// new VConsole();
</script>
<style>
.box
{
width
:
100%
;
height
:
100vh
;
}
.box
>
div
{
width
:
100%
;
height
:
30px
;
line-height
:
30px
;
text-align
:
center
;
border
:
2px
solid
#ccc
;
margin
:
5px
0
;
}
</style>
</head>
<body>
<div
class=
"box"
>
<!-- <div onclick="openLoginPanel()">唤起登录面板</div> -->
<!-- <div onclick="jumpToPage()">跳转</div> -->
</div>
<script
language=
"javascript"
>
(
function
()
{
openLoginPanel
();
})()
function
openLoginPanel
()
{
console
.
log
(
"登录面板"
)
var
isWechat
=
JSSDK
.
Client
.
isWeixin
();
var
isQQ
=
JSSDK
.
Client
.
isQQ
();
if
(
isWechat
||
isQQ
)
{
var
redirectUrlPrimary
=
window
.
location
.
href
.
replace
(
'autologin'
,
'autologin3'
)
+
'&source=02'
var
url
=
'https://wq.jd.com/pinbind/pintokenredirect?biz=jm-business-center&url='
+
encodeURIComponent
(
redirectUrlPrimary
)
window
.
location
.
href
=
url
;
return
;
}
JSSDK
.
Isv
.
requestLogin
(
isLogin
);
}
function
isLogin
(
res
)
{
console
.
log
(
"login回调/打开登录面板的回调"
,
res
)
setTimeout
(
function
()
{
console
.
log
(
res
.
data
)
if
(
res
.
data
==
1
)
{
// 已登录
getToken
();
}
else
{
// 未登录
}
},
0
);
}
function
getToken
()
{
console
.
log
(
"进入获取token方法"
,
window
.
location
.
href
)
JSSDK
.
Isv
.
requestIsvToken
({
url
:
window
.
location
.
href
},
callBackToken
);
}
function
callBackToken
(
res
)
{
console
.
log
(
"获取token的返回"
,
res
)
autoLogin
(
res
.
data
);
}
var
pageUrl
=
""
;
function
autoLogin
(
token
)
{
var
redirect
=
getUrlParam
(
"redirect"
);
var
env
=
getUrlParam
(
"env"
);
var
shopId
=
getUrlParam
(
"shopId"
);
var
venderId
=
getUrlParam
(
"venderId"
);
var
appKey
=
getUrlParam
(
"appKey"
);
var
needCredits
=
getUrlParam
(
"needCredits"
);
$
.
ajax
({
type
:
'post'
,
url
:
`/open2Lankou/autologin`
,
data
:
JSON
.
stringify
({
token
:
token
,
redirectUrl
:
redirect
,
env
:
env
,
shopId
:
shopId
,
venderId
:
venderId
,
appKey
:
appKey
,
needCredits
:
needCredits
}),
async
:
false
,
contentType
:
'application/json'
,
dataType
:
'json'
,
//返回 JSON 数据
beforeSend
:
function
()
{
},
success
:
function
(
data
,
status
)
{
console
.
log
(
"autoLogin返回参数:"
,
data
)
pageUrl
=
data
.
data
;
console
.
log
(
pageUrl
)
window
.
location
.
href
=
pageUrl
;
},
complete
:
function
()
{
},
error
:
function
(
data
,
status
,
e
)
{
console
.
log
(
"接口调用错误"
,
e
)
}
});
}
function
jumpToPage
()
{
console
.
log
(
pageUrl
)
window
.
location
.
href
=
pageUrl
;
}
function
getUrlParam
(
name
)
{
var
search
=
window
.
location
.
search
;
var
matched
=
search
.
slice
(
1
)
.
match
(
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
));
return
search
.
length
?
matched
&&
matched
[
2
]
:
null
;
}
</script>
</body>
</html>
\ No newline at end of file
src/main/resources/templates/lankou/autologin3.html
0 → 100644
View file @
2b09573a
<!DOCTYPE html>
<html
lang=
"en"
>
<head>
<meta
charset=
"UTF-8"
>
<title>
正在加载..
</title>
<meta
name=
"viewport"
content=
"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no"
/>
<meta
name=
"apple-mobile-web-app-capable"
content=
"yes"
/>
<meta
name=
"full-screen"
content=
"true"
/>
<meta
name=
"screen-orientation"
content=
"portrait"
/>
<meta
name=
"x5-fullscreen"
content=
"true"
/>
<meta
name=
"360-fullscreen"
content=
"true"
/>
<script
src=
"//yun.duiba.com.cn/aurora/assets/4c37d75a75d8e7534d9e3b056911ba06ac5bf8f8.js"
></script>
<!-- <script src="//yun.duiba.com.cn/js-libs/vConsole/3.3.4/vconsole.min.js"></script> -->
<!-- jquery.min.js -->
<script
src=
"//h5static.m.jd.com/act/jm-jdshare/2.0.0/jm-jdshare.js"
></script>
<script
src=
"//s3.pstatp.com/cdn/expire-1-M/jquery/3.3.1/jquery.min.js"
></script>
<script>
// new VConsole();
</script>
<style>
.box
{
width
:
100%
;
height
:
100vh
;
}
.box
>
div
{
width
:
100%
;
height
:
30px
;
line-height
:
30px
;
text-align
:
center
;
border
:
2px
solid
#ccc
;
margin
:
5px
0
;
}
</style>
</head>
<body>
<div
class=
"box"
>
<!-- <div onclick="openLoginPanel()">唤起登录面板</div> -->
<!-- <div onclick="jumpToPage()">跳转</div> -->
</div>
<script
language=
"javascript"
>
(
function
()
{
// openLoginPanel();
var
token
=
getUrlParam
(
"token"
);
autoLogin
(
token
)
})()
function
openLoginPanel
()
{
console
.
log
(
"登录面板"
)
JSSDK
.
Isv
.
requestLogin
(
isLogin
);
}
function
isLogin
(
res
)
{
console
.
log
(
"login回调/打开登录面板的回调"
,
res
)
setTimeout
(
function
()
{
console
.
log
(
res
.
data
)
if
(
res
.
data
==
1
)
{
// 已登录
getToken
();
}
else
{
// 未登录
}
},
0
);
}
function
getToken
()
{
console
.
log
(
"进入获取token方法"
,
window
.
location
.
href
)
JSSDK
.
Isv
.
requestIsvToken
({
url
:
window
.
location
.
href
},
callBackToken
);
}
function
callBackToken
(
res
)
{
console
.
log
(
"获取token的返回"
,
res
)
autoLogin
(
res
.
data
);
}
var
pageUrl
=
""
;
function
autoLogin
(
token
)
{
var
redirect
=
getUrlParam
(
"redirect"
);
var
env
=
getUrlParam
(
"env"
);
var
shopId
=
getUrlParam
(
"shopId"
);
var
venderId
=
getUrlParam
(
"venderId"
);
var
source
=
getUrlParam
(
"source"
);
var
appKey
=
getUrlParam
(
"appKey"
);
var
needCredits
=
getUrlParam
(
"needCredits"
);
$
.
ajax
({
type
:
'post'
,
url
:
`/open2Lankou/autologin`
,
data
:
JSON
.
stringify
({
token
:
token
,
redirectUrl
:
redirect
,
source
:
'02'
,
env
:
env
,
shopId
:
shopId
,
venderId
:
venderId
,
appKey
:
appKey
,
needCredits
:
needCredits
}),
async
:
false
,
contentType
:
'application/json'
,
dataType
:
'json'
,
//返回 JSON 数据
beforeSend
:
function
()
{
},
success
:
function
(
data
,
status
)
{
console
.
log
(
"autoLogin返回参数:"
,
data
)
pageUrl
=
data
.
data
;
console
.
log
(
pageUrl
)
window
.
location
.
href
=
pageUrl
;
},
complete
:
function
()
{
},
error
:
function
(
data
,
status
,
e
)
{
console
.
log
(
"接口调用错误"
,
e
)
}
});
}
function
jumpToPage
()
{
console
.
log
(
pageUrl
)
window
.
location
.
href
=
pageUrl
;
}
function
getUrlParam
(
name
)
{
var
search
=
window
.
location
.
search
;
var
matched
=
search
.
slice
(
1
)
.
match
(
new
RegExp
(
'(^|&)'
+
name
+
'=([^&]*)(&|$)'
,
'i'
));
return
search
.
length
?
matched
&&
matched
[
2
]
:
null
;
}
</script>
</body>
</html>
\ No newline at end of file
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