he2802 3 жил өмнө
parent
commit
d587ddb9c7

+ 11 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/user/UserController.java

@@ -4,6 +4,7 @@ import java.util.List;
 import java.util.Arrays;
 
 import com.zhongzheng.common.core.domain.entity.SysUser;
+import com.zhongzheng.modules.alisms.service.IAliSmsService;
 import com.zhongzheng.modules.user.bo.*;
 import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.vo.UserStudyRecordVo;
@@ -42,6 +43,8 @@ public class UserController extends BaseController {
 
     private final IUserService iUserService;
 
+    private final IAliSmsService iSmsService;
+
     /**
      * 查询客户端用户列表
      */
@@ -122,4 +125,12 @@ public class UserController extends BaseController {
         return getDataTable(list);
     }
 
+    @ApiOperation("测试")
+    @PreAuthorize("@ss.hasPermi('app:user:studyRecordList')")
+    @GetMapping("/test")
+    public AjaxResult<Void> test(UserStudyRecordQueryBo bo) {
+        iSmsService.sendPwdSms("15999946079","559195");
+        return AjaxResult.success();
+    }
+
 }

+ 3 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -183,7 +183,8 @@ public class AliSmsServiceImpl implements IAliSmsService {
     public Boolean sendPwdSms(String tel,String code) {
         try{
             Map<String,Object> param = new HashMap<>();
-            param.put("code",code);
+            param.put("name","您好");
+            param.put("password",code);
             SmsAddBo smsAddBo = new SmsAddBo();
             smsAddBo.setCode(code);
             smsAddBo.setTel(tel);
@@ -195,6 +196,7 @@ public class AliSmsServiceImpl implements IAliSmsService {
                 return true;
             }
         }catch (Exception e){
+            System.out.println(e);
             throw new CustomException(e.getMessage());
         }
         return false;