Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
V
volunteer_service
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
licc
volunteer_service
Commits
23631543
Commit
23631543
authored
Feb 07, 2021
by
liaoanyuan
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/master'
parents
79fd0b26
1d039083
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
11 deletions
+13
-11
pom.xml
wisenergy-service/pom.xml
+1
-1
WxPayUtil.java
...ce/src/main/java/cn/wisenergy/service/util/WxPayUtil.java
+1
-1
WxCommon.java
...ce/src/main/java/cn/wisenergy/service/wxpay/WxCommon.java
+3
-1
FileUploadController.java
...energy/web/admin/controller/app/FileUploadController.java
+8
-8
No files found.
wisenergy-service/pom.xml
View file @
23631543
...
...
@@ -74,9 +74,9 @@
</dependency>
</dependencies>
<!-- MAVEN构建 -->
<build>
<finalName>
${project.artifactId}-${moduleVersion.wisenergy-mapper}
</finalName>
</build>
</project>
\ No newline at end of file
wisenergy-service/src/main/java/cn/wisenergy/service/util/WxPayUtil.java
View file @
23631543
...
...
@@ -45,7 +45,7 @@ public class WxPayUtil {
private
static
String
apiV3Key
=
WxCommon
.
SECRET_KEY
;
// 你的商户私钥
private
static
String
privateKey
=
"-----BEGIN PRIVATE KEY-----\n"
+
WxCommon
.
PRIVATE
_KEY
private
static
String
privateKey
=
"-----BEGIN PRIVATE KEY-----\n"
+
WxCommon
.
SECRET
_KEY
+
"-----END PRIVATE KEY-----\n"
;
private
static
CloseableHttpClient
httpClient
;
...
...
wisenergy-service/src/main/java/cn/wisenergy/service/wxpay/WxCommon.java
View file @
23631543
...
...
@@ -16,7 +16,9 @@ public class WxCommon {
public
static
final
String
WX_PAY_URL
=
"https://api.mch.weixin.qq.com/v3/pay/transactions/native"
;
public
static
final
String
WX_PAY_QUERY
=
" https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/"
;
public
static
final
String
WX_PAY_QUERY
=
"https://api.mch.weixin.qq.com/v3/pay/transactions/out-trade-no/"
;
public
static
final
String
SECRET_KEY
=
"MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDhGq+iGQueP8EU"
+
"3qj0T0Otnha0XboVcgmeDkgbe08H54WiF9d3R4aLAo+wAkAj/R7nRw2yWeaaMEgb"
+
"ZvUz03IioVKwLhaMVEtwE5sNFCMGDDh9jGjm66j+BYgVk02P5hUAcYLcJYeo9iHA"
+
...
...
wisenergy-web-admin/src/main/java/cn/wisenergy/web/admin/controller/app/FileUploadController.java
View file @
23631543
...
...
@@ -16,10 +16,10 @@ import java.io.IOException;
import
java.util.UUID
;
/**
*@ Description:
*@ Author : 86187
*@ Date : 2021/2/3 17:05
* @author 86187
* @ Description:
* @ Author : 86187
* @ Date : 2021/2/3 17:05
*/
@Api
(
tags
=
"图片上传"
)
@RestController
...
...
@@ -42,12 +42,12 @@ public class FileUploadController {
/**
* 允许上传的格式
*/
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
".bmp"
,
".jpg"
,
".jpeg"
,
".gif"
,
".png"
};
private
static
final
String
[]
IMAGE_TYPE
=
new
String
[]{
".bmp"
,
".jpg"
,
".jpeg"
,
".gif"
,
".png"
,
".xlsx"
,
".xls"
};
@ApiOperation
(
value
=
"文件上传"
,
notes
=
"文件上传"
)
@PostMapping
(
value
=
"/upload"
,
headers
=
"content-type=multipart/form-data"
)
public
R
file
(
@ApiParam
(
required
=
true
,
value
=
"
用户头像
"
)
@ApiParam
(
required
=
true
,
value
=
"
上传文件
"
)
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletRequest
request
)
{
...
...
@@ -55,7 +55,7 @@ public class FileUploadController {
if
(
file
.
isEmpty
())
{
// 上传文件为空
return
R
.
error
(
"上传
图片
不能为空"
);
return
R
.
error
(
"上传
文件
不能为空"
);
}
for
(
String
type
:
IMAGE_TYPE
)
{
if
(
StringUtils
.
endsWithIgnoreCase
(
file
.
getOriginalFilename
(),
type
))
{
...
...
@@ -64,7 +64,7 @@ public class FileUploadController {
}
}
if
(
isLegal
)
{
return
R
.
error
(
"
图片
类型不符合"
);
return
R
.
error
(
"
上传文件
类型不符合"
);
}
File
folder
=
new
File
(
uploadImagesLocation
);
if
(!
folder
.
exists
())
{
...
...
@@ -79,6 +79,6 @@ public class FileUploadController {
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
return
R
.
error
(
"
图片上传
失败!"
);
return
R
.
error
(
"
上传文件
失败!"
);
}
}
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