Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
guns-vip
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
guns-vip
Commits
84844ac5
Commit
84844ac5
authored
Dec 12, 2019
by
fengshuonan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复权限异常会登录超时的问题
parent
edbbd56e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
6 additions
and
22 deletions
+6
-22
guns-base-support/guns-base-auth/src/main/java/cn/stylefeng/guns/base/auth/exception/enums/AuthExceptionEnum.java
+3
-1
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/auth/filter/JwtAuthorizationTokenFilter.java
+1
-0
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/Const.java
+0
-19
guns-base-support/guns-sys/src/main/webapp/assets/common/js/common.js
+1
-1
guns-base-support/guns-sys/src/main/webapp/assets/modular/system/user/user.js
+1
-1
No files found.
guns-base-support/guns-base-auth/src/main/java/cn/stylefeng/guns/base/auth/exception/enums/AuthExceptionEnum.java
View file @
84844ac5
...
@@ -24,7 +24,9 @@ public enum AuthExceptionEnum implements AbstractBaseExceptionEnum {
...
@@ -24,7 +24,9 @@ public enum AuthExceptionEnum implements AbstractBaseExceptionEnum {
VALID_CODE_ERROR
(
1406
,
"验证码错误"
),
VALID_CODE_ERROR
(
1406
,
"验证码错误"
),
NO_PERMISSION
(
1500
,
"没有权限访问资源"
);
NO_PERMISSION
(
1500
,
"没有权限访问资源"
),
SESSION_TIMEOUT
(
1501
,
"登录会话超时"
);
AuthExceptionEnum
(
int
code
,
String
message
)
{
AuthExceptionEnum
(
int
code
,
String
message
)
{
this
.
code
=
code
;
this
.
code
=
code
;
...
...
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/auth/filter/JwtAuthorizationTokenFilter.java
View file @
84844ac5
...
@@ -99,6 +99,7 @@ public class JwtAuthorizationTokenFilter extends OncePerRequestFilter {
...
@@ -99,6 +99,7 @@ public class JwtAuthorizationTokenFilter extends OncePerRequestFilter {
}
}
//跳转到登录超时
//跳转到登录超时
response
.
setHeader
(
"Guns-Session-Timeout"
,
"true"
);
request
.
getRequestDispatcher
(
"/global/sessionError"
).
forward
(
request
,
response
);
request
.
getRequestDispatcher
(
"/global/sessionError"
).
forward
(
request
,
response
);
return
;
return
;
...
...
guns-base-support/guns-sys/src/main/java/cn/stylefeng/guns/sys/core/constant/Const.java
View file @
84844ac5
...
@@ -15,10 +15,6 @@
...
@@ -15,10 +15,6 @@
*/
*/
package
cn
.
stylefeng
.
guns
.
sys
.
core
.
constant
;
package
cn
.
stylefeng
.
guns
.
sys
.
core
.
constant
;
import
cn.hutool.core.collection.CollectionUtil
;
import
java.util.List
;
/**
/**
* 系统常量
* 系统常量
*
*
...
@@ -42,19 +38,4 @@ public interface Const {
...
@@ -42,19 +38,4 @@ public interface Const {
*/
*/
Long
ADMIN_ROLE_ID
=
1L
;
Long
ADMIN_ROLE_ID
=
1L
;
/**
* 不需要权限验证的资源表达式
*/
List
<
String
>
NONE_PERMISSION_RES
=
CollectionUtil
.
newLinkedList
(
"/assets/**"
,
"/gunsApi/**"
,
"/login"
,
"/global/sessionError"
,
"/kaptcha"
,
"/error"
,
"/global/error"
,
"/oauth/**"
,
"/tran/**"
,
"/favicon.ico"
);
}
}
guns-base-support/guns-sys/src/main/webapp/assets/common/js/common.js
View file @
84844ac5
...
@@ -141,7 +141,7 @@ layui.config({
...
@@ -141,7 +141,7 @@ layui.config({
complete
:
function
(
XMLHttpRequest
,
textStatus
)
{
complete
:
function
(
XMLHttpRequest
,
textStatus
)
{
//如果超时就处理 ,指定要跳转的页面
//如果超时就处理 ,指定要跳转的页面
if
(
XMLHttpRequest
.
responseJSON
.
code
===
1500
)
{
if
(
XMLHttpRequest
.
getResponseHeader
(
"Guns-Session-Timeout"
)
===
"true"
)
{
window
.
location
=
Feng
.
ctxPath
+
"/global/sessionError"
;
window
.
location
=
Feng
.
ctxPath
+
"/global/sessionError"
;
}
}
...
...
guns-base-support/guns-sys/src/main/webapp/assets/modular/system/user/user.js
View file @
84844ac5
...
@@ -143,7 +143,7 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'ax', 'func',
...
@@ -143,7 +143,7 @@ layui.use(['layer', 'form', 'table', 'ztree', 'laydate', 'admin', 'ax', 'func',
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/reset"
,
function
(
data
)
{
var
ajax
=
new
$ax
(
Feng
.
ctxPath
+
"/mgr/reset"
,
function
(
data
)
{
Feng
.
success
(
"重置密码成功!"
);
Feng
.
success
(
"重置密码成功!"
);
},
function
(
data
)
{
},
function
(
data
)
{
Feng
.
error
(
"重置密码失败!"
);
Feng
.
error
(
"重置密码失败!"
+
data
.
responseJSON
.
message
+
"!"
);
});
});
ajax
.
set
(
"userId"
,
data
.
userId
);
ajax
.
set
(
"userId"
,
data
.
userId
);
ajax
.
start
();
ajax
.
start
();
...
...
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