管理员列表优化,权限优化
This commit is contained in:
@@ -27,7 +27,7 @@ export function delRole(pram) {
|
||||
|
||||
export function getInfo(pram) {
|
||||
const data = {
|
||||
id: pram.id
|
||||
ids: pram.id
|
||||
}
|
||||
return request({
|
||||
url: '/admin/system/role/info',
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export function getRoleById(pram) {
|
||||
const data = { id: pram.id }
|
||||
const data = { ids: pram.roles }
|
||||
return request({
|
||||
url: '/admin/system/role/info',
|
||||
method: 'GET',
|
||||
|
||||
@@ -66,7 +66,6 @@
|
||||
handleSetVisitChart() {
|
||||
this.myChart = echarts.init(document.getElementById(this.echarts))
|
||||
let option = null
|
||||
console.log(this.echartsTitle)
|
||||
if (this.echartsTitle === 'circle') {
|
||||
option = {
|
||||
tooltip: {
|
||||
|
||||
@@ -79,13 +79,12 @@ const actions = {
|
||||
reject('getInfo: roles must be a non-null array!')
|
||||
}
|
||||
|
||||
// commit('SET_ROLES', roles)
|
||||
commit('SET_ROLES', ['admin'])
|
||||
commit('SET_ROLES', roles)
|
||||
// commit('SET_ROLES', ['admin'])
|
||||
commit('SET_NAME', account)
|
||||
// commit('SET_AVATAR', avatar)
|
||||
commit('SET_AVATAR', 'http://kaifa.crmeb.net/system/images/admin_logo.png')
|
||||
commit('SET_INTRODUCTION', 'CRMEB admin')
|
||||
data.roles = 'admin'
|
||||
resolve(data)
|
||||
}).catch(error => {
|
||||
reject(error)
|
||||
|
||||
@@ -12,16 +12,6 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="listPram.isDel" placeholder="删除状态" clearable class="selWidth">
|
||||
<el-option
|
||||
v-for="item in constants.deletedOrNormal"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-select v-model="listPram.status" placeholder="状态" clearable class="selWidth">
|
||||
<el-option
|
||||
@@ -59,7 +49,7 @@
|
||||
</el-table-column>
|
||||
<el-table-column label="最后登录时间" prop="lastTime" min-width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.updateTime | filterEmpty }}</span>
|
||||
<span>{{ scope.row.lastTime | filterEmpty }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="最后登录IP" prop="lastIp" min-width="150">
|
||||
@@ -129,7 +119,6 @@ export default {
|
||||
listPram: {
|
||||
account: null,
|
||||
addTime: null,
|
||||
isDel: null, // false=正常,true=已删除,数据库逻辑删除
|
||||
lastIp: null,
|
||||
lastTime: null,
|
||||
level: null,
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.zbkj.crmeb.system.controller;
|
||||
import com.common.CommonPage;
|
||||
import com.common.CommonResult;
|
||||
import com.common.PageParamRequest;
|
||||
import com.utils.CrmebUtil;
|
||||
import com.zbkj.crmeb.category.vo.CategoryTreeVo;
|
||||
import com.zbkj.crmeb.system.model.SystemRole;
|
||||
import com.zbkj.crmeb.system.request.SystemRoleRequest;
|
||||
@@ -112,14 +113,15 @@ public class SystemRoleController {
|
||||
|
||||
/**
|
||||
* 查询身份管理表信息
|
||||
* @param id Integer
|
||||
* @param ids String
|
||||
* @author Mr.Zhang
|
||||
* @since 2020-04-18
|
||||
*/
|
||||
@ApiOperation(value = "详情")
|
||||
@RequestMapping(value = "/info", method = RequestMethod.GET)
|
||||
public CommonResult<SystemRole> info(@RequestParam(value = "id") Integer id){
|
||||
SystemRole systemRole = systemRoleService.getById(id);
|
||||
public CommonResult<List<SystemRole>> info(@RequestParam(value = "ids") String ids){
|
||||
// SystemRole systemRole = systemRoleService.getById(CrmebUtil.stringToArray(ids));
|
||||
List<SystemRole> systemRole = systemRoleService.getListInIds(CrmebUtil.stringToArray(ids));
|
||||
return CommonResult.success(systemRole);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @author stivepeim
|
||||
@@ -30,7 +31,7 @@ public class SystemAdminResponse implements Serializable {
|
||||
|
||||
private String lastIp;
|
||||
|
||||
private Integer lastTime;
|
||||
private Date lastTime;
|
||||
|
||||
private Integer addTime;
|
||||
|
||||
|
||||
@@ -17,6 +17,13 @@ public interface SystemRoleService extends IService<SystemRole> {
|
||||
|
||||
List<SystemRole> getList(SystemRoleSearchRequest request, PageParamRequest pageParamRequest);
|
||||
|
||||
/**
|
||||
* 根据id集合获取对应权限列表
|
||||
* @param ids id集合
|
||||
* @return 对应的权限列表
|
||||
*/
|
||||
List<SystemRole> getListInIds(List<Integer> ids);
|
||||
|
||||
Boolean checkAuth(String uri);
|
||||
|
||||
List<CategoryTreeVo> menu();
|
||||
|
||||
@@ -93,6 +93,7 @@ public class SystemAdminServiceImpl extends ServiceImpl<SystemAdminDao, SystemAd
|
||||
for (SystemAdmin admin : systemAdmins) {
|
||||
SystemAdminResponse sar = new SystemAdminResponse();
|
||||
BeanUtils.copyProperties(admin, sar);
|
||||
sar.setLastTime(admin.getUpdateTime());
|
||||
if(StringUtils.isBlank(admin.getRoles())) continue;
|
||||
List<Integer> roleIds = CrmebUtil.stringToArrayInt(admin.getRoles());
|
||||
List<String> roleNames = new ArrayList<>();
|
||||
|
||||
@@ -63,6 +63,18 @@ public class SystemRoleServiceImpl extends ServiceImpl<SystemRoleDao, SystemRole
|
||||
return dao.selectList(lambdaQueryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id集合获取对应权限列表
|
||||
* @param ids id集合
|
||||
* @return 对应的权限列表
|
||||
*/
|
||||
@Override
|
||||
public List<SystemRole> getListInIds(List<Integer> ids) {
|
||||
// LambdaQueryWrapper<SystemRole> lqw = new LambdaQueryWrapper<>();
|
||||
// lqw.in(SystemRole::getId, ids);
|
||||
return dao.selectBatchIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检测是否有访问菜单接口取的权限
|
||||
* @param uri String 请求参数
|
||||
|
||||
Reference in New Issue
Block a user