修订模块与配置文件
This commit is contained in:
parent
3d38a89e7a
commit
d9c152cfc7
@ -16,7 +16,7 @@ cpop:
|
|||||||
# DataSource Config
|
# DataSource Config
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: Cpop-Oam-Prod
|
name: Cpop-Mall-Prod
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
@ -50,9 +50,9 @@ spring:
|
|||||||
database: rock-blade
|
database: rock-blade
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 9420
|
port: 9430
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /Cpop-Oam
|
context-path: /Cpop-Mall
|
||||||
|
|
||||||
#Mybatis-Flex
|
#Mybatis-Flex
|
||||||
mybatis-flex:
|
mybatis-flex:
|
||||||
|
|||||||
@ -16,7 +16,7 @@ cpop:
|
|||||||
# DataSource Config
|
# DataSource Config
|
||||||
spring:
|
spring:
|
||||||
application:
|
application:
|
||||||
name: Cpop-Oam-Test
|
name: Cpop-Mall-Test
|
||||||
datasource:
|
datasource:
|
||||||
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
url: jdbc:mysql://sh-cynosdbmysql-grp-fggo83js.sql.tencentcdb.com:20965/cpop-union?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
|
||||||
username: root
|
username: root
|
||||||
@ -50,9 +50,9 @@ spring:
|
|||||||
database: rock-blade
|
database: rock-blade
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: 9420
|
port: 9430
|
||||||
servlet:
|
servlet:
|
||||||
context-path: /Cpop-Oam
|
context-path: /Cpop-Mall
|
||||||
|
|
||||||
#Mybatis-Flex
|
#Mybatis-Flex
|
||||||
mybatis-flex:
|
mybatis-flex:
|
||||||
@ -63,8 +63,8 @@ mybatis-flex:
|
|||||||
knife4j:
|
knife4j:
|
||||||
enable: true
|
enable: true
|
||||||
openapi:
|
openapi:
|
||||||
title: Cpop-OAM开发API
|
title: Cpop-Mall开发API
|
||||||
description: PuPu-OAM开发API
|
description: Cpop-Mall开发API
|
||||||
email:
|
email:
|
||||||
concat: DB
|
concat: DB
|
||||||
url: https://api.jamboxsys.com
|
url: https://api.jamboxsys.com
|
||||||
@ -73,9 +73,15 @@ knife4j:
|
|||||||
license-url: https://stackoverflow.com/
|
license-url: https://stackoverflow.com/
|
||||||
terms-of-service-url: https://api.jamboxsys.com
|
terms-of-service-url: https://api.jamboxsys.com
|
||||||
group:
|
group:
|
||||||
#系统
|
#商城
|
||||||
system:
|
Mall:
|
||||||
group-name: Oam
|
group-name: Mall
|
||||||
api-rule: package
|
api-rule: package
|
||||||
api-rule-resources:
|
api-rule-resources:
|
||||||
- com.cpop.oam
|
- com.cpop.mall
|
||||||
|
#系统
|
||||||
|
System:
|
||||||
|
group-name: System
|
||||||
|
api-rule: package
|
||||||
|
api-rule-resources:
|
||||||
|
- com.cpop.system
|
||||||
@ -8,8 +8,8 @@ cpop:
|
|||||||
jwt:
|
jwt:
|
||||||
#密钥
|
#密钥
|
||||||
secret: abcdefghijklmnopqrstuvwxyz
|
secret: abcdefghijklmnopqrstuvwxyz
|
||||||
#过期时间
|
#过期时间(半天)
|
||||||
expire: 604800
|
expire: 43200
|
||||||
#token头
|
#token头
|
||||||
header: Authorization
|
header: Authorization
|
||||||
#拦截
|
#拦截
|
||||||
|
|||||||
@ -25,7 +25,7 @@ import java.util.List;
|
|||||||
* @description
|
* @description
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "商城角色定制模块")
|
@Api(tags = "商城角色定制接口")
|
||||||
@RequestMapping("/mallRole")
|
@RequestMapping("/mallRole")
|
||||||
public class MallRoleController {
|
public class MallRoleController {
|
||||||
|
|
||||||
|
|||||||
@ -25,8 +25,8 @@ import java.util.List;
|
|||||||
* @since 2023-10-19
|
* @since 2023-10-19
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "商城员工管理接口")
|
@Api(tags = "商城员工接口")
|
||||||
@RequestMapping("/staff")
|
@RequestMapping("/mallStaff")
|
||||||
public class StaffController {
|
public class StaffController {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
|
|||||||
@ -11,13 +11,14 @@ import org.springframework.web.bind.annotation.GetMapping;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DB
|
* @author DB
|
||||||
* @createTime 2023/09/10 11:13
|
* @createTime 2023/09/10 11:13
|
||||||
* @description 系统登陆
|
* @description 系统登陆
|
||||||
*/
|
*/
|
||||||
@Api(tags = "系统登录模块")
|
@Api(tags = "通用系统登录模块")
|
||||||
@RestController
|
@RestController
|
||||||
public class LoginController {
|
public class LoginController {
|
||||||
|
|
||||||
@ -44,8 +45,8 @@ public class LoginController {
|
|||||||
**/
|
**/
|
||||||
@ApiOperation("获取权限码")
|
@ApiOperation("获取权限码")
|
||||||
@GetMapping("/getPermCode")
|
@GetMapping("/getPermCode")
|
||||||
public R<List<String>> getPermCode(){
|
public R<Set<String>> getPermCode(){
|
||||||
List<String> list = loginService.getPermCode();
|
Set<String> list = loginService.getPermCode();
|
||||||
return R.ok(list);
|
return R.ok(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -5,25 +5,15 @@ import com.cpop.core.base.R;
|
|||||||
import com.cpop.core.base.enums.OperationLogEnum;
|
import com.cpop.core.base.enums.OperationLogEnum;
|
||||||
import com.cpop.system.business.bo.MenuBo;
|
import com.cpop.system.business.bo.MenuBo;
|
||||||
import com.cpop.system.business.bo.MenuListBo;
|
import com.cpop.system.business.bo.MenuListBo;
|
||||||
import com.cpop.system.business.vo.MenuVo;
|
|
||||||
import com.mybatisflex.core.paginate.Page;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.validation.annotation.Validated;
|
|
||||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.PutMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestBody;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import com.cpop.system.business.entity.Menu;
|
|
||||||
import com.cpop.system.business.service.MenuService;
|
import com.cpop.system.business.service.MenuService;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import com.cpop.system.business.vo.MenuVo;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import io.swagger.annotations.ApiParam;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import java.io.Serializable;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -33,7 +23,7 @@ import java.util.List;
|
|||||||
* @since 2023-10-19
|
* @since 2023-10-19
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
@Api(tags = "系统菜单表接口")
|
@Api(tags = "通用系统菜单表接口")
|
||||||
@RequestMapping("/menu")
|
@RequestMapping("/menu")
|
||||||
public class MenuController {
|
public class MenuController {
|
||||||
|
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import com.cpop.system.business.vo.LoginUserInfoVo;
|
|||||||
import com.cpop.system.business.vo.MenuRouteVo;
|
import com.cpop.system.business.vo.MenuRouteVo;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统登陆
|
* 系统登陆
|
||||||
@ -20,7 +21,7 @@ public interface LoginService {
|
|||||||
/**
|
/**
|
||||||
* 获取权限码
|
* 获取权限码
|
||||||
*/
|
*/
|
||||||
List<String> getPermCode();
|
Set<String> getPermCode();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @Description: 获取菜单列表
|
* @Description: 获取菜单列表
|
||||||
|
|||||||
@ -1,27 +1,18 @@
|
|||||||
package com.cpop.system.business.service.impl;
|
package com.cpop.system.business.service.impl;
|
||||||
|
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.cpop.common.constant.Constants;
|
|
||||||
import com.cpop.core.base.entity.LoginUser;
|
import com.cpop.core.base.entity.LoginUser;
|
||||||
import com.cpop.core.service.RedisService;
|
|
||||||
import com.cpop.core.utils.SecurityUtils;
|
import com.cpop.core.utils.SecurityUtils;
|
||||||
import com.cpop.system.business.entity.Menu;
|
|
||||||
import com.cpop.system.business.service.LoginService;
|
import com.cpop.system.business.service.LoginService;
|
||||||
import com.cpop.system.business.service.MenuService;
|
import com.cpop.system.business.service.MenuService;
|
||||||
import com.cpop.system.business.vo.LoginUserInfoVo;
|
import com.cpop.system.business.vo.LoginUserInfoVo;
|
||||||
import com.cpop.system.business.vo.MenuRouteVo;
|
import com.cpop.system.business.vo.MenuRouteVo;
|
||||||
import com.mybatisflex.core.query.QueryWrapper;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.Set;
|
||||||
|
|
||||||
import static com.cpop.system.business.entity.table.MenuTableDef.MENU;
|
|
||||||
import static com.cpop.system.business.entity.table.RoleMenuTableDef.ROLE_MENU;
|
|
||||||
import static com.cpop.system.business.entity.table.RoleTableDef.ROLE;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author DB
|
* @author DB
|
||||||
@ -64,20 +55,10 @@ public class LoginServiceImpl implements LoginService {
|
|||||||
* @return {@link List<String>}
|
* @return {@link List<String>}
|
||||||
**/
|
**/
|
||||||
@Override
|
@Override
|
||||||
public List<String> getPermCode() {
|
public Set<String> getPermCode() {
|
||||||
//获取当前用户所属角色以及菜单信息
|
//获取当前登录用户信息
|
||||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
||||||
JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginStaffInfo();
|
return loginUser.getPermissions();
|
||||||
if (Constants.SUPER_ADMIN.equals(loginUser.getUsername())){
|
|
||||||
return new ArrayList<String>(Collections.singleton(Constants.ALL_PERMISSION));
|
|
||||||
}
|
|
||||||
List<Menu> list = menuService.list(QueryWrapper.create()
|
|
||||||
.leftJoin(ROLE_MENU).on(ROLE_MENU.MENU_ID.eq(MENU.ID))
|
|
||||||
.leftJoin(ROLE).on(ROLE.ID.eq(ROLE_MENU.ROLE_ID))
|
|
||||||
.where(MENU.TYPE.in(1, 2))
|
|
||||||
.and(MENU.PERMISSION.ne(""))
|
|
||||||
.and(ROLE.ID.eq(loginStaffInfo.getString("roleId"))));
|
|
||||||
return list.stream().map(Menu::getPermission).collect(Collectors.toList());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user