Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
smart_gov_platform
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
赵啸非
smart_gov_platform
Commits
cf3ad0e9
Commit
cf3ad0e9
authored
Jul 10, 2024
by
赵啸非
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加门户license验证
parent
fc7baa17
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
portal-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/LicenseInterceptor.java
...ls/xhx/base/framework/interceptor/LicenseInterceptor.java
+2
-2
portal-manager/src/main/java/com/mortals/xhx/module/cipher/web/CipherController.java
...a/com/mortals/xhx/module/cipher/web/CipherController.java
+6
-3
No files found.
portal-manager/src/main/java/com/mortals/xhx/base/framework/interceptor/LicenseInterceptor.java
View file @
cf3ad0e9
...
...
@@ -25,9 +25,9 @@ import java.rmi.RemoteException;
* @author: zxfei
* @date: 2024/7/9 13:49
*/
@Component
//
@Component
@Slf4j
@ConditionalOnProperty
(
prefix
=
"license"
,
name
=
"enable"
,
havingValue
=
"true"
)
//
@ConditionalOnProperty(prefix = "license",name = "enable", havingValue = "true")
public
class
LicenseInterceptor
extends
BaseInterceptor
{
@Resource
...
...
portal-manager/src/main/java/com/mortals/xhx/module/cipher/web/CipherController.java
View file @
cf3ad0e9
...
...
@@ -3,7 +3,9 @@ package com.mortals.xhx.module.cipher.web;
import
cn.hutool.core.date.DateUtil
;
import
com.github.xiaoymin.knife4j.annotations.ApiOperationSupport
;
import
com.mortals.framework.annotation.UnAuth
;
import
com.mortals.framework.common.Rest
;
import
com.mortals.xhx.base.framework.config.LicenseHandler
;
import
com.mortals.xhx.common.utils.CipherUtil
;
import
com.mortals.xhx.common.utils.DecodeUtil
;
import
com.mortals.xhx.common.utils.LicenseUtil
;
...
...
@@ -15,6 +17,7 @@ import org.springframework.web.bind.annotation.GetMapping;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.Map
;
...
...
@@ -36,7 +39,6 @@ public class CipherController {
@Value
(
"${sys.license.pub}"
)
private
String
pubPath
;
/**
* 用户在点击,查看`授权信息`按钮时,请求check接口,进行一次授权验证(每天第一次通过其他接口访问系统时,也会验证一次 )
* 如果通过则返回授权信息(开始+结束时间)
...
...
@@ -45,6 +47,7 @@ public class CipherController {
* @return
*/
@GetMapping
(
"/check"
)
@UnAuth
public
Rest
<
Map
<
String
,
String
>>
check
()
{
// 验证是否通过了授权,通过了返回授权信息(开始+结束时间)
try
{
...
...
@@ -66,8 +69,8 @@ public class CipherController {
return
Rest
.
ok
(
resultMap
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
()
,
e
);
return
Rest
.
fail
(
"获取授权信息失败"
);
log
.
error
(
"检测授权异常"
,
e
);
return
Rest
.
fail
(
e
.
getMessage
()
);
}
}
...
...
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