master
dalong306 4 years ago
commit 37add536e2

@ -28,7 +28,9 @@ public class PermissionManagerImpl implements PermissionManager {
private PermissionModuleMapper permissionModuleMapper;
@Resource
private PermissionReader permissionReader;
@Override
@Transactional
public void synchronizeFunctions() {
List<JSONObject> functions = permissionFunctionMapper.listAll();
Map<String, JSONObject> funcMapFromDB = new HashMap<>();
@ -40,7 +42,7 @@ public class PermissionManagerImpl implements PermissionManager {
for (PermissionNode node : nodes) {
String funcId = node.getFuncId();
if (funcMapFromDB.containsKey(funcId.toLowerCase())) {
funcMapFromDB.remove(funcId);
funcMapFromDB.remove(funcId.toLowerCase());
JSONObject func = node.initFuncObject();
func.remove("role");
permissionFunctionMapper.update(func);
@ -142,7 +144,7 @@ public class PermissionManagerImpl implements PermissionManager {
}
@Override
@CacheEvict(value = ":login:managers:",allEntries = true)
@CacheEvict(value = ":login:managers:", allEntries = true)
public void setFunctionModule(String funcId, String moduleName) {
if (moduleName == null) {
throw new BadRequestException("module name not provided");
@ -169,7 +171,7 @@ public class PermissionManagerImpl implements PermissionManager {
@Override
@Transactional
@CacheEvict(value = ":login:managers:",allEntries = true)
@CacheEvict(value = ":login:managers:", allEntries = true)
public void authorizeRole(ManagerRole role, List<String> functions) {
permissionFunctionMapper.clearRolePermission(role.getInverseMask());
permissionFunctionMapper.authorizeRole(role.getMask(), functions);
@ -181,5 +183,4 @@ public class PermissionManagerImpl implements PermissionManager {
}
}

@ -25,12 +25,12 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="wechat_rate_value" stringToNumber2 class="form-control" ng-model="rate.wechat_rate_value"
min="0.6" max="5" step="0.1" id="wechat_rate_value_input" required>
min="0.6" max="10" step="0.1" id="wechat_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.wechat_rate_value.$error" ng-if="rate_form.wechat_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0%
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
@ -48,12 +48,12 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipay_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipay_rate_value"
min="0.6" max="5" step="0.1" id="alipay_rate_value_input" required>
min="0.6" max="10" step="0.1" id="alipay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipay_rate_value.$error" ng-if="rate_form.alipay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0%
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
@ -71,12 +71,12 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="alipayonline_rate_value" stringToNumber2 class="form-control" ng-model="rate.alipayonline_rate_value"
min="0.6" max="5.0" step="0.1" id="alipayonline_rate_value_input" required>
min="0.6" max="10.0" step="0.1" id="alipayonline_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.alipayonline_rate_value.$error" ng-if="rate_form.alipayonline_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0%
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
@ -95,12 +95,12 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="Rpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.Rpay_rate_value"
min="0.6" max="5" step="0.1" id="Rpay_rate_value_input" required>
min="0.6" max="10" step="0.1" id="Rpay_rate_value_input" required>
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.Rpay_rate_value.$error" ng-if="rate_form.Rpay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0%
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%
@ -143,12 +143,12 @@
<div class="col-sm-6">
<div class="input-group">
<input type="number" name="cb_bankpay_rate_value" stringToNumber2 class="form-control" ng-model="rate.cb_bankpay_rate_value"
min="0.6" max="5" step="0.1" id="cb_bankpay_rate_value_input">
min="0.6" max="10" step="0.1" id="cb_bankpay_rate_value_input">
<div class="input-group-addon">%</div>
</div>
<div ng-messages="rate_form.cb_bankpay_rate_value.$error" ng-if="rate_form.cb_bankpay_rate_value.$dirty">
<div class="small text-danger" ng-message="max">
<i class="glyphicon glyphicon-alert"></i> No more than 5.0%
<i class="glyphicon glyphicon-alert"></i> No more than 10.0%
</div>
<div class="small text-danger" ng-message="min">
<i class="glyphicon glyphicon-alert"></i> No less than 0.6%

Loading…
Cancel
Save