This commit is contained in:
caohong 2021-10-18 08:37:40 +08:00
commit dbd8c98ff9
6 changed files with 16 additions and 11 deletions

View File

@ -25,8 +25,8 @@
<mybatis-spring-boot.version>2.2.0</mybatis-spring-boot.version>
<pagehelper.boot.version>1.4.0</pagehelper.boot.version>
<fastjson.version>1.2.78</fastjson.version>
<oshi.version>5.8.0</oshi.version>
<jna.version>5.8.0</jna.version>
<oshi.version>5.8.2</oshi.version>
<jna.version>5.9.0</jna.version>
<commons.io.version>2.11.0</commons.io.version>
<commons.fileupload.version>1.4</commons.fileupload.version>
<commons.collections.version>3.2.2</commons.collections.version>
@ -242,7 +242,7 @@
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
@ -253,7 +253,7 @@
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>http://maven.aliyun.com/nexus/content/groups/public/</url>
<url>https://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>

View File

@ -39,7 +39,7 @@ public interface SysRoleMapper
* @param userId 用户ID
* @return 选中角色ID列表
*/
public List<Integer> selectRoleListByUserId(Long userId);
public List<Long> selectRoleListByUserId(Long userId);
/**
* 通过角色ID查询角色

View File

@ -49,7 +49,7 @@ public interface ISysRoleService
* @param userId 用户ID
* @return 选中角色ID列表
*/
public List<Integer> selectRoleListByUserId(Long userId);
public List<Long> selectRoleListByUserId(Long userId);
/**
* 通过角色ID查询角色

View File

@ -122,7 +122,7 @@ public class SysRoleServiceImpl implements ISysRoleService
* @return 选中角色ID列表
*/
@Override
public List<Integer> selectRoleListByUserId(Long userId)
public List<Long> selectRoleListByUserId(Long userId)
{
return roleMapper.selectRoleListByUserId(userId);
}

View File

@ -65,7 +65,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<include refid="selectRoleVo"/>
</select>
<select id="selectRoleListByUserId" parameterType="Long" resultType="Integer">
<select id="selectRoleListByUserId" parameterType="Long" resultType="Long">
select r.role_id
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id

View File

@ -86,7 +86,7 @@ function filterChildren(childrenMap, lastRouter = false) {
var children = []
childrenMap.forEach((el, index) => {
if (el.children && el.children.length) {
if (el.component === 'ParentView') {
if (el.component === 'ParentView' && !lastRouter) {
el.children.forEach(c => {
c.path = el.path + '/' + c.path
if (c.children && c.children.length) {
@ -106,8 +106,13 @@ function filterChildren(childrenMap, lastRouter = false) {
return children
}
export const loadView = (view) => { // 路由懒加载
export const loadView = (view) => {
if (process.env.NODE_ENV === 'development') {
return (resolve) => require([`@/views/${view}`], resolve)
} else {
// 使用 import 实现生产环境的路由懒加载
return () => import(`@/views/${view}`)
}
}
export default permission