Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
62772b04
Commit
62772b04
authored
May 12, 2020
by
季圣华
Browse files
给系统设置增加演示用户禁止操作的判断(再次优化)
parent
5279bdc9
Changes
3
Hide whitespace changes
Inline
Side-by-side
erp_web/js/common/common.js
View file @
62772b04
...
...
@@ -426,15 +426,29 @@
* 检查当前用户是否是演示用户
*/
function
checkIsTestUser
()
{
var
res
=
false
;
var
loginName
=
sessionStorage
.
getItem
(
"
loginName
"
);
if
(
loginName
==
"
jsh
"
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
演示用户禁止操作!
'
,
'
warning
'
);
res
=
true
;
}
else
{
res
=
false
;
var
result
=
false
;
var
demonstrateOpen
=
false
;
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/user/getDemonstrateOpen
"
,
dataType
:
"
json
"
,
async
:
false
,
//设置为同步
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
demonstrateOpen
=
res
.
data
.
demonstrateOpen
;
}
}
});
if
(
demonstrateOpen
)
{
var
loginName
=
sessionStorage
.
getItem
(
"
loginName
"
);
if
(
loginName
==
"
jsh
"
)
{
$
.
messager
.
alert
(
'
提示
'
,
'
演示用户禁止操作!
'
,
'
warning
'
);
result
=
true
;
}
else
{
result
=
false
;
}
}
return
res
;
return
res
ult
;
}
/**
...
...
src/main/java/com/jsh/erp/controller/UserController.java
View file @
62772b04
...
...
@@ -43,6 +43,9 @@ public class UserController {
@Value
(
"${manage.roleId}"
)
private
Integer
manageRoleId
;
@Value
(
"${demonstrate.open}"
)
private
boolean
demonstrateOpen
;
@Resource
private
UserService
userService
;
...
...
@@ -56,6 +59,27 @@ public class UserController {
private
static
final
String
HTTP
=
"http://"
;
private
static
final
String
CODE_OK
=
"200"
;
/**
* 是否开启演示状态,默认关闭
* @param request
* @return
*/
@GetMapping
(
value
=
"/getDemonstrateOpen"
)
public
BaseResponseInfo
getDemonstrateOpen
(
HttpServletRequest
request
)
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
try
{
Map
<
String
,
Object
>
data
=
new
HashMap
<
String
,
Object
>();
data
.
put
(
"demonstrateOpen"
,
demonstrateOpen
);
res
.
code
=
200
;
res
.
data
=
data
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取失败"
;
}
return
res
;
}
@PostMapping
(
value
=
"/login"
)
public
BaseResponseInfo
login
(
@RequestParam
(
value
=
"loginName"
,
required
=
false
)
String
loginName
,
@RequestParam
(
value
=
"password"
,
required
=
false
)
String
password
,
...
...
src/main/resources/application.properties
View file @
62772b04
...
...
@@ -16,6 +16,8 @@ manage.roleId=10
tenant.userNumLimit
=
5
#租户允许创建的单据数
tenant.billsNumLimit
=
200
#演示模式-默认为false
demonstrate.open
=
false
#插件配置
plugin.runMode
=
prod
plugin.pluginPath
=
plugins
...
...
Write
Preview
Supports
Markdown
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