From 977fac06efc8c5ec21f47c8b03a2d84907796a0d Mon Sep 17 00:00:00 2001 From: 13405411873 <1994398261@qq.com> Date: Thu, 26 Sep 2024 18:58:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=AF=E4=BB=98=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module/app/customer/CustomerAPI.java | 7 +- .../service/impl/CustomerMainServiceImpl.java | 7 +- .../impl/RepairOrderInfoServiceImpl.java | 61 +++++- .../iocoder/yudao/util/WechatPayConfig.java | 3 +- .../app/controller/LoginController.java | 176 ++++++++++++++++++ .../yudao/module/app/vo/WxLoginBody.java | 24 +++ .../YudaoWebSecurityConfigurerAdapter.java | 4 +- .../system/api/user/dto/AdminUserRespDTO.java | 1 + .../admin/user/vo/user/UserSaveReqVO.java | 2 + .../service/auth/AdminAuthServiceImpl.java | 46 +---- .../src/main/resources/application.yaml | 4 +- 11 files changed, 279 insertions(+), 56 deletions(-) create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/LoginController.java create mode 100644 dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/vo/WxLoginBody.java diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/CustomerAPI.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/CustomerAPI.java index ac651765..b99703d4 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/CustomerAPI.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/app/customer/CustomerAPI.java @@ -2,6 +2,8 @@ package cn.iocoder.yudao.module.app.customer; import cn.iocoder.yudao.framework.common.exception.ServiceException; import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.custom.service.CustomerMainService; import cn.iocoder.yudao.module.custom.vo.CustomerMainSaveReqVO; import cn.iocoder.yudao.module.system.api.user.dto.UserDTO; @@ -50,6 +52,9 @@ public class CustomerAPI { @PostMapping("/register") @Operation(summary = "客户自行注册") public CommonResult createCustomerMain(@Valid @RequestBody CustomerMainSaveReqVO saveReqVO, HttpServletRequest request) { + // 获取当前登录用户 + LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + saveReqVO.setUserId(loginUser.getId()); //客户类型,统一为私人客户 saveReqVO.setTypeCode("01"); //客户来源,统一为04-维修 @@ -59,7 +64,7 @@ public class CustomerAPI { try { UserDTO userDTO = customerMainService.saveCustomer(saveReqVO,SIGN_CREATE); //注册并登录 - return success(loginService.wxLoginByUserId(userDTO.getId(),userDTO.getUsername())); + return success(userDTO); }catch (ServiceException e){ return error(e); } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java index 989795b4..4b5e9603 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/module/custom/service/impl/CustomerMainServiceImpl.java @@ -33,6 +33,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.context.annotation.Lazy; import org.springframework.stereotype.Service; @@ -221,10 +222,14 @@ public class CustomerMainServiceImpl extends ServiceImpl lambdaQueryWrapper = new LambdaQueryWrapper<>(); lambdaQueryWrapper.eq(CustomerMain::getUserId,loginUser.getId()).eq(BaseDO::getDeleted,'0'); CustomerMain customerMain = getOne(lambdaQueryWrapper); + if (ObjectUtils.isEmpty(customerMain)){ + return null; + } return getCustomerById(customerMain.getId()); } @@ -280,4 +285,4 @@ public class CustomerMainServiceImpl extends ServiceImpl payTransactions(String orderId){ + RepairOrderInfo orderInfo = this.getById(orderId); + AdminUserDO user = userService.getUser(orderInfo.getUserId()); + // 统一参数封装 Map params = new HashMap<>(8); - params.put("appid", wechatPayConfig.getAppId()); + params.put("appid", wechatPayConfig.getRepairAppId()); params.put("mchid", wechatPayConfig.getMchId()); - params.put("description", orderInfo.getPayRemark()); + params.put("description", "汽修业务"); params.put("out_trade_no", orderInfo.getOrderNo()); params.put("notify_url", wechatPayConfig.getRepairNotifyUrl()); Map amountMap = new HashMap<>(4); // 金额单位为分 - amountMap.put("total", orderInfo.getPayMoney().multiply(BigDecimal.valueOf(100L)).intValue()); + amountMap.put("total", orderInfo.getPayMoney().multiply(BigDecimal.valueOf(100L)).longValue()); //人民币 amountMap.put("currency", "CNY"); params.put("amount", amountMap); + + // 场景信息 + Map sceneInfoMap = new HashMap<>(4); + // 客户端IP + sceneInfoMap.put("payer_client_ip", "127.0.0.1"); + // 商户端设备号(门店号或收银设备ID) + sceneInfoMap.put("device_id", "127.0.0.1"); + // 除H5与JSAPI有特殊参数外,其他的支付方式都一样 + Map payerMap = new HashMap<>(4); + payerMap.put("openid", user.getOpenId()); + params.put("payer", payerMap); + params.put("scene_info", sceneInfoMap); String paramsStr = JSON.toJSONString(params); - String resStr = wechatPayRequest.wechatHttpPost("https://api.mch.weixin.qq.com/v3/pay/transactions/native",paramsStr); - return JSONObject.parseObject(resStr, new TypeReference>(){}); + + String resStr = wechatPayRequest.wechatHttpPost("https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi",paramsStr); + Map resMap = JSONObject.parseObject(resStr); + //Map signMap = paySignMsg(resMap.get("prepay_id").toString(), wechatPayConfig.getAppId(),null); + return resMap; } /** @@ -262,4 +293,24 @@ public class RepairOrderInfoServiceImpl extends ServiceImpl paySignMsg(String prepayId,String appId,String privateKeyStr) throws IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException { +// long timeMillis = System.currentTimeMillis(); +// String timeStamp = timeMillis/1000+""; +// String nonceStr = timeMillis+""; +// String packageStr = "prepay_id="+prepayId; +// // 公共参数 +// Map resMap = new HashMap<>(); +// resMap.put("nonceStr",nonceStr); +// resMap.put("timeStamp",timeStamp); +// resMap.put("appId",appId); +// resMap.put("package", packageStr); +// // 使用字段appId、timeStamp、nonceStr、package进行签名 +// //从下往上依次生成 +// String message = buildMessage(appId, timeStamp, nonceStr, packageStr); +// //签名 +// String paySign = sign(message.getBytes("utf-8"), privateKeyStr); +// resMap.put("paySign", paySign); +// resMap.put("signType", "RSA"); +// return resMap; +// } } diff --git a/dl-module-base/src/main/java/cn/iocoder/yudao/util/WechatPayConfig.java b/dl-module-base/src/main/java/cn/iocoder/yudao/util/WechatPayConfig.java index 52db9724..d0087e46 100644 --- a/dl-module-base/src/main/java/cn/iocoder/yudao/util/WechatPayConfig.java +++ b/dl-module-base/src/main/java/cn/iocoder/yudao/util/WechatPayConfig.java @@ -86,9 +86,10 @@ public class WechatPayConfig { private String jcNotifyUrl="https://www.nuoyunr.com/admin-api/payApi/payNotify"; private String jcRefundNotifyUrl="https://www.nuoyunr.com/admin-api/payApi/refundNotify"; + private String repairAppId="wxee677d54037bc5ac"; - + private String repairAppSecret="774bcddc165287da47b0b72b31f1c0a0"; /** * 获取商户的私钥文件 * @param keyPemPath diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/LoginController.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/LoginController.java new file mode 100644 index 00000000..1343772b --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/controller/LoginController.java @@ -0,0 +1,176 @@ +package cn.iocoder.yudao.module.app.controller; + +import cn.hutool.core.collection.CollectionUtil; +import cn.hutool.core.util.ObjectUtil; +import cn.hutool.core.util.StrUtil; +import cn.iocoder.yudao.common.CommonErrorCodeConstants; +import cn.iocoder.yudao.framework.common.pojo.CommonResult; +import cn.iocoder.yudao.framework.security.config.SecurityProperties; +import cn.iocoder.yudao.framework.security.core.LoginUser; +import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; + +import cn.iocoder.yudao.module.app.vo.WxLoginBody; +import cn.iocoder.yudao.module.system.api.dict.DictDataApi; +import cn.iocoder.yudao.module.system.api.permission.PermissionApi; +import cn.iocoder.yudao.module.system.api.permission.RoleApi; +import cn.iocoder.yudao.module.system.api.permission.dto.RoleReqDTO; +import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginReqVO; +import cn.iocoder.yudao.module.system.controller.admin.auth.vo.AuthLoginRespVO; +import cn.iocoder.yudao.module.system.controller.admin.user.LoginBody; +import cn.iocoder.yudao.module.system.controller.admin.user.vo.user.UserSaveReqVO; +import cn.iocoder.yudao.module.system.dal.dataobject.permission.MenuDO; +import cn.iocoder.yudao.module.system.dal.dataobject.permission.RoleDO; +import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; +import cn.iocoder.yudao.module.system.service.auth.AdminAuthService; +import cn.iocoder.yudao.module.system.service.permission.MenuService; +import cn.iocoder.yudao.module.system.service.permission.RoleService; +import cn.iocoder.yudao.module.system.service.user.AdminUserService; +import cn.iocoder.yudao.util.WechatPayConfig; +import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.sun.org.apache.xerces.internal.impl.dv.util.Base64; +import io.swagger.v3.oas.annotations.Operation; +import lombok.extern.slf4j.Slf4j; +import org.springframework.security.crypto.password.PasswordEncoder; +import org.springframework.util.StringUtils; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.client.RestTemplate; + +import javax.annotation.Resource; +import javax.crypto.Cipher; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.servlet.http.HttpServletRequest; +import java.security.spec.AlgorithmParameterSpec; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; +import java.util.concurrent.atomic.AtomicBoolean; +import java.util.stream.Collectors; + +import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; +import static cn.iocoder.yudao.framework.common.pojo.CommonResult.*; + +/** + * 登录验证 + * + * @author ruoyi + */ +@RestController +@Slf4j +@RequestMapping("/userClient/repair") +public class LoginController { + @Resource + private AdminAuthService loginService; + + + + + @Resource + private WechatPayConfig wxConfig; + + + + @Resource + private RestTemplate restTemplate; + + @Resource + private SecurityProperties securityProperties; + + @PostMapping("/wxLogin") + @TenantIgnore + public CommonResult wxLogin(@RequestBody WxLoginBody wxLoginBody) { + String code = wxLoginBody.getCode(); + //秘钥 + String encryptedIv = wxLoginBody.getEncryptedIv(); + //加密数据 + String encryptedData = wxLoginBody.getEncryptedData(); + //想微信服务器发送请求获取用户信息 + String url = "https://api.weixin.qq.com/sns/jscode2session?appid=" + wxConfig.getRepairAppId() + "&secret=" + wxConfig.getRepairAppSecret() + "&js_code=" + code + "&grant_type=authorization_code"; + String res = restTemplate.getForObject(url, String.class); + JSONObject jsonObject = JSONObject.parseObject(res); + //获取session_key和openid + String sessionKey = jsonObject.getString("session_key"); + String openId = jsonObject.getString("openid"); + //解密 + String decryptResult = ""; + try { + //如果没有绑定微信开放平台,解析结果是没有unionid的。 + decryptResult = decrypt(sessionKey, encryptedIv, encryptedData); + } catch (Exception e) { + e.printStackTrace(); + return error(500, "微信登录失败!"); + } + + if (StringUtils.hasText(decryptResult)) { + //如果解析成功,获取token + AuthLoginRespVO loginVO = loginService.wxLoginJc(decryptResult,openId,wxLoginBody.getInviteId()); + Map map = new HashMap<>(); + map.put("token", loginVO.getAccessToken()); + return success(map); + } else { + return error(500, "微信登录失败!"); + } + } + + + + + @PostMapping("/logout") + @Operation(summary = "登出系统") + public CommonResult logout(HttpServletRequest request) { + String token = SecurityFrameworkUtils.obtainAuthorization(request, + securityProperties.getTokenHeader(), securityProperties.getTokenParameter()); + if (StrUtil.isNotBlank(token)) { + loginService.logout(token,1); + } + return success(true); + } + + /** + * AES解密 + */ + private String decrypt(String sessionKey,String encryptedIv,String encryptedData) throws Exception{ + // 转化为字节数组 + byte[] key = Base64.decode(sessionKey); + byte[] iv = Base64.decode(encryptedIv); + byte[] encData = Base64.decode(encryptedData); + // 如果密钥不足16位,那么就补足 + int base =16; + if (key.length % base !=0) { + int groups = key.length / base +(key.length % base != 0 ? 1 : 0); + byte[] temp = new byte[groups * base]; + Arrays.fill(temp,(byte) 0); + System.arraycopy(key,0,temp,0,key.length); + key = temp; + } + // 如果初始向量不足16位,也补足 + if (iv.length % base !=0) { + int groups = iv.length / base +(iv.length % base != 0 ? 1 : 0); + byte[] temp = new byte[groups * base]; + Arrays.fill(temp,(byte) 0); + System.arraycopy(iv,0,temp,0,iv.length); + iv = temp; + } + + AlgorithmParameterSpec ivSpec = new IvParameterSpec(iv); + String resultStr = null; + + try { + Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); + SecretKeySpec keySpec = new SecretKeySpec(key,"AES"); + cipher.init(Cipher.DECRYPT_MODE,keySpec,ivSpec); + resultStr = new String(cipher.doFinal(encData),"UTF-8"); + } catch (Exception e){ +// logger.info("解析错误"); + e.printStackTrace(); + } + + // 解析加密后的字符串 + return resultStr; + } + +} diff --git a/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/vo/WxLoginBody.java b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/vo/WxLoginBody.java new file mode 100644 index 00000000..0d219ff4 --- /dev/null +++ b/dl-module-repair/src/main/java/cn/iocoder/yudao/module/app/vo/WxLoginBody.java @@ -0,0 +1,24 @@ +package cn.iocoder.yudao.module.app.vo; + +import lombok.Data; + +@Data +public class WxLoginBody { + /** + * 临时登陆凭证 code 只能使用一次 + */ + private String code; + + /** + * 偏移量 + */ + private String encryptedIv; + + /** + * 加密数据 + */ + private String encryptedData; + + //邀请码 + private Long inviteId; +} diff --git a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java index 547aa114..5a40a5e2 100644 --- a/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java +++ b/yudao-framework/yudao-spring-boot-starter-security/src/main/java/cn/iocoder/yudao/framework/security/config/YudaoWebSecurityConfigurerAdapter.java @@ -137,7 +137,7 @@ public class YudaoWebSecurityConfigurerAdapter { "/admin-api/system/auth/loginApp", "/admin-api/rescue/driverLogin").anonymous() // 对于登录login 注册register 验证码captchaImage 允许匿名访问 - .antMatchers("/admin-api/*/login", "/admin-api/*/wxLogin","/admin-api/*/wxLoginJc","/admin-api/*/wxLoginRescue","/admin-api/*/register","/admin-api/*/registerSmsCode","/admin-api/*/registerPhone","/admin-api/*/loginApp","/admin-api/*/loginSmsCode","/admin-api/*/captchaImage","/admin-api/*/pwdSmsCode","/admin-api/*/updatePwd").permitAll() + .antMatchers("/admin-api/*/login", "/admin-api/*/wxLogin","/admin-api/*/wxLoginJc","/admin-api/*/wxLoginRescue","/admin-api/*/registerSmsCode","/admin-api/*/registerPhone","/admin-api/*/loginApp","/admin-api/*/loginSmsCode","/admin-api/*/captchaImage","/admin-api/*/pwdSmsCode","/admin-api/*/updatePwd").permitAll() // 公共接口 for 小程序 .antMatchers("/admin-api/system/dict/data/list","/admin-api/system/user/profile/avatar","/admin-api/system/user/profile/updateNickName","/admin-api/system/user/profile/saveUserProfile","/admin-api/system/userCar/getUserCar","/admin-api/system/userFeedback/addFeedbackWx").permitAll() @@ -146,7 +146,7 @@ public class YudaoWebSecurityConfigurerAdapter { // 微信支付接口 .antMatchers("/admin-api/notify/**").permitAll() .antMatchers("/userClient/pay/**").permitAll() - .antMatchers("/userClient/weChat/**").permitAll() + .antMatchers("/userClient/weChat/**","/userClient/repair/wxLogin").permitAll() .antMatchers("/admin-api/websocket/**").permitAll() // 小程序首页 .antMatchers("/admin-api/system/notice/listWx","/admin-api/system/swiper/listWx","/admin-api/system/shopconfig/listWx").permitAll() diff --git a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java index 8066577c..b70db53b 100644 --- a/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java +++ b/yudao-module-system/yudao-module-system-api/src/main/java/cn/iocoder/yudao/module/system/api/user/dto/AdminUserRespDTO.java @@ -60,6 +60,7 @@ public class AdminUserRespDTO { * 枚举类 {@link SexEnum} */ private Integer sex; + private String repairOpenId; } diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java index 62044204..8a79beff 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/user/vo/user/UserSaveReqVO.java @@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.validation.Mobile; import cn.iocoder.yudao.module.system.framework.operatelog.core.DeptParseFunction; import cn.iocoder.yudao.module.system.framework.operatelog.core.PostParseFunction; import cn.iocoder.yudao.module.system.framework.operatelog.core.SexParseFunction; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; import com.fasterxml.jackson.annotation.JsonIgnore; import com.mzt.logapi.starter.annotation.DiffLogField; import io.swagger.v3.oas.annotations.media.Schema; diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java index ac6f73de..51896acb 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/service/auth/AdminAuthServiceImpl.java @@ -227,56 +227,12 @@ public class AdminAuthServiceImpl implements AdminAuthService { public AuthLoginRespVO wxLogin(String decryptResult, String openId, Long inviteId) { //字符串转json JSONObject jsonObject = JSONObject.parseObject(decryptResult); - System.out.println(jsonObject); - System.out.println("openId"+openId); String phoneNumber = jsonObject.getString("phoneNumber"); //还可以获取其他信息 //根据openid判断数据库中是否有该用户 //根据openid查询用户信息 AdminUserDO wxUser = userService.selectUserByPhone(phoneNumber); //如果查不到,则新增,查到了,则更新 -// SysUser user = new SysUser(); -// if (wxUser == null) { -// // 新增 -// user.setUserName(phoneNumber); -// user.setNickName(phoneNumber); -// user.setPhonenumber(phoneNumber); -// user.setOpenId(openId); -// user.setCreateTime(DateUtils.getNowDate()); -// user.setPassword(SecurityUtils.encryptPassword("654321")); -// if (null!=inviteId){ -// -// //绑定上级 -// user.setInviteId(inviteId); -// //给上级进行积分奖励 -// userBalanceService.inviteRewards(inviteId); -// } -// //新增 用户 -// userService.insertUser(user); -// }else { -// //更新 -// user = wxUser; -// user.setNickName(phoneNumber); -// user.setPhonenumber(phoneNumber); -// user.setUpdateTime(DateUtils.getNowDate()); -// user.setOpenId(openId); -// if (ObjectUtil.isEmpty(user.getInviteId())){ -// if (null!=inviteId){ -// //绑定上级 -// user.setInviteId(inviteId); -// //给上级进行积分奖励 -// userBalanceService.inviteRewards(inviteId); -// } -// } -// userMapper.updateUser(user); -// } - //组装token信息 -// LoginUser loginUser = new LoginUser(); -// loginUser.setOpenId(openId); -// //如果有的话设置 -// loginUser.setUser(user); -// loginUser.setUserId(user.getUserId()); - // 生成token return createTokenAfterLoginSuccess(wxUser.getId(), wxUser.getUsername(), LoginLogTypeEnum.LOGIN_SOCIAL); } @@ -419,7 +375,7 @@ public class AdminAuthServiceImpl implements AdminAuthService { List jcyh = roleService.getRoleListByCodes(Collections.singletonList("jcyh")); Set ids = new HashSet<>(); ids.add(jcyh.get(0).getId()); - permissionService.assignUserRole(user.getId(),ids); + // permissionService.assignUserRole(user.getId(),ids); }else { //更新 user.setId(wxUser.getId()); diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index effd7ac8..8531d105 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -3,7 +3,7 @@ spring: name: yudao-server profiles: - active: local + active: prod main: allow-circular-references: true # 允许循环依赖,因为项目是三层架构,无法避免这个情况。 @@ -230,6 +230,7 @@ yudao: - /admin-api/rescue/loginJcApp - /admin-api/system/tenant/getListByWebsite - /admin-api/rescue/loginQx + - /userClient/repair/wxLogin websocket: enable: true # websocket的开关 path: /infra/ws # 路径 @@ -285,6 +286,7 @@ yudao: - /userClient/pay/** - /userClient/weChat/** - /userClient/** + ignore-tables: - system_tenant - system_tenant_package