2
0

fix: 修复菜单和feign问题

This commit is contained in:
caiyuchao
2025-02-18 20:31:48 +08:00
parent f89e1da57e
commit c502a2b303
3 changed files with 7 additions and 9 deletions

View File

@@ -492,7 +492,7 @@
<properties> <properties>
<!--当前环境--> <!--当前环境-->
<profileName>cyc</profileName> <profileName>cyc</profileName>
<nacosServerAddr>192.168.9.50:8848</nacosServerAddr> <nacosServerAddr>localhost:8848</nacosServerAddr>
<nacosNamespace>wfc-cyc</nacosNamespace> <nacosNamespace>wfc-cyc</nacosNamespace>
</properties> </properties>
</profile> </profile>

View File

@@ -40,10 +40,11 @@ public class FeignRequestInterceptor implements RequestInterceptor {
String authentication = headers.get(SecurityConstants.AUTHORIZATION_HEADER); String authentication = headers.get(SecurityConstants.AUTHORIZATION_HEADER);
if (StringUtils.isNotEmpty(authentication)) { if (StringUtils.isNotEmpty(authentication)) {
Collection<String> headerValues = requestTemplate.headers().get(SecurityConstants.AUTHORIZATION_HEADER); Collection<String> headerValues = requestTemplate.headers().get(SecurityConstants.AUTHORIZATION_HEADER);
boolean hasToken = headerValues.stream().anyMatch(c -> c.startsWith(SecurityConstants.PRE_ACCESS_TOKEN)); boolean hasToken = headerValues != null && headerValues.stream().anyMatch(c -> c.startsWith(SecurityConstants.PRE_ACCESS_TOKEN));
if (!hasToken) { if (!hasToken) {
requestTemplate.header(SecurityConstants.AUTHORIZATION_HEADER, authentication); requestTemplate.header(SecurityConstants.AUTHORIZATION_HEADER, authentication);
} }
} }
String language = headers.get(SecurityConstants.CONTENT_LANGUAGE); String language = headers.get(SecurityConstants.CONTENT_LANGUAGE);
if (StringUtils.isNotEmpty(language)) { if (StringUtils.isNotEmpty(language)) {

View File

@@ -1,6 +1,5 @@
package org.wfc.system.controller; package org.wfc.system.controller;
import com.github.pagehelper.Page;
import org.apache.commons.lang3.ArrayUtils; import org.apache.commons.lang3.ArrayUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@@ -13,11 +12,12 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping; import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.wfc.common.core.domain.LoginUser;
import org.wfc.common.core.domain.R; import org.wfc.common.core.domain.R;
import org.wfc.common.core.utils.MessageUtils; import org.wfc.common.core.utils.MessageUtils;
import org.wfc.common.core.utils.PageUtils;
import org.wfc.common.core.utils.StringUtils; import org.wfc.common.core.utils.StringUtils;
import org.wfc.common.core.utils.poi.ExcelUtil; import org.wfc.common.core.utils.poi.ExcelUtil;
import org.wfc.common.core.web.controller.BaseController; import org.wfc.common.core.web.controller.BaseController;
@@ -32,7 +32,6 @@ import org.wfc.common.security.utils.SecurityUtils;
import org.wfc.system.api.domain.SysDept; import org.wfc.system.api.domain.SysDept;
import org.wfc.system.api.domain.SysRole; import org.wfc.system.api.domain.SysRole;
import org.wfc.system.api.domain.SysUser; import org.wfc.system.api.domain.SysUser;
import org.wfc.common.core.domain.LoginUser;
import org.wfc.system.domain.query.UserRepeatQuery; import org.wfc.system.domain.query.UserRepeatQuery;
import org.wfc.system.service.ISysConfigService; import org.wfc.system.service.ISysConfigService;
import org.wfc.system.service.ISysDeptService; import org.wfc.system.service.ISysDeptService;
@@ -124,11 +123,9 @@ public class SysUserController extends BaseController
* 获取用户平台-用户列表 * 获取用户平台-用户列表
*/ */
@GetMapping("/listUser") @GetMapping("/listUser")
public TableDataInfo listUser(UUser user) public TableDataInfo listUser(UUser user, @RequestParam("pageNum") Integer pageNum, @RequestParam("pageSize") Integer pageSize)
{ {
startPage(); TableDataInfo result = remoteUUserService.page(pageNum, pageSize, user);
Page<Object> localPage = PageUtils.getLocalPage();
TableDataInfo result = remoteUUserService.page(localPage.getPageNum(), localPage.getPageSize(), user);
return result; return result;
} }