登录权限获取问题、头像名字居中
This commit is contained in:
@@ -93,7 +93,7 @@ public class AuthorizationController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 获取权限列表 - 登录查找权限
|
// 获取权限列表 - 登录查找权限
|
||||||
List<String> permissionList = roleService.getPermissionList(userDto.getId().toString());
|
List<String> permissionList = roleService.getPermissionList(userDto);
|
||||||
|
|
||||||
// 保存用户信息到session - 登录输入,登出删除
|
// 保存用户信息到session - 登录输入,登出删除
|
||||||
CurrentUser user = new CurrentUser();
|
CurrentUser user = new CurrentUser();
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import org.nl.modules.system.domain.Role;
|
|||||||
import org.nl.modules.system.service.dto.RoleDto;
|
import org.nl.modules.system.service.dto.RoleDto;
|
||||||
import org.nl.modules.system.service.dto.RoleQueryCriteria;
|
import org.nl.modules.system.service.dto.RoleQueryCriteria;
|
||||||
import org.nl.modules.system.service.dto.RoleSmallDto;
|
import org.nl.modules.system.service.dto.RoleSmallDto;
|
||||||
|
import org.nl.modules.system.service.dto.UserDto;
|
||||||
import org.springframework.data.domain.Pageable;
|
import org.springframework.data.domain.Pageable;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
@@ -122,10 +123,10 @@ public interface RoleService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过id获取用户的权限
|
* 通过id获取用户的权限
|
||||||
* @param id
|
* @param userDto
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
List<String> getPermissionList(String id);
|
List<String> getPermissionList(UserDto userDto);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 验证是否被用户关联
|
* 验证是否被用户关联
|
||||||
|
|||||||
@@ -15,7 +15,6 @@
|
|||||||
*/
|
*/
|
||||||
package org.nl.modules.system.service.impl;
|
package org.nl.modules.system.service.impl;
|
||||||
|
|
||||||
import cn.dev33.satoken.stp.StpUtil;
|
|
||||||
import cn.hutool.core.collection.CollectionUtil;
|
import cn.hutool.core.collection.CollectionUtil;
|
||||||
import com.alibaba.fastjson.JSONArray;
|
import com.alibaba.fastjson.JSONArray;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
@@ -162,17 +161,16 @@ public class RoleServiceImpl implements RoleService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Cacheable(key = "'auth:' + #p0")
|
@Cacheable(key = "'auth:' + #p0.id")
|
||||||
public List<String> getPermissionList(String id) {
|
public List<String> getPermissionList(UserDto userDto) {
|
||||||
List<String> permission = new LinkedList<>();
|
List<String> permission = new LinkedList<>();
|
||||||
// 查看是否为管理员
|
// 查看是否为管理员
|
||||||
UserDto user = (UserDto) StpUtil.getSession().get("UserDto");
|
if (userDto.getIsAdmin()) { // 是管理员
|
||||||
if (user.getIsAdmin()) { // 是管理员
|
|
||||||
permission.add("admin");
|
permission.add("admin");
|
||||||
}
|
}
|
||||||
HashMap<String, String> map = new HashMap<>();
|
HashMap<String, String> map = new HashMap<>();
|
||||||
map.put("flag", "1");
|
map.put("flag", "1");
|
||||||
map.put("user_id", id);
|
map.put("user_id", userDto.getId().toString());
|
||||||
JSONArray rows = WQL.getWO("SYS_MENU").addParamMap(map).process().getResultJSONArray(0);
|
JSONArray rows = WQL.getWO("SYS_MENU").addParamMap(map).process().getResultJSONArray(0);
|
||||||
for (int i = 0; i < rows.size(); i++) {
|
for (int i = 0; i < rows.size(); i++) {
|
||||||
JSONObject jsonObject = rows.getJSONObject(i);
|
JSONObject jsonObject = rows.getJSONObject(i);
|
||||||
|
|||||||
@@ -21,11 +21,11 @@
|
|||||||
</el-tooltip>-->
|
</el-tooltip>-->
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
<img :src="Avatar" class="user-avatar">
|
||||||
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
|
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="hover">
|
||||||
<div class="avatar-wrapper">
|
<div class="avatar-wrapper">
|
||||||
<img :src="Avatar" class="user-avatar" >
|
<!-- <img :src="Avatar" class="user-avatar" style="border: #f5141e 1px solid">-->
|
||||||
<span class="user-nickname">{{ user.nickName }}</span>
|
<span class="user-nickname">{{ user.nickName }}</span>
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<span style="display:block;" @click="show = true">
|
<span style="display:block;" @click="show = true">
|
||||||
@@ -184,22 +184,22 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.user-avatar {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.avatar-container {
|
.avatar-container {
|
||||||
margin-right: 10px;
|
//margin-right: 10px;
|
||||||
.avatar-wrapper {
|
.avatar-wrapper {
|
||||||
margin-top: 5px;
|
//margin-top: 5px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
.user-avatar {
|
|
||||||
cursor: pointer;
|
|
||||||
width: 40px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 10px;
|
|
||||||
}
|
|
||||||
.user-nickname {
|
.user-nickname {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
|
margin-left: -10px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
@selection-change="crud.selectionChangeHandler"
|
@selection-change="crud.selectionChangeHandler"
|
||||||
>
|
>
|
||||||
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
<el-table-column :selectable="checkboxT" type="selection" width="55" />
|
||||||
<el-table-column label="编码" prop="code" />
|
<!-- <el-table-column label="编码" prop="code" />-->
|
||||||
<el-table-column label="名称" prop="name" />
|
<el-table-column label="名称" prop="name" />
|
||||||
<el-table-column label="排序" prop="deptSort" />
|
<el-table-column label="排序" prop="deptSort" />
|
||||||
<el-table-column label="状态" align="center" prop="enabled">
|
<el-table-column label="状态" align="center" prop="enabled">
|
||||||
|
|||||||
Reference in New Issue
Block a user