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
61692897
Commit
61692897
authored
May 22, 2021
by
曾水平
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
3c9b2700
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
4 deletions
+43
-4
Open2DuibaController.java
...com/duiba/jdactivity/controller/Open2DuibaController.java
+5
-3
JdShopEnum.java
...java/cn/com/duiba/jdactivity/developer/jd/JdShopEnum.java
+34
-0
autologin.html
src/main/resources/templates/autologin.html
+4
-1
No files found.
src/main/java/cn/com/duiba/jdactivity/controller/Open2DuibaController.java
View file @
61692897
...
...
@@ -8,6 +8,7 @@ import cn.com.duiba.jdactivity.common.vo.Result;
import
cn.com.duiba.jdactivity.common.vo.ResultBuilder
;
import
cn.com.duiba.jdactivity.developer.duiba.DuibaAppEnum
;
import
cn.com.duiba.jdactivity.developer.jd.JdAppEnum
;
import
cn.com.duiba.jdactivity.developer.jd.JdShopEnum
;
import
cn.com.duiba.jdactivity.developer.jd.utils.AccessTokenUtils
;
import
cn.com.duiba.jdactivity.developer.jd.utils.EncryptUtil
;
import
cn.com.duiba.jdactivity.developer.jd.utils.JdApiUtil
;
...
...
@@ -33,6 +34,7 @@ import java.net.URLEncoder;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Objects
;
import
java.util.Optional
;
import
java.util.stream.Collectors
;
/**
...
...
@@ -88,9 +90,9 @@ public class Open2DuibaController {
public
Result
<
String
>
autologin
(
@RequestBody
AutologinParam
autologinParam
)
{
try
{
LOGGER
.
info
(
"autologin,autologinParam={}"
,
JSON
.
toJSONString
(
autologinParam
));
Long
shopId
=
autologinParam
.
getShopId
(
);
Long
venderId
=
autologinParam
.
getVenderId
(
);
JdShopEnum
jdShopEnum
=
JdShopEnum
.
DUIBA
;
Long
shopId
=
Optional
.
ofNullable
(
autologinParam
.
getShopId
()).
filter
(
aLong
->
aLong
!=
0L
).
orElse
(
jdShopEnum
.
getShopId
()
);
Long
venderId
=
Optional
.
ofNullable
(
autologinParam
.
getVenderId
()).
filter
(
aLong
->
aLong
!=
0L
).
orElse
(
jdShopEnum
.
getVenderId
()
);
String
token
=
autologinParam
.
getToken
();
String
source
=
autologinParam
.
getSource
();
String
redirectUrl
=
autologinParam
.
getRedirectUrl
();
...
...
src/main/java/cn/com/duiba/jdactivity/developer/jd/JdShopEnum.java
0 → 100644
View file @
61692897
package
cn
.
com
.
duiba
.
jdactivity
.
developer
.
jd
;
public
enum
JdShopEnum
{
DUIBA
(
"杭州兑吧"
,
10139787L
,
10276497L
),
BOSIDENG
(
"波司登官方旗舰店"
,
44892L
,
48034L
);
private
final
String
shopName
;
/**
* 店铺Id
*/
private
final
Long
shopId
;
/**
* 商家Id
*/
private
final
Long
venderId
;
JdShopEnum
(
String
shopName
,
Long
shopId
,
Long
venderId
)
{
this
.
shopName
=
shopName
;
this
.
shopId
=
shopId
;
this
.
venderId
=
venderId
;
}
public
String
getShopName
()
{
return
shopName
;
}
public
Long
getShopId
()
{
return
shopId
;
}
public
Long
getVenderId
()
{
return
venderId
;
}
}
src/main/resources/templates/autologin.html
View file @
61692897
...
...
@@ -86,7 +86,8 @@
function
autoLogin
(
token
)
{
let
redirect
=
getUrlParam
(
"redirect"
);
let
env
=
getUrlParam
(
"env"
);
console
.
log
(
"获取env的返回"
,
env
);
let
shopId
=
getUrlParam
(
"shopId"
);
let
venderId
=
getUrlParam
(
"venderId"
);
$
.
ajax
({
type
:
'post'
,
...
...
@@ -94,6 +95,8 @@
data
:
JSON
.
stringify
({
token
:
token
,
redirectUrl
:
redirect
,
shopId
:
shopId
,
venderId
:
venderId
,
env
:
env
}),
async
:
false
,
...
...
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