| | |
| | | |
| | | 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(); |
| | | } |
| | |
| | | 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} |
| | | ]], |
| | |
| | | <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"> |