diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java index 5c1dc3d0..d13b322d 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysFileServiceImpl.java @@ -63,9 +63,9 @@ public class SysFileServiceImpl implements SysFileService { List items = (List) map.get("filePath"); MultipartFile item = items.get(0); try { - //String url = saveFile(request, item, photoType); - AjaxResult res = fileClient.uploadFile(item); - String url = (String) res.get("msg"); + String url = saveFile(request, item, photoType); + //AjaxResult res = fileClient.uploadFile(item); + //String url = (String) res.get("msg"); if (url != null) { int words = getFileText(item); String fileName = item.getOriginalFilename(); @@ -98,9 +98,9 @@ public class SysFileServiceImpl implements SysFileService { FileInfo file = new FileInfo(); Long userId = SecurityUtils.getLoginUser().getUserid(); try { - //String url = saveFilePic(item, fileType); - AjaxResult res = fileClient.uploadFile(item); - String url = (String) res.get("msg"); + String url = saveFilePic(item, fileType); + /*AjaxResult res = fileClient.uploadFile(item); + String url = (String) res.get("msg");*/ if (url != null) { int words = getFileText(item); String fileName = item.getOriginalFilename(); diff --git a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java index 5d44e70e..afe1cd07 100644 --- a/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java +++ b/sgzb-modules/sgzb-system/src/main/java/com/bonus/sgzb/system/service/impl/SysSmsServiceImpl.java @@ -1,5 +1,6 @@ package com.bonus.sgzb.system.service.impl; +import cn.hutool.http.HttpRequest; import com.alibaba.druid.util.StringUtils; import com.alibaba.fastjson.JSONObject; import com.bonus.sgzb.common.core.constant.UserConstants; @@ -66,13 +67,14 @@ public class SysSmsServiceImpl implements ISysSmsService { if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式不正确"); } - try { + /* try { String[] args = msg.split(","); String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args); return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); - } + }*/ + return sendMsgByPhone( phone, msg); } /** @@ -83,7 +85,7 @@ public class SysSmsServiceImpl implements ISysSmsService { @Override public AjaxResult codeLogin(String phone) { - try { + /*try { //获取六位验证码 String code = getSixBitCode(); //调用发送短信的方法 @@ -93,7 +95,8 @@ public class SysSmsServiceImpl implements ISysSmsService { return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body); } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); - } + }*/ + return sendCodeByPhone(phone,null); } @@ -102,7 +105,7 @@ public class SysSmsServiceImpl implements ISysSmsService { * @param phone 手机号码 * @return AjaxResult对象 */ -/* private AjaxResult sendMsgByPhone(String phone, String msg) { + private AjaxResult sendMsgByPhone(String phone, String msg) { // 校验手机号码 if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号码不正确"); @@ -120,7 +123,7 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } - }*/ + } /** @@ -128,7 +131,7 @@ public class SysSmsServiceImpl implements ISysSmsService { * @param phone 手机号码 * @return AjaxResult对象 */ -/* private AjaxResult sendCodeByPhone(String phone, String msg) { + private AjaxResult sendCodeByPhone(String phone, String msg) { // 校验手机号码 if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) { return AjaxResult.error("手机号格式错误,请输入11位数字号码"); @@ -152,7 +155,7 @@ public class SysSmsServiceImpl implements ISysSmsService { } catch (Exception e) { return AjaxResult.error("发送失败:" + e.getMessage()); } - }*/ + } /**