| | |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * Created by vincent on 2019-07-30 |
| | |
| | | return R.ok("激活成功,有效期至"+DateUtils.convert(exprTime)); |
| | | } |
| | | |
| | | @RequestMapping("/menu/pda/auth") |
| | | @ManagerAuth |
| | | public R menuPda(){ |
| | | Long userId = getUserId(); |
| | | List<RolePermission> rolePermissions; |
| | | if (userId == 9527L) { |
| | | rolePermissions = rolePermissionService.selectList(new EntityWrapper<>()); |
| | | } else { |
| | | Long roleId = getUser().getRoleId(); |
| | | rolePermissions = rolePermissionService.selectList(new EntityWrapper<RolePermission>().eq("role_id", roleId)); |
| | | } |
| | | if (Cools.isEmpty(rolePermissions)) { |
| | | return R.ok(); |
| | | } |
| | | List<Long> collect = rolePermissions.stream().map(RolePermission::getPermissionId).distinct().collect(Collectors.toList()); |
| | | List<Permission> permissions = permissionService.selectBatchIds(collect); |
| | | return R.ok().add(permissions); |
| | | } |
| | | |
| | | } |
| | |
| | | return R.error(); |
| | | } |
| | | if (null == permission.getId()){ |
| | | permission.setStatus((short) 1); |
| | | permissionService.insert(permission); |
| | | } else { |
| | | permissionService.updateById(permission); |
| | |
| | | @RequestMapping(value = "/permission/add/auth") |
| | | @ManagerAuth |
| | | public R add(Permission permission) { |
| | | permission.setStatus((short) 1); |
| | | permissionService.insert(permission); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/permission/update/auth") |
| | | @RequestMapping(value = "/permission/update/auth") |
| | | @ManagerAuth |
| | | public R update(Permission permission){ |
| | | if (Cools.isEmpty(permission) || null==permission.getId()){ |
| | |
| | | server: |
| | | port: 8081 |
| | | port: 8080 |
| | | servlet: |
| | | context-path: /@pom.build.finalName@ |
| | | |
| | |
| | | enabled: false |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=phpsasrs |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=phpsasrs |
| | | url: jdbc:sqlserver://127.0.0.1:1433;databasename=phpsasrs |
| | | username: sa |
| | | password: sa@123 |
| | | mvc: |
| | |
| | | cellMinWidth: 50, |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'} |
| | | ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | // ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80} |
| | | ,{field: 'name', align: 'center',title: '权限名称'} |
| | | ,{field: 'action', align: 'center',title: '接口地址'} |
| | | ,{field: 'resourceName', align: 'center',title: '所属菜单',event: 'Resource', style: 'text-decoration: underline;cursor:pointer'} |
| | | ,{field: 'status$', align: 'center',title: '状态'} |
| | | // ,{field: 'resourceName', align: 'center',title: '所属菜单',event: 'Resource', style: 'text-decoration: underline;cursor:pointer'} |
| | | // ,{field: 'status$', align: 'center',title: '状态'} |
| | | |
| | | ,{fixed: 'right', title:'操作', align: 'center', toolbar: '#operate', width:150} |
| | | ]], |
| | |
| | | shadeClose: false, |
| | | content: 'permission_detail.html', |
| | | success: function(layero, index){ |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | clearFormVal(layer.getChildFrame('#detail', index)); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | } |
| | | }); |
| | |
| | | if (param === undefined) { |
| | | layer.msg("无数据"); |
| | | } else { |
| | | layer.open({ |
| | | type: 2, |
| | | title: '所属详情', |
| | | maxmin: true, |
| | | area: [top.detailHeight, top.detailWidth], |
| | | shadeClose: false, |
| | | content: '../resource/resource_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | layer.open({ |
| | | type: 2, |
| | | title: '所属详情', |
| | | maxmin: true, |
| | | area: [top.detailHeight, top.detailWidth], |
| | | shadeClose: false, |
| | | content: '../resource/resource_detail.html', |
| | | success: function(layero, index){ |
| | | $.ajax({ |
| | | url: baseUrl+"/resource/"+ param +"/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | method: 'GET', |
| | | success: function (res) { |
| | | if (res.code === 200){ |
| | | setFormVal(layer.getChildFrame('#detail', index), res.data, true); |
| | | top.convertDisabled(layer.getChildFrame('#data-detail :input', index), true); |
| | | layer.getChildFrame('#data-detail-submit', index).hide(); |
| | | layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"}); |
| | | layero.find('iframe')[0].contentWindow.layui.form.render('select'); |
| | | } else if (res.code === 403){ |
| | | parent.location.href = "/"; |
| | | }else { |
| | | layer.msg(res.msg) |
| | | } |
| | | } |
| | | }) |
| | | } |
| | | }); |
| | | } |
| | | break; |
| | | |
| | |
| | | <input id="action" class="layui-input" type="text" placeholder="接口地址" lay-verify="required" > |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label">所属菜单:</label> |
| | | <div class="layui-input-inline cool-auto-complete"> |
| | | <input id="resourceId" class="layui-input" type="text" placeholder="所属菜单" style="display: none"> |
| | | <input id="resourceName" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="所属菜单" onfocus=this.blur()> |
| | | <div class="cool-auto-complete-window"> |
| | | <input class="cool-auto-complete-window-input" data-key="resourceQuery" onkeyup="autoLoad(this.getAttribute('data-key'))"> |
| | | <select class="cool-auto-complete-window-select" data-key="resourceQuerySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline" style="width:31%;"> |
| | | <label class="layui-form-label"><span class="not-null">*</span>状 态:</label> |
| | | <div class="layui-input-inline"> |
| | | <select id="status" lay-verify="required"> |
| | | <option value="" style="display: none"></option> |
| | | <option value="1">正常</option> |
| | | <option value="0">禁用</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!-- <div class="layui-inline" style="width:31%;">--> |
| | | <!-- <label class="layui-form-label">所属菜单:</label>--> |
| | | <!-- <div class="layui-input-inline cool-auto-complete">--> |
| | | <!-- <input id="resourceId" class="layui-input" type="text" placeholder="所属菜单" style="display: none">--> |
| | | <!-- <input id="resourceName" class="layui-input cool-auto-complete-div" onclick="autoShow(this.id)" type="text" placeholder="所属菜单" onfocus=this.blur()>--> |
| | | <!-- <div class="cool-auto-complete-window">--> |
| | | <!-- <input class="cool-auto-complete-window-input" data-key="resourceQuery" onkeyup="autoLoad(this.getAttribute('data-key'))">--> |
| | | <!-- <select class="cool-auto-complete-window-select" data-key="resourceQuerySelect" onchange="confirmed(this.getAttribute('data-key'))" multiple="multiple">--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | <!-- <div class="layui-inline" style="width:31%;">--> |
| | | <!-- <label class="layui-form-label"><span class="not-null">*</span>状 态:</label>--> |
| | | <!-- <div class="layui-input-inline">--> |
| | | <!-- <select id="status" lay-verify="required">--> |
| | | <!-- <option value="" style="display: none"></option>--> |
| | | <!-- <option value="1">正常</option>--> |
| | | <!-- <option value="0">禁用</option>--> |
| | | <!-- </select>--> |
| | | <!-- </div>--> |
| | | <!-- </div>--> |
| | | |
| | | |
| | | <hr class="layui-bg-gray"> |