修订模块与配置文件
This commit is contained in:
parent
3d38a89e7a
commit
d9c152cfc7
@ -16,7 +16,7 @@ cpop:
|
||||
# DataSource Config
|
||||
spring:
|
||||
application:
|
||||
name: Cpop-Oam-Prod
|
||||
name: Cpop-Mall-Prod
|
||||
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
|
||||
username: root
|
||||
@ -50,9 +50,9 @@ spring:
|
||||
database: rock-blade
|
||||
|
||||
server:
|
||||
port: 9420
|
||||
port: 9430
|
||||
servlet:
|
||||
context-path: /Cpop-Oam
|
||||
context-path: /Cpop-Mall
|
||||
|
||||
#Mybatis-Flex
|
||||
mybatis-flex:
|
||||
|
||||
@ -16,7 +16,7 @@ cpop:
|
||||
# DataSource Config
|
||||
spring:
|
||||
application:
|
||||
name: Cpop-Oam-Test
|
||||
name: Cpop-Mall-Test
|
||||
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
|
||||
username: root
|
||||
@ -50,9 +50,9 @@ spring:
|
||||
database: rock-blade
|
||||
|
||||
server:
|
||||
port: 9420
|
||||
port: 9430
|
||||
servlet:
|
||||
context-path: /Cpop-Oam
|
||||
context-path: /Cpop-Mall
|
||||
|
||||
#Mybatis-Flex
|
||||
mybatis-flex:
|
||||
@ -63,8 +63,8 @@ mybatis-flex:
|
||||
knife4j:
|
||||
enable: true
|
||||
openapi:
|
||||
title: Cpop-OAM开发API
|
||||
description: PuPu-OAM开发API
|
||||
title: Cpop-Mall开发API
|
||||
description: Cpop-Mall开发API
|
||||
email:
|
||||
concat: DB
|
||||
url: https://api.jamboxsys.com
|
||||
@ -73,9 +73,15 @@ knife4j:
|
||||
license-url: https://stackoverflow.com/
|
||||
terms-of-service-url: https://api.jamboxsys.com
|
||||
group:
|
||||
#系统
|
||||
system:
|
||||
group-name: Oam
|
||||
#商城
|
||||
Mall:
|
||||
group-name: Mall
|
||||
api-rule: package
|
||||
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:
|
||||
#密钥
|
||||
secret: abcdefghijklmnopqrstuvwxyz
|
||||
#过期时间
|
||||
expire: 604800
|
||||
#过期时间(半天)
|
||||
expire: 43200
|
||||
#token头
|
||||
header: Authorization
|
||||
#拦截
|
||||
|
||||
@ -25,7 +25,7 @@ import java.util.List;
|
||||
* @description
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "商城角色定制模块")
|
||||
@Api(tags = "商城角色定制接口")
|
||||
@RequestMapping("/mallRole")
|
||||
public class MallRoleController {
|
||||
|
||||
|
||||
@ -25,8 +25,8 @@ import java.util.List;
|
||||
* @since 2023-10-19
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "商城员工管理接口")
|
||||
@RequestMapping("/staff")
|
||||
@Api(tags = "商城员工接口")
|
||||
@RequestMapping("/mallStaff")
|
||||
public class StaffController {
|
||||
|
||||
@Autowired
|
||||
|
||||
@ -11,13 +11,14 @@ import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
* @createTime 2023/09/10 11:13
|
||||
* @description 系统登陆
|
||||
*/
|
||||
@Api(tags = "系统登录模块")
|
||||
@Api(tags = "通用系统登录模块")
|
||||
@RestController
|
||||
public class LoginController {
|
||||
|
||||
@ -44,8 +45,8 @@ public class LoginController {
|
||||
**/
|
||||
@ApiOperation("获取权限码")
|
||||
@GetMapping("/getPermCode")
|
||||
public R<List<String>> getPermCode(){
|
||||
List<String> list = loginService.getPermCode();
|
||||
public R<Set<String>> getPermCode(){
|
||||
Set<String> list = loginService.getPermCode();
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
|
||||
@ -5,25 +5,15 @@ import com.cpop.core.base.R;
|
||||
import com.cpop.core.base.enums.OperationLogEnum;
|
||||
import com.cpop.system.business.bo.MenuBo;
|
||||
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 org.springframework.web.bind.annotation.RestController;
|
||||
import com.cpop.system.business.vo.MenuVo;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import io.swagger.annotations.ApiParam;
|
||||
import java.io.Serializable;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@ -33,7 +23,7 @@ import java.util.List;
|
||||
* @since 2023-10-19
|
||||
*/
|
||||
@RestController
|
||||
@Api(tags = "系统菜单表接口")
|
||||
@Api(tags = "通用系统菜单表接口")
|
||||
@RequestMapping("/menu")
|
||||
public class MenuController {
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.cpop.system.business.vo.LoginUserInfoVo;
|
||||
import com.cpop.system.business.vo.MenuRouteVo;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* 系统登陆
|
||||
@ -20,7 +21,7 @@ public interface LoginService {
|
||||
/**
|
||||
* 获取权限码
|
||||
*/
|
||||
List<String> getPermCode();
|
||||
Set<String> getPermCode();
|
||||
|
||||
/**
|
||||
* @Description: 获取菜单列表
|
||||
|
||||
@ -1,27 +1,18 @@
|
||||
package com.cpop.system.business.service.impl;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.cpop.common.constant.Constants;
|
||||
import com.cpop.core.base.entity.LoginUser;
|
||||
import com.cpop.core.service.RedisService;
|
||||
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.MenuService;
|
||||
import com.cpop.system.business.vo.LoginUserInfoVo;
|
||||
import com.cpop.system.business.vo.MenuRouteVo;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
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;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @author DB
|
||||
@ -64,20 +55,10 @@ public class LoginServiceImpl implements LoginService {
|
||||
* @return {@link List<String>}
|
||||
**/
|
||||
@Override
|
||||
public List<String> getPermCode() {
|
||||
//获取当前用户所属角色以及菜单信息
|
||||
public Set<String> getPermCode() {
|
||||
//获取当前登录用户信息
|
||||
LoginUser loginUser = SecurityUtils.getInstance().getLoginUser();
|
||||
JSONObject loginStaffInfo = SecurityUtils.getInstance().getLoginStaffInfo();
|
||||
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());
|
||||
return loginUser.getPermissions();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user