瀏覽代碼

个人用户注册

lwhhszx 11 月之前
父節點
當前提交
f9eacf8cd6

+ 7 - 3
PCS/src/main/java/cn/cslg/permission/service/LoginService.java

@@ -77,6 +77,7 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
     private final AssoPersonVipTypeService assoPersonVipTypeService;
     private final AssoTenantVipTypeFunctionMapper assoTenantVipTypeFunctionMapper;
     private final SmsService smsService;
+    private final ApplicationService applicationService;
     @Autowired
     private PersonnelMapper personnelMapper;
     @Autowired
@@ -555,8 +556,8 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
             version = "1.0.0.0";
         }
         this.checkedRational(sign, appKey, vo.getCurrentTimeMillis());
-//        Integer userId = StpUtil.getLoginIdAsInt();
-        Integer userId = 438;
+        Integer userId = StpUtil.getLoginIdAsInt();
+//        Integer userId = 3;
         Personnel personnel = this.getById(userId);
         if (ObjectUtils.isEmpty(personnel)) {
             return Response.error(ResponseEnum.THE_TOKEN_IS_INVALID);
@@ -589,7 +590,10 @@ public class LoginService extends ServiceImpl<PersonnelMapper, Personnel> {
 
         List<String> permissions1 = new ArrayList<>();
         //获取所有权限
-        List<Function> functionList1 = functionService.list();
+        LambdaQueryWrapper<Application> queryWrapper =new LambdaQueryWrapper<>();
+        queryWrapper.eq(Application::getApplicationCode,appKey);
+        Application application =applicationService.getOne(queryWrapper,false);
+        List<Function> functionList1 = functionService.list(new LambdaQueryWrapper<Function>().eq(Function::getApplicationId,application.getId()));
 
         functionList1.forEach(i -> {
             permissions1.add(i.getFunctionPath());

+ 1 - 1
PCS/src/main/resources/application-testNetOut.yml

@@ -29,7 +29,7 @@ spring:
         max-wait: -1ms
     timeout: 2000ms
   datasource:
-    url: jdbc:mysql://47.101.137.223:3306/PCS_TEST?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
+    url: jdbc:mysql://47.101.137.223:3306/PCS_TEST3?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=GMT%2B8
     username: root
     password: TU5x6IeBi7rl
     driver-class-name: com.mysql.cj.jdbc.Driver

+ 1 - 1
PCS/src/main/resources/mapper/TenantVipTypeMapper.xml

@@ -32,7 +32,7 @@
         <where>
             USE_TYPE is null
             <if test="likeName != null">
-                TENANT_VIP_NAME like #{likeName} or CREATE_PERSON_NAME like #{likeName}
+             and   (TENANT_VIP_NAME like #{likeName} or CREATE_PERSON_NAME like #{likeName})
             </if>
         </where>
         order by

+ 8 - 8
PCS/src/test/java/cn/cslg/permission/EncryptionPersonTest.java

@@ -32,10 +32,10 @@ public class EncryptionPersonTest {
     private PersonnelService personnelService;
 
     @Test
-    public void loginByEncryption() throws Exception {
+    public void test() throws Exception {
         EncryptionLoginDTO vo = new EncryptionLoginDTO();
-        vo.setUsername("gaochangkui-qy");
-        vo.setPassword("Xiaoshi221101*");
+        vo.setUsername("zhangsansan");
+        vo.setPassword("12343545");
         vo.setAppKey("4e95e3d926a2a4befa5d913acc0aa9f5");
 //        vo.setMachineCode("BDACEARQ1241241");
         vo.setMachineCode("BFEBFBFF000A0654");
@@ -49,7 +49,7 @@ public class EncryptionPersonTest {
     }
 
     @Test
-    public void functionByEncryption() throws Exception {
+    public void test11() throws Exception {
         final long timeMillis = System.currentTimeMillis();
         String appSecret = "4e95e3d926a2a4befa5d913acc0aa9f5" + timeMillis / 1000;
         String md5Sign = SecureUtil.md5(appSecret);
@@ -57,7 +57,7 @@ public class EncryptionPersonTest {
         functionDTO.setAppKey("4e95e3d926a2a4befa5d913acc0aa9f5");
         functionDTO.setCurrentTimeMillis(timeMillis);
         functionDTO.setSign(md5Sign);
-        functionDTO.setVersion("1");
+        functionDTO.setVersion("1.0.0.1");
         final String function = loginService.functionByEncryption(functionDTO);
         System.out.println(function);
     }
@@ -92,7 +92,7 @@ public class EncryptionPersonTest {
     @Test
     public void getPhoneCode() {
         SendCodeDTO vo = new SendCodeDTO();
-        vo.setPhoneNum("15705220533");
+        vo.setPhoneNum("17625547167");
         String s = loginService.getPhoneCode(vo);
         System.out.println(s);
     }
@@ -100,8 +100,8 @@ public class EncryptionPersonTest {
     @Test
     public void loginByPhone() throws Exception {
         PhoneLoginDTO vo = new PhoneLoginDTO();
-        vo.setPhoneNum("15705220533");
-        vo.setPhoneCode("923331");
+        vo.setPhoneNum("17625547167");
+        vo.setPhoneCode("357133");
         vo.setAppKey("4e95e3d926a2a4befa5d913acc0aa9f5");
         vo.setMachineCode("BFEBFBFF000A0654");
         final long timeMillis = System.currentTimeMillis();