Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Q
qk_backend
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
quanku
qk_backend
Commits
8f975e21
Commit
8f975e21
authored
Oct 08, 2023
by
shiyu
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/quanku_0930' into quanku_0930
parents
55424a5d
8c772fce
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
241 additions
and
31 deletions
+241
-31
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
+1
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
+10
-1
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserExample.java
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserExample.java
+142
-0
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserMapper.xml
...o/src/main/resources/com/wwdz/ch/db/mapper/UserMapper.xml
+29
-14
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/UserRequestDto.java
...in/java/com/wwdz/ch/wx/entity/request/UserRequestDto.java
+1
-0
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
+15
-8
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
...pi/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
+6
-3
ch-wx-api/src/main/java/com/wwdz/ch/wx/manager/AlipayLoginManager.java
.../main/java/com/wwdz/ch/wx/manager/AlipayLoginManager.java
+37
-4
No files found.
ch-core/src/main/java/com/wwdz/ch/core/util/MediaUtil.java
View file @
8f975e21
...
@@ -132,7 +132,7 @@ public class MediaUtil {
...
@@ -132,7 +132,7 @@ public class MediaUtil {
public
static
Map
<
String
,
Object
>
getAspect
(
String
image
)
{
public
static
Map
<
String
,
Object
>
getAspect
(
String
image
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
String
[]
_image
=
image
.
split
(
"_"
);
String
[]
_image
=
image
.
split
(
"_"
);
String
[]
infoImage
=
_image
[
1
].
split
(
"\\."
);
String
[]
infoImage
=
_image
[
_image
.
length
-
1
].
split
(
"\\."
);
String
[]
result
=
infoImage
[
0
].
split
(
"x"
);
String
[]
result
=
infoImage
[
0
].
split
(
"x"
);
map
.
put
(
"width"
,
result
[
0
]);
map
.
put
(
"width"
,
result
[
0
]);
map
.
put
(
"height"
,
result
[
1
]);
map
.
put
(
"height"
,
result
[
1
]);
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/User.java
View file @
8f975e21
...
@@ -9,7 +9,7 @@ import java.util.Date;
...
@@ -9,7 +9,7 @@ import java.util.Date;
/**
/**
* @author shiyu
* @author shiyu
* @date 2023/0
8/07
* @date 2023/0
9/28
*/
*/
@Data
@Data
public
class
User
implements
Serializable
{
public
class
User
implements
Serializable
{
...
@@ -98,6 +98,11 @@ public class User implements Serializable {
...
@@ -98,6 +98,11 @@ public class User implements Serializable {
*/
*/
private
String
weixinOpenid
;
private
String
weixinOpenid
;
/**
* 支付宝user_id
*/
private
String
alipayUserId
;
/**
/**
* 微信号
* 微信号
*/
*/
...
@@ -147,6 +152,7 @@ public class User implements Serializable {
...
@@ -147,6 +152,7 @@ public class User implements Serializable {
sb
.
append
(
", profile="
).
append
(
profile
);
sb
.
append
(
", profile="
).
append
(
profile
);
sb
.
append
(
", background="
).
append
(
background
);
sb
.
append
(
", background="
).
append
(
background
);
sb
.
append
(
", weixinOpenid="
).
append
(
weixinOpenid
);
sb
.
append
(
", weixinOpenid="
).
append
(
weixinOpenid
);
sb
.
append
(
", alipayUserId="
).
append
(
alipayUserId
);
sb
.
append
(
", wechatId="
).
append
(
wechatId
);
sb
.
append
(
", wechatId="
).
append
(
wechatId
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", status="
).
append
(
status
);
sb
.
append
(
", addTime="
).
append
(
addTime
);
sb
.
append
(
", addTime="
).
append
(
addTime
);
...
@@ -184,6 +190,7 @@ public class User implements Serializable {
...
@@ -184,6 +190,7 @@ public class User implements Serializable {
&&
(
this
.
getProfile
()
==
null
?
other
.
getProfile
()
==
null
:
this
.
getProfile
().
equals
(
other
.
getProfile
()))
&&
(
this
.
getProfile
()
==
null
?
other
.
getProfile
()
==
null
:
this
.
getProfile
().
equals
(
other
.
getProfile
()))
&&
(
this
.
getBackground
()
==
null
?
other
.
getBackground
()
==
null
:
this
.
getBackground
().
equals
(
other
.
getBackground
()))
&&
(
this
.
getBackground
()
==
null
?
other
.
getBackground
()
==
null
:
this
.
getBackground
().
equals
(
other
.
getBackground
()))
&&
(
this
.
getWeixinOpenid
()
==
null
?
other
.
getWeixinOpenid
()
==
null
:
this
.
getWeixinOpenid
().
equals
(
other
.
getWeixinOpenid
()))
&&
(
this
.
getWeixinOpenid
()
==
null
?
other
.
getWeixinOpenid
()
==
null
:
this
.
getWeixinOpenid
().
equals
(
other
.
getWeixinOpenid
()))
&&
(
this
.
getAlipayUserId
()
==
null
?
other
.
getAlipayUserId
()
==
null
:
this
.
getAlipayUserId
().
equals
(
other
.
getAlipayUserId
()))
&&
(
this
.
getWechatId
()
==
null
?
other
.
getWechatId
()
==
null
:
this
.
getWechatId
().
equals
(
other
.
getWechatId
()))
&&
(
this
.
getWechatId
()
==
null
?
other
.
getWechatId
()
==
null
:
this
.
getWechatId
().
equals
(
other
.
getWechatId
()))
&&
(
this
.
getStatus
()
==
null
?
other
.
getStatus
()
==
null
:
this
.
getStatus
().
equals
(
other
.
getStatus
()))
&&
(
this
.
getStatus
()
==
null
?
other
.
getStatus
()
==
null
:
this
.
getStatus
().
equals
(
other
.
getStatus
()))
&&
(
this
.
getAddTime
()
==
null
?
other
.
getAddTime
()
==
null
:
this
.
getAddTime
().
equals
(
other
.
getAddTime
()))
&&
(
this
.
getAddTime
()
==
null
?
other
.
getAddTime
()
==
null
:
this
.
getAddTime
().
equals
(
other
.
getAddTime
()))
...
@@ -210,6 +217,7 @@ public class User implements Serializable {
...
@@ -210,6 +217,7 @@ public class User implements Serializable {
result
=
prime
*
result
+
((
getProfile
()
==
null
)
?
0
:
getProfile
().
hashCode
());
result
=
prime
*
result
+
((
getProfile
()
==
null
)
?
0
:
getProfile
().
hashCode
());
result
=
prime
*
result
+
((
getBackground
()
==
null
)
?
0
:
getBackground
().
hashCode
());
result
=
prime
*
result
+
((
getBackground
()
==
null
)
?
0
:
getBackground
().
hashCode
());
result
=
prime
*
result
+
((
getWeixinOpenid
()
==
null
)
?
0
:
getWeixinOpenid
().
hashCode
());
result
=
prime
*
result
+
((
getWeixinOpenid
()
==
null
)
?
0
:
getWeixinOpenid
().
hashCode
());
result
=
prime
*
result
+
((
getAlipayUserId
()
==
null
)
?
0
:
getAlipayUserId
().
hashCode
());
result
=
prime
*
result
+
((
getWechatId
()
==
null
)
?
0
:
getWechatId
().
hashCode
());
result
=
prime
*
result
+
((
getWechatId
()
==
null
)
?
0
:
getWechatId
().
hashCode
());
result
=
prime
*
result
+
((
getStatus
()
==
null
)
?
0
:
getStatus
().
hashCode
());
result
=
prime
*
result
+
((
getStatus
()
==
null
)
?
0
:
getStatus
().
hashCode
());
result
=
prime
*
result
+
((
getAddTime
()
==
null
)
?
0
:
getAddTime
().
hashCode
());
result
=
prime
*
result
+
((
getAddTime
()
==
null
)
?
0
:
getAddTime
().
hashCode
());
...
@@ -252,6 +260,7 @@ public class User implements Serializable {
...
@@ -252,6 +260,7 @@ public class User implements Serializable {
profile
(
"profile"
,
"profile"
,
"VARCHAR"
,
false
),
profile
(
"profile"
,
"profile"
,
"VARCHAR"
,
false
),
background
(
"background"
,
"background"
,
"VARCHAR"
,
false
),
background
(
"background"
,
"background"
,
"VARCHAR"
,
false
),
weixinOpenid
(
"weixin_openid"
,
"weixinOpenid"
,
"VARCHAR"
,
false
),
weixinOpenid
(
"weixin_openid"
,
"weixinOpenid"
,
"VARCHAR"
,
false
),
alipayUserId
(
"alipay_user_id"
,
"alipayUserId"
,
"VARCHAR"
,
false
),
wechatId
(
"wechat_id"
,
"wechatId"
,
"VARCHAR"
,
false
),
wechatId
(
"wechat_id"
,
"wechatId"
,
"VARCHAR"
,
false
),
status
(
"status"
,
"status"
,
"TINYINT"
,
true
),
status
(
"status"
,
"status"
,
"TINYINT"
,
true
),
addTime
(
"add_time"
,
"addTime"
,
"TIMESTAMP"
,
false
),
addTime
(
"add_time"
,
"addTime"
,
"TIMESTAMP"
,
false
),
...
...
ch-dao/src/main/java/com/wwdz/ch/db/domain/UserExample.java
View file @
8f975e21
...
@@ -2113,6 +2113,148 @@ public class UserExample {
...
@@ -2113,6 +2113,148 @@ public class UserExample {
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andAlipayUserIdIsNull
()
{
addCriterion
(
"alipay_user_id is null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdIsNotNull
()
{
addCriterion
(
"alipay_user_id is not null"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdEqualTo
(
String
value
)
{
addCriterion
(
"alipay_user_id ="
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdEqualToColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id = "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdNotEqualTo
(
String
value
)
{
addCriterion
(
"alipay_user_id <>"
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdNotEqualToColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id <> "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdGreaterThan
(
String
value
)
{
addCriterion
(
"alipay_user_id >"
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdGreaterThanColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id > "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdGreaterThanOrEqualTo
(
String
value
)
{
addCriterion
(
"alipay_user_id >="
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdGreaterThanOrEqualToColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id >= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdLessThan
(
String
value
)
{
addCriterion
(
"alipay_user_id <"
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdLessThanColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id < "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdLessThanOrEqualTo
(
String
value
)
{
addCriterion
(
"alipay_user_id <="
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
/**
* This method was generated by MyBatis Generator.
* This method corresponds to the database table user
*
* @mbg.generated
* @project https://github.com/itfsw/mybatis-generator-plugin
*/
public
Criteria
andAlipayUserIdLessThanOrEqualToColumn
(
User
.
Column
column
)
{
addCriterion
(
new
StringBuilder
(
"alipay_user_id <= "
).
append
(
column
.
getEscapedColumnName
()).
toString
());
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdLike
(
String
value
)
{
addCriterion
(
"alipay_user_id like"
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdNotLike
(
String
value
)
{
addCriterion
(
"alipay_user_id not like"
,
value
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdIn
(
List
<
String
>
values
)
{
addCriterion
(
"alipay_user_id in"
,
values
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdNotIn
(
List
<
String
>
values
)
{
addCriterion
(
"alipay_user_id not in"
,
values
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"alipay_user_id between"
,
value1
,
value2
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andAlipayUserIdNotBetween
(
String
value1
,
String
value2
)
{
addCriterion
(
"alipay_user_id not between"
,
value1
,
value2
,
"alipayUserId"
);
return
(
Criteria
)
this
;
}
public
Criteria
andWechatIdIsNull
()
{
public
Criteria
andWechatIdIsNull
()
{
addCriterion
(
"wechat_id is null"
);
addCriterion
(
"wechat_id is null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
...
...
ch-dao/src/main/resources/com/wwdz/ch/db/mapper/UserMapper.xml
View file @
8f975e21
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
<result
column=
"profile"
jdbcType=
"VARCHAR"
property=
"profile"
/>
<result
column=
"profile"
jdbcType=
"VARCHAR"
property=
"profile"
/>
<result
column=
"background"
jdbcType=
"VARCHAR"
property=
"background"
/>
<result
column=
"background"
jdbcType=
"VARCHAR"
property=
"background"
/>
<result
column=
"weixin_openid"
jdbcType=
"VARCHAR"
property=
"weixinOpenid"
/>
<result
column=
"weixin_openid"
jdbcType=
"VARCHAR"
property=
"weixinOpenid"
/>
<result
column=
"alipay_user_id"
jdbcType=
"VARCHAR"
property=
"alipayUserId"
/>
<result
column=
"wechat_id"
jdbcType=
"VARCHAR"
property=
"wechatId"
/>
<result
column=
"wechat_id"
jdbcType=
"VARCHAR"
property=
"wechatId"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
<result
column=
"status"
jdbcType=
"TINYINT"
property=
"status"
/>
<result
column=
"add_time"
jdbcType=
"TIMESTAMP"
property=
"addTime"
/>
<result
column=
"add_time"
jdbcType=
"TIMESTAMP"
property=
"addTime"
/>
...
@@ -83,8 +84,8 @@
...
@@ -83,8 +84,8 @@
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
nickname, mobile, avatar, profile, background, weixin_openid,
wechat_id, `status`
,
nickname, mobile, avatar, profile, background, weixin_openid,
alipay_user_id, wechat_id
,
add_time, update_time, deleted, share_user_id
`status`,
add_time, update_time, deleted, share_user_id
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.UserExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.wwdz.ch.db.domain.UserExample"
resultMap=
"BaseResultMap"
>
select
select
...
@@ -120,8 +121,8 @@
...
@@ -120,8 +121,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
nickname, mobile, avatar, profile, background, weixin_openid,
wechat_id, `status`
,
nickname, mobile, avatar, profile, background, weixin_openid,
alipay_user_id, wechat_id
,
add_time, update_time, deleted, share_user_id
`status`,
add_time, update_time, deleted, share_user_id
</otherwise>
</otherwise>
</choose>
</choose>
from user
from user
...
@@ -173,8 +174,8 @@
...
@@ -173,8 +174,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
nickname, mobile, avatar, profile, background, weixin_openid,
wechat_id, `status`
,
nickname, mobile, avatar, profile, background, weixin_openid,
alipay_user_id, wechat_id
,
add_time, update_time, deleted, share_user_id
`status`,
add_time, update_time, deleted, share_user_id
</otherwise>
</otherwise>
</choose>
</choose>
from user
from user
...
@@ -198,16 +199,16 @@
...
@@ -198,16 +199,16 @@
birthday, last_login_time, last_login_ip,
birthday, last_login_time, last_login_ip,
user_level, nickname, mobile,
user_level, nickname, mobile,
avatar, profile, background,
avatar, profile, background,
weixin_openid,
wechat_id, `status`
,
weixin_openid,
alipay_user_id, wechat_id
,
add_time, update_time, deleted
,
`status`, add_time, update_time
,
share_user_id)
deleted,
share_user_id)
values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
values (#{username,jdbcType=VARCHAR}, #{password,jdbcType=VARCHAR}, #{gender,jdbcType=TINYINT},
#{birthday,jdbcType=DATE}, #{lastLoginTime,jdbcType=TIMESTAMP}, #{lastLoginIp,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{lastLoginTime,jdbcType=TIMESTAMP}, #{lastLoginIp,jdbcType=VARCHAR},
#{userLevel,jdbcType=TINYINT}, #{nickname,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{userLevel,jdbcType=TINYINT}, #{nickname,jdbcType=VARCHAR}, #{mobile,jdbcType=VARCHAR},
#{avatar,jdbcType=VARCHAR}, #{profile,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR},
#{avatar,jdbcType=VARCHAR}, #{profile,jdbcType=VARCHAR}, #{background,jdbcType=VARCHAR},
#{weixinOpenid,jdbcType=VARCHAR}, #{
wechatId,jdbcType=VARCHAR}, #{status,jdbcType=TINYINT
},
#{weixinOpenid,jdbcType=VARCHAR}, #{
alipayUserId,jdbcType=VARCHAR}, #{wechatId,jdbcType=VARCHAR
},
#{
addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{deleted,jdbcType=BIT
},
#{
status,jdbcType=TINYINT}, #{addTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP
},
#{shareUserId,jdbcType=BIGINT})
#{
deleted,jdbcType=BIT}, #{
shareUserId,jdbcType=BIGINT})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.User"
>
<insert
id=
"insertSelective"
parameterType=
"com.wwdz.ch.db.domain.User"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
...
@@ -254,6 +255,9 @@
...
@@ -254,6 +255,9 @@
<if
test=
"weixinOpenid != null"
>
<if
test=
"weixinOpenid != null"
>
weixin_openid,
weixin_openid,
</if>
</if>
<if
test=
"alipayUserId != null"
>
alipay_user_id,
</if>
<if
test=
"wechatId != null"
>
<if
test=
"wechatId != null"
>
wechat_id,
wechat_id,
</if>
</if>
...
@@ -313,6 +317,9 @@
...
@@ -313,6 +317,9 @@
<if
test=
"weixinOpenid != null"
>
<if
test=
"weixinOpenid != null"
>
#{weixinOpenid,jdbcType=VARCHAR},
#{weixinOpenid,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"alipayUserId != null"
>
#{alipayUserId,jdbcType=VARCHAR},
</if>
<if
test=
"wechatId != null"
>
<if
test=
"wechatId != null"
>
#{wechatId,jdbcType=VARCHAR},
#{wechatId,jdbcType=VARCHAR},
</if>
</if>
...
@@ -384,6 +391,9 @@
...
@@ -384,6 +391,9 @@
<if
test=
"record.weixinOpenid != null"
>
<if
test=
"record.weixinOpenid != null"
>
weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.alipayUserId != null"
>
alipay_user_id = #{record.alipayUserId,jdbcType=VARCHAR},
</if>
<if
test=
"record.wechatId != null"
>
<if
test=
"record.wechatId != null"
>
wechat_id = #{record.wechatId,jdbcType=VARCHAR},
wechat_id = #{record.wechatId,jdbcType=VARCHAR},
</if>
</if>
...
@@ -423,6 +433,7 @@
...
@@ -423,6 +433,7 @@
profile = #{record.profile,jdbcType=VARCHAR},
profile = #{record.profile,jdbcType=VARCHAR},
background = #{record.background,jdbcType=VARCHAR},
background = #{record.background,jdbcType=VARCHAR},
weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
weixin_openid = #{record.weixinOpenid,jdbcType=VARCHAR},
alipay_user_id = #{record.alipayUserId,jdbcType=VARCHAR},
wechat_id = #{record.wechatId,jdbcType=VARCHAR},
wechat_id = #{record.wechatId,jdbcType=VARCHAR},
`status` = #{record.status,jdbcType=TINYINT},
`status` = #{record.status,jdbcType=TINYINT},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
add_time = #{record.addTime,jdbcType=TIMESTAMP},
...
@@ -475,6 +486,9 @@
...
@@ -475,6 +486,9 @@
<if
test=
"weixinOpenid != null"
>
<if
test=
"weixinOpenid != null"
>
weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"alipayUserId != null"
>
alipay_user_id = #{alipayUserId,jdbcType=VARCHAR},
</if>
<if
test=
"wechatId != null"
>
<if
test=
"wechatId != null"
>
wechat_id = #{wechatId,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
</if>
</if>
...
@@ -511,6 +525,7 @@
...
@@ -511,6 +525,7 @@
profile = #{profile,jdbcType=VARCHAR},
profile = #{profile,jdbcType=VARCHAR},
background = #{background,jdbcType=VARCHAR},
background = #{background,jdbcType=VARCHAR},
weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
weixin_openid = #{weixinOpenid,jdbcType=VARCHAR},
alipay_user_id = #{alipayUserId,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
wechat_id = #{wechatId,jdbcType=VARCHAR},
`status` = #{status,jdbcType=TINYINT},
`status` = #{status,jdbcType=TINYINT},
add_time = #{addTime,jdbcType=TIMESTAMP},
add_time = #{addTime,jdbcType=TIMESTAMP},
...
@@ -553,8 +568,8 @@
...
@@ -553,8 +568,8 @@
</when>
</when>
<otherwise>
<otherwise>
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
id, username, `password`, gender, birthday, last_login_time, last_login_ip, user_level,
nickname, mobile, avatar, profile, background, weixin_openid,
wechat_id, `status`
,
nickname, mobile, avatar, profile, background, weixin_openid,
alipay_user_id, wechat_id
,
add_time, update_time, deleted, share_user_id
`status`,
add_time, update_time, deleted, share_user_id
</otherwise>
</otherwise>
</choose>
</choose>
from user
from user
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/entity/request/UserRequestDto.java
View file @
8f975e21
...
@@ -25,4 +25,5 @@ public class UserRequestDto implements Entity {
...
@@ -25,4 +25,5 @@ public class UserRequestDto implements Entity {
// 快捷登录方式(1、微信,2、支付宝,3、抖音)
// 快捷登录方式(1、微信,2、支付宝,3、抖音)
private
Integer
loginType
;
private
Integer
loginType
;
private
String
wxOpenId
;
private
String
wxOpenId
;
private
String
alipayUserId
;
}
}
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/ItemServiceImpl.java
View file @
8f975e21
...
@@ -226,6 +226,16 @@ public class ItemServiceImpl implements ItemService {
...
@@ -226,6 +226,16 @@ public class ItemServiceImpl implements ItemService {
officialUserIds
=
itemsOfficialUsersRelations
.
stream
()
officialUserIds
=
itemsOfficialUsersRelations
.
stream
()
.
map
(
ItemsOfficialUsersRelation:
:
getUserId
).
collect
(
Collectors
.
toList
());
.
map
(
ItemsOfficialUsersRelation:
:
getUserId
).
collect
(
Collectors
.
toList
());
}
}
// 判断是否展示浏览量或仅自己可见
Integer
isDisplay
=
null
;
if
(!
isGuest
)
{
if
(
dto
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ALL
.
getCode
()))
{
isDisplay
=
1
;
}
if
(
dto
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ONLY_ONESELF
.
getCode
()))
{
isDisplay
=
2
;
}
}
if
(!
officialUserIds
.
contains
(
dto
.
getUserId
()))
{
if
(!
officialUserIds
.
contains
(
dto
.
getUserId
()))
{
// 查询用户和藏品关联表
// 查询用户和藏品关联表
...
@@ -269,10 +279,8 @@ public class ItemServiceImpl implements ItemService {
...
@@ -269,10 +279,8 @@ public class ItemServiceImpl implements ItemService {
// 设置用户头像和昵称
// 设置用户头像和昵称
itemResponseVo
.
setItemNickname
(
nickname
);
itemResponseVo
.
setItemNickname
(
nickname
);
itemResponseVo
.
setItemAvatar
(
avatar
);
itemResponseVo
.
setItemAvatar
(
avatar
);
// 判断是否需要展示浏览量
// 设置是否需要展示浏览量或仅自己可见
if
(!
isGuest
&&
item
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ALL
.
getCode
()))
{
itemResponseVo
.
setIsDisplay
(
isDisplay
);
itemResponseVo
.
setIsDisplay
(
1
);
}
// 设置浏览量
// 设置浏览量
itemResponseVo
.
setViewsNumber
(
item
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ALL
.
getCode
())
?
itemResponseVo
.
setViewsNumber
(
item
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ALL
.
getCode
())
?
StringUtil
.
formatCount
(
footPrintDao
.
countByItemIds
(
dto
.
getUserId
(),
item
.
getId
(),
null
))
:
"0"
);
StringUtil
.
formatCount
(
footPrintDao
.
countByItemIds
(
dto
.
getUserId
(),
item
.
getId
(),
null
))
:
"0"
);
...
@@ -301,6 +309,7 @@ public class ItemServiceImpl implements ItemService {
...
@@ -301,6 +309,7 @@ public class ItemServiceImpl implements ItemService {
List
<
AgentTranceResponseVo
>
resultList
=
new
ArrayList
<>();
List
<
AgentTranceResponseVo
>
resultList
=
new
ArrayList
<>();
final
String
itemNickname
=
nickname
;
final
String
itemNickname
=
nickname
;
final
String
itemAvatar
=
avatar
;
final
String
itemAvatar
=
avatar
;
Integer
finalIsDisplay
=
isDisplay
;
esPageInfo
.
getDataList
().
forEach
(
s
->
{
esPageInfo
.
getDataList
().
forEach
(
s
->
{
ItemResponseVo
itemResponseVo
=
new
ItemResponseVo
();
ItemResponseVo
itemResponseVo
=
new
ItemResponseVo
();
ItemOfEs
es
=
(
ItemOfEs
)
s
;
ItemOfEs
es
=
(
ItemOfEs
)
s
;
...
@@ -323,10 +332,8 @@ public class ItemServiceImpl implements ItemService {
...
@@ -323,10 +332,8 @@ public class ItemServiceImpl implements ItemService {
// 设置藏品发布用户的昵称和头像
// 设置藏品发布用户的昵称和头像
itemResponseVo
.
setItemNickname
(
itemNickname
);
itemResponseVo
.
setItemNickname
(
itemNickname
);
itemResponseVo
.
setItemAvatar
(
itemAvatar
);
itemResponseVo
.
setItemAvatar
(
itemAvatar
);
// 判断是否需要展示浏览量
// 设置是否需要展示浏览量或仅自己可见
if
(!
isGuest
&&
es
.
getViewPermission
().
equals
(
ViewPermissionEnum
.
ALL
.
getCode
()))
{
itemResponseVo
.
setIsDisplay
(
finalIsDisplay
);
itemResponseVo
.
setIsDisplay
(
1
);
}
// 设置浏览量
// 设置浏览量
itemResponseVo
.
setViewsNumber
(
StringUtil
.
formatCount
(
footPrintDao
.
countByItemIds
(
dto
.
getUserId
(),
es
.
getId
(),
null
)));
itemResponseVo
.
setViewsNumber
(
StringUtil
.
formatCount
(
footPrintDao
.
countByItemIds
(
dto
.
getUserId
(),
es
.
getId
(),
null
)));
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/impl/UserServiceImpl.java
View file @
8f975e21
...
@@ -179,6 +179,7 @@ public class UserServiceImpl implements UserService {
...
@@ -179,6 +179,7 @@ public class UserServiceImpl implements UserService {
if
(
StringUtils
.
equals
(
"false"
,
mobile
))
{
if
(
StringUtils
.
equals
(
"false"
,
mobile
))
{
return
Result
.
failed
(
"用户信息解密失败"
);
return
Result
.
failed
(
"用户信息解密失败"
);
}
}
dto
.
setAlipayUserId
(
alipayLoginManager
.
getAlipayUserId
(
dto
.
getLoginCode
()));
}
}
if
(
dto
.
getLoginType
().
equals
(
LoginTypeEnum
.
TIKTOK
.
getCode
()))
{
if
(
dto
.
getLoginType
().
equals
(
LoginTypeEnum
.
TIKTOK
.
getCode
()))
{
String
sessionKey
=
tikTokLoginManager
.
getSessionKey
(
dto
.
getLoginCode
());
String
sessionKey
=
tikTokLoginManager
.
getSessionKey
(
dto
.
getLoginCode
());
...
@@ -456,9 +457,8 @@ public class UserServiceImpl implements UserService {
...
@@ -456,9 +457,8 @@ public class UserServiceImpl implements UserService {
user
.
setWechatId
(
""
);
user
.
setWechatId
(
""
);
user
.
setMobile
(
dto
.
getMobile
());
user
.
setMobile
(
dto
.
getMobile
());
user
.
setAvatar
(
avatarUrl
);
user
.
setAvatar
(
avatarUrl
);
if
(
StringUtils
.
isNotBlank
(
dto
.
getWxOpenId
()))
{
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
());
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
());
user
.
setAlipayUserId
(
dto
.
getAlipayUserId
());
}
while
(
true
)
{
while
(
true
)
{
String
nickname
=
"收藏家"
+
StringUtil
.
generateRandomString
(
10
);
String
nickname
=
"收藏家"
+
StringUtil
.
generateRandomString
(
10
);
if
(!
userDao
.
isExistedByNickname
(
0L
,
nickname
))
{
if
(!
userDao
.
isExistedByNickname
(
0L
,
nickname
))
{
...
@@ -480,6 +480,9 @@ public class UserServiceImpl implements UserService {
...
@@ -480,6 +480,9 @@ public class UserServiceImpl implements UserService {
if
(
StringUtils
.
isNotBlank
(
dto
.
getWxOpenId
()))
{
if
(
StringUtils
.
isNotBlank
(
dto
.
getWxOpenId
()))
{
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
());
user
.
setWeixinOpenid
(
dto
.
getWxOpenId
());
}
}
if
(
StringUtils
.
isNotBlank
(
dto
.
getAlipayUserId
()))
{
user
.
setAlipayUserId
(
dto
.
getAlipayUserId
());
}
user
.
setLastLoginTime
(
new
Date
());
user
.
setLastLoginTime
(
new
Date
());
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
user
.
setLastLoginIp
(
IpUtil
.
client
(
request
));
if
(
userDao
.
updateById
(
user
)
==
0
)
{
if
(
userDao
.
updateById
(
user
)
==
0
)
{
...
...
ch-wx-api/src/main/java/com/wwdz/ch/wx/manager/AlipayLoginManager.java
View file @
8f975e21
...
@@ -5,11 +5,14 @@ import com.alibaba.fastjson.TypeReference;
...
@@ -5,11 +5,14 @@ import com.alibaba.fastjson.TypeReference;
import
com.alibaba.fastjson.parser.Feature
;
import
com.alibaba.fastjson.parser.Feature
;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.AlipayApiException
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.AlipayClient
;
import
com.alipay.api.AlipayConfig
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.DefaultAlipayClient
;
import
com.alipay.api.internal.util.AlipayEncrypt
;
import
com.alipay.api.internal.util.AlipayEncrypt
;
import
com.alipay.api.internal.util.AlipaySignature
;
import
com.alipay.api.internal.util.AlipaySignature
;
import
com.alipay.api.request.AlipayOpenAppQrcodeCreateRequest
;
import
com.alipay.api.request.AlipayOpenAppQrcodeCreateRequest
;
import
com.alipay.api.request.AlipaySystemOauthTokenRequest
;
import
com.alipay.api.response.AlipayOpenAppQrcodeCreateResponse
;
import
com.alipay.api.response.AlipayOpenAppQrcodeCreateResponse
;
import
com.alipay.api.response.AlipaySystemOauthTokenResponse
;
import
com.xxdxxs.utils.JsonUtils
;
import
com.xxdxxs.utils.JsonUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
...
@@ -27,13 +30,13 @@ public class AlipayLoginManager {
...
@@ -27,13 +30,13 @@ public class AlipayLoginManager {
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AlipayLoginManager
.
class
);
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
AlipayLoginManager
.
class
);
// 支付宝小程序对应的appid
// 支付宝小程序对应的appid
private
static
final
String
appid
=
"20210041
08672867
"
;
private
static
final
String
appid
=
"20210041
20659218
"
;
// 支付宝小程序对应的支付宝公钥
// 支付宝小程序对应的支付宝公钥
private
static
final
String
signVeriKey
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg
UwrLm4n13ixVgq1nUS3Aggieny0yxl8uiwNEKNNoL8MZnvrKmZSFAgr8m7384OLuElo2CXTTMZWCNeGo7If+qb1whCBsrGBfWAjrEdFlTNirWINaoS9F/fvJPRQ/biFryvhvP/AJewkAA2NuxZwbYpelw6zc+lNF0bGiSBujAawFs1Ok2SQMMk4javXvUwibx7u+aiSCDOy7IaZW+Rv6wVfeHT2uHIDKvOYyitdmjiJikuIzvILeZs4sZwlZvWEbEa1bPmAhi5ZZsh62Nt7Xd3OnMvcj9VK9xkJGJ3Dgx3MmAC54kDl0CST9a4sdRRbMi4gd7v+K8e484TQdHjQMw
IDAQAB"
;
private
static
final
String
signVeriKey
=
"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAg
9VJ19qaoZngq6FcHfKm4qjazl6h9FdhLppIPeHvs9XeEZcqPKkN82qpx7TWGO5jGkMNklFFz85Zp/grGJPwNjWh9LgOBVGtc9/JRffXM5vmPgS/CMNdWdMe9lFE1wLWNUHKuHGQUHP+WRAD9GvR6VLLRm0pAFKxH1WQCDoiU5fBFTsXBsciG2b/x/nttPCcmtMcFPuQFyJVuxpGs3/bmHu/yfxujWCHbfk6fcM3GcnknhCwtut+4TcrrccDWonqtVlQtvf6Ob9YTyXlOYs1xm3OtjHIDRP985N3WUNppfvJwnOaVjorTf5/3fm4F8W2kVshAqixkqXj9HmyqWYKtQ
IDAQAB"
;
// 支付宝小程序对应的加解密密钥
// 支付宝小程序对应的加解密密钥
private
static
final
String
decryptKey
=
"
kpeGeMSDTQZWyheHWt4Iw
g=="
;
private
static
final
String
decryptKey
=
"
ozhATStzhD/F/LV7CFX81
g=="
;
// 支付宝小程序对应的应用私钥
// 支付宝小程序对应的应用私钥
private
static
final
String
privateKey
=
"MIIEv
AIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDltXUqBWcnmTt8O/vc8Br9hF87mKB3+9KQ5jN9Oh8FCs0J+0mED+ggBKLhNCsBb+uyu+MHqs5kBYDTwqp5fDPTyW37RklvfpHcf9HO9o1V7+C+t7qA2GLaXl/G5JDjpIipd+sHLj/yPw5DsTuMi8HUwb+ninSoil0Bg2QqTYL/2TiAfJ3+3s7nKIrjuEUmd47qFfpoyyPP0ZY+3E57M+vkklEvFWy8dCCvEh9bZY4ebVS4IUMLyhATpCqn8ESOjlkaIC4rAuTLhr52+hNsQUGzeVcKmpKGYm4YEhKaiwGW0MecjFd5wLj/ThPNnHNk23CwVfgN74ISu5UwibSHNzydAgMBAAECggEANw2tXfvbhD8SZa0OqR4Wqen+1Q64buk4xyeU8Y9rfc7f42OJdBBH5tyVmPni0L5dNAIZ4G2Md6ZmANqn9uPQnBKrvExVL1abaMhtpXer2gvaxnrMRTMXRhTWSZngK970LgGin57zDoEUTx78EawxMWeaInJpkTdQIRu3dvgKzHxz2uuWPXvRWTsgHrOcya7tjB05aQDJvPmZIfduER170kRw+nkhNLYoaYnfvlG5lBS+Nbw9wJmIt1VziET+anBEjCiQAxZdefsw2O9+N27MR8dToOyY2/03rzByuSZav204D6BG9Ggs47ogfvoszFYzXxedqj8WNXmtW59za++XNQKBgQD8q6WzgKdFp9mdZp0O9WfbYwUnrTnijRIJo6if2YMUipN/nbsEo50MDeWMEVfxrW+JYkgcL5xU6FDtPwoR5uN31NaFluuqSCoOdVtTUgpdNIMIDKbmplr5b8WuF7Ng0mSi9FYhRqbkQS0Lk412/eUxvXWIcyhUnbb3cqGPart/ZwKBgQDovFods6BF1gdfKDIWNZB4wTCUkQ7KOHmHfuHdAhZVMjC0R+TqjXMi6Xgt6N/D4wbJSk00iX3qGDynAxcltPjieER9Nsafm1vb7br+P+mcIz2j61GrDPZ2MvraUq3XJHxzM7BC7xGpISyukTY4UsSjW9r2sENyKYqsfK74HwaVWwKBgFuPxBNBStx2D+j3F3ElQwaAYozXPEO5xVCS6vdKNjMKaJr1SKFMvQtyOb3BRzJAHEwXvnPgWPF34mOm1XpZRhLVoQt1/l6Nmhf1NSwDbdgKwHT5SL4KiKsdcvA8jHdIpslaa5/RX4cVi0JHrRrytMyKkH3q5TGMmZIgCyXSkrF/AoGAa7KVZP81YHu9Z4xbOSnKVAbaKzXBCVT+7/OII1SO7xfNr+9BAEU6jWJKibwkqCoLfuRSO8iQKt7SWlq0wG8xaONMlkDdwwgKhwhIqtT6jpVENfF0FlpmRqYqrRLrfQ5WRJ0bqK2ml4RRf+qUk5XBhvK/rb49R7vvfwgnk4wP6NcCgYBnyaWUQU4tImWXBsIZ8OPZLcjYRmELg43BwYYU3S4vh2NIQAZnPXS56yobTPFGSntDUA3ESxsls60eKeBc1PSPPFOnTuXHs+tx/7AfuvG+pebRKauVXu9hcASvrBZcJoAirYhMKaMmoxdsodMhAc2ttzZyomLpplia1VcmI8NQ4A=
="
;
private
static
final
String
privateKey
=
"MIIEv
QIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDPW3wUq1FRgfjZvTAvwMDu1xFsSd7hOK+ujAN4nE++knvbNQuRU2lKYgGkgiGCrQhpOwOVGK3ghVeBZilJ/an02LQyg6ouQzRlVGQCrw5mewoVHEtwH7Dd5HnPyb/BwS47w8pQYw1O8fWtQzWGRDasLK16FWF8jRbwMIXzBjO5wkX2N/IvAoDZCwODdAMCiWc2n3LDyjJowqR14vGA5uNUdLMjKmSkgmDrLcwAsYvjiHbuk99+ArzAv63lN1QQvIS8d2EtCg0yWve2e1YMuqQVOzfdlKizHLxCJX/AD2njDA0nAr8OF24JK0ejd4KNLfuERmqnmzOzhBd/N0eIzJKxAgMBAAECggEAeMdDzdI/6mb3KPSehaITfsq8tkOM08it49BgETeS52DxTaxnEX3xPUc6x7SYikH5PToHiye116ozXwa/k/5xqVE0HJw+WvYAJely23FVxPFz3Pn/Is8CuSxkm1hbHiNEp8ESLaKUVOBwhjw4h/1hjwXzAcJEZ0TTEJJi4zxAkrh9nQ0mbNJTkJ2Nc/+u+jjdkBMt39L9neoLQ40OENVSWBrz9RPr/wLb+joJpjdm2nllml+3cieFkLCdNuDj37hMzelNYHWd4uQtxbXRrlejCCVWqalInOieJHWJGaT9Ccdy5OpbN8pBPcEX2DRH0qWK3YWn9Fpg7p4Sn3f+jzI0VQKBgQD7EU3gyLJVrKPtMBEvXZoJ4WBSiOU1qjbwJPGLQ2oTakBxa8B3h7iyQRr23bbIXr+NMLoH/49MAbl7bIi/qlo1/fWkc5oWOCwgZYqiPjKi6YV7am6B7Fe4iuSUaRydkuaHw196FXD3kPFhgQtqklgSlh63I+SgbKEVCEdjycMojwKBgQDTblksyB6iHDntLA8vj8VdSVTJoaZEU/+Fajr2pd5hj0VxzqUuxIbryPucBGzdTG/MkGFInDNKK4muhX2EmjxtRRab0W697FxfWrv0YXiauEq0ZviBqLlI6vD4OKRbRC+aUukZ8U90c3LzxeogDEonVQNSsFCLJ9RtseNa+EGwvwKBgQDmXIY8TWlzuqfeJVBfSV7g2e3rTLgieT9XME6AHSbjEYZ3iwpZoioRRDNddykSx/yxq5fFZvMwJhTt7jO6yK9lAtO0RG2JHZk/UGvXWYJUgDd9ebZTd2s1ZBs/IQKkgfkLcHPWLH4uaMtRT3oOGqC8zQj5uPE5UPKrvaDjKmjqeQKBgFaDEHoCaIZshkdFf/E2IsvI9aiLPD05IZS1ourJc/T3arLmmzBHue1Aj7OHHARxAk3xxdywDUyMBAolFPbtJUyQuG+Jgoaz8BgUSFP2jiLAxdCLUaO8JhRwDamDg7zUaaX7xuWWl6xOkPquQN5cKPtvDa0H9+z4nzNDVoQikL6BAoGAZPBjfPnealEjE/hFeA5BmZwcIP68gdtKieYVstSy6/odiC1C+rxGRSTigVlFWjU6UADni01bHGORpzkBPfWKFW+z9FPczHnxGF9ipOKcqpsIFRaw0MkUzeUdaDGfRtSQ6E+Dex6MNiNbvIKwxA4qkjMHaeBKz8/xyLKy0Nhp/dQ
="
;
// 支付宝小程序链接前缀
// 支付宝小程序链接前缀
private
static
final
String
linkPrefix
=
"alipays://platformapi/startapp?appId=%s"
;
private
static
final
String
linkPrefix
=
"alipays://platformapi/startapp?appId=%s"
;
...
@@ -90,6 +93,36 @@ public class AlipayLoginManager {
...
@@ -90,6 +93,36 @@ public class AlipayLoginManager {
return
JsonUtils
.
getValueByPath
(
plainData
,
"mobile"
);
return
JsonUtils
.
getValueByPath
(
plainData
,
"mobile"
);
}
}
public
String
getAlipayUserId
(
String
loginCode
)
{
logger
.
info
(
"开始解密获取支付宝小程序登录用户的access_token"
);
AlipayConfig
alipayConfig
=
new
AlipayConfig
();
alipayConfig
.
setServerUrl
(
"https://openapi.alipay.com/gateway.do"
);
alipayConfig
.
setAppId
(
appid
);
alipayConfig
.
setPrivateKey
(
privateKey
);
alipayConfig
.
setFormat
(
"json"
);
alipayConfig
.
setAlipayPublicKey
(
signVeriKey
);
alipayConfig
.
setCharset
(
"UTF8"
);
alipayConfig
.
setSignType
(
"RSA2"
);
try
{
AlipayClient
alipayClient
=
new
DefaultAlipayClient
(
alipayConfig
);
AlipaySystemOauthTokenRequest
request
=
new
AlipaySystemOauthTokenRequest
();
request
.
setCode
(
loginCode
);
request
.
setGrantType
(
"authorization_code"
);
AlipaySystemOauthTokenResponse
response
=
alipayClient
.
execute
(
request
);
logger
.
info
(
"调用支付宝小程序获取登录用户的access_token的结果:"
+
response
.
getBody
());
if
(
response
.
isSuccess
())
{
logger
.
info
(
"调用支付宝小程序获取登录用户的access_token成功"
);
return
JsonUtils
.
getValueByPath
(
response
.
getBody
(),
"alipay_system_oauth_token_response/user_id"
);
}
else
{
logger
.
info
(
"调用支付宝小程序获取登录用户的access_token失败"
);
return
""
;
}
}
catch
(
Exception
e
)
{
logger
.
error
(
"调用支付宝小程序获取登录用户的access_token异常"
);
return
""
;
}
}
/**
/**
* 获取二维码
* 获取二维码
*
*
...
...
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