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
a4a82dba
Commit
a4a82dba
authored
Dec 25, 2024
by
shiyu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
登录4
parent
302dda9f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
144 additions
and
9 deletions
+144
-9
ch-core/src/main/java/com/wwdz/ch/core/api/qiandao/QdWxLoginManager.java
...n/java/com/wwdz/ch/core/api/qiandao/QdWxLoginManager.java
+4
-4
ch-core/src/main/java/com/wwdz/ch/core/config/QdWxConfig.java
...ore/src/main/java/com/wwdz/ch/core/config/QdWxConfig.java
+54
-0
ch-core/src/main/java/com/wwdz/ch/core/config/QdWxProperties.java
...src/main/java/com/wwdz/ch/core/config/QdWxProperties.java
+69
-0
ch-core/src/main/resources/application-dev.yml
ch-core/src/main/resources/application-dev.yml
+10
-4
ch-core/src/main/resources/application-prod.yml
ch-core/src/main/resources/application-prod.yml
+7
-1
No files found.
ch-core/src/main/java/com/wwdz/ch/core/api/qiandao/QdWxLoginManager.java
View file @
a4a82dba
...
...
@@ -17,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.io.InputStream
;
import
java.util.HashMap
;
import
java.util.LinkedHashMap
;
...
...
@@ -30,10 +31,10 @@ import java.util.concurrent.TimeUnit;
public
class
QdWxLoginManager
{
private
static
final
Logger
logger
=
LoggerFactory
.
getLogger
(
QdWxLoginManager
.
class
);
@Value
(
"${dts.
wx.qd_
app-id}"
)
@Value
(
"${dts.
qdwx.
app-id}"
)
private
String
APPLET_APPID
;
@Value
(
"${dts.
wx.qd_
app-secret}"
)
@Value
(
"${dts.
qdwx.
app-secret}"
)
private
String
APPLET_APP_SECRET
;
/**
...
...
@@ -50,8 +51,7 @@ public class QdWxLoginManager {
// 微信小程序获取短链接地址
private
static
final
String
GET_LINK_URL
=
"https://api.weixin.qq.com/wxa/genwxashortlink?access_token=%s"
;
@Autowired
@Resource
(
name
=
"qdWxMaService"
)
private
WxMaService
wxMaService
;
@Autowired
...
...
ch-core/src/main/java/com/wwdz/ch/core/config/QdWxConfig.java
0 → 100644
View file @
a4a82dba
package
com.wwdz.ch.core.config
;
import
cn.binarywang.wx.miniapp.api.WxMaService
;
import
cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl
;
import
cn.binarywang.wx.miniapp.config.WxMaConfig
;
import
cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig
;
import
com.github.binarywang.wxpay.config.WxPayConfig
;
import
com.github.binarywang.wxpay.service.WxPayService
;
import
com.github.binarywang.wxpay.service.impl.WxPayServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
public
class
QdWxConfig
{
@Autowired
private
QdWxProperties
qdWxProperties
;
@Bean
(
name
=
"qdWxMaConfig"
)
public
WxMaConfig
qdWxMaConfig
()
{
WxMaInMemoryConfig
config
=
new
WxMaInMemoryConfig
();
config
.
setAppid
(
qdWxProperties
.
getQdAppId
());
config
.
setSecret
(
qdWxProperties
.
getAppSecret
());
return
config
;
}
@Bean
(
name
=
"qdWxMaService"
)
public
WxMaService
qdWxMaService
(
WxMaConfig
qdWxMaConfig
)
{
WxMaService
service
=
new
WxMaServiceImpl
();
service
.
setWxMaConfig
(
qdWxMaConfig
);
return
service
;
}
@Bean
public
WxPayConfig
qdWxPayConfig
()
{
WxPayConfig
payConfig
=
new
WxPayConfig
();
payConfig
.
setAppId
(
qdWxProperties
.
getQdAppId
());
payConfig
.
setMchId
(
qdWxProperties
.
getMchId
());
payConfig
.
setMchKey
(
qdWxProperties
.
getMchKey
());
payConfig
.
setNotifyUrl
(
qdWxProperties
.
getNotifyUrl
());
payConfig
.
setKeyPath
(
qdWxProperties
.
getKeyPath
());
payConfig
.
setTradeType
(
"JSAPI"
);
payConfig
.
setSignType
(
"MD5"
);
return
payConfig
;
}
@Bean
public
WxPayService
qdWxPayService
(
WxPayConfig
wxPayConfig
)
{
WxPayService
wxPayService
=
new
WxPayServiceImpl
();
wxPayService
.
setConfig
(
wxPayConfig
);
return
wxPayService
;
}
}
\ No newline at end of file
ch-core/src/main/java/com/wwdz/ch/core/config/QdWxProperties.java
0 → 100644
View file @
a4a82dba
package
com.wwdz.ch.core.config
;
import
org.springframework.boot.context.properties.ConfigurationProperties
;
import
org.springframework.context.annotation.Configuration
;
@Configuration
@ConfigurationProperties
(
prefix
=
"dts.qdwx"
)
public
class
QdWxProperties
{
private
String
appId
;
private
String
appSecret
;
private
String
mchId
;
private
String
mchKey
;
private
String
notifyUrl
;
private
String
keyPath
;
public
String
getNotifyUrl
()
{
return
notifyUrl
;
}
public
void
setNotifyUrl
(
String
notifyUrl
)
{
this
.
notifyUrl
=
notifyUrl
;
}
public
String
getMchKey
()
{
return
mchKey
;
}
public
void
setMchKey
(
String
mchKey
)
{
this
.
mchKey
=
mchKey
;
}
public
String
getQdAppId
()
{
return
appId
;
}
public
void
setQdAppId
(
String
qdAppId
)
{
this
.
appId
=
qdAppId
;
}
public
String
getAppSecret
()
{
return
appSecret
;
}
public
void
setAppSecret
(
String
appSecret
)
{
this
.
appSecret
=
appSecret
;
}
public
String
getMchId
()
{
return
mchId
;
}
public
void
setMchId
(
String
mchId
)
{
this
.
mchId
=
mchId
;
}
public
String
getKeyPath
()
{
return
keyPath
;
}
public
void
setKeyPath
(
String
keyPath
)
{
this
.
keyPath
=
keyPath
;
}
}
ch-core/src/main/resources/application-dev.yml
View file @
a4a82dba
dts
:
qdwx
:
#乾岛
app-id
:
wx598b9e95a8b13209
app-secret
:
107406ff0fcc8d7c3a658b90dd938a08
merchant-id
:
123
private-key
:
123
merchant-serial_number
:
123
apiV3Key
:
123123
pay-notify-url
:
123
# 开发者应该设置成自己的wx相关信息
# 更换主体要更换id和secret
wx
:
#乾岛
qd_app-id
:
wx598b9e95a8b13209
qd_app-secret
:
107406ff0fcc8d7c3a658b90dd938a08
app-id
:
wx5b4409448bf2c72b
app-secret
:
6fee0d7b2197845fed0a3fe8f5a9bd66
...
...
ch-core/src/main/resources/application-prod.yml
View file @
a4a82dba
dts
:
# 开发者应该设置成自己的wx相关信息
wx
:
qd
wx
:
#乾岛
qd_app-id
:
wx598b9e95a8b13209
qd_app-secret
:
107406ff0fcc8d7c3a658b90dd938a08
merchant-id
:
123
private-key
:
123
merchant-serial_number
:
123
apiV3Key
:
123123
pay-notify-url
:
123
wx
:
app-id
:
wx5b4409448bf2c72b
app-secret
:
6fee0d7b2197845fed0a3fe8f5a9bd66
mch-id
:
1538666666
...
...
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