回退短信和文件上传
This commit is contained in:
parent
ffa3c54014
commit
033f4ba75f
|
|
@ -63,9 +63,9 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
|
List<MultipartFile> items = (List<MultipartFile>) map.get("filePath");
|
||||||
MultipartFile item = items.get(0);
|
MultipartFile item = items.get(0);
|
||||||
try {
|
try {
|
||||||
//String url = saveFile(request, item, photoType);
|
String url = saveFile(request, item, photoType);
|
||||||
AjaxResult res = fileClient.uploadFile(item);
|
//AjaxResult res = fileClient.uploadFile(item);
|
||||||
String url = (String) res.get("msg");
|
//String url = (String) res.get("msg");
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
int words = getFileText(item);
|
int words = getFileText(item);
|
||||||
String fileName = item.getOriginalFilename();
|
String fileName = item.getOriginalFilename();
|
||||||
|
|
@ -98,9 +98,9 @@ public class SysFileServiceImpl implements SysFileService {
|
||||||
FileInfo file = new FileInfo();
|
FileInfo file = new FileInfo();
|
||||||
Long userId = SecurityUtils.getLoginUser().getUserid();
|
Long userId = SecurityUtils.getLoginUser().getUserid();
|
||||||
try {
|
try {
|
||||||
//String url = saveFilePic(item, fileType);
|
String url = saveFilePic(item, fileType);
|
||||||
AjaxResult res = fileClient.uploadFile(item);
|
/*AjaxResult res = fileClient.uploadFile(item);
|
||||||
String url = (String) res.get("msg");
|
String url = (String) res.get("msg");*/
|
||||||
if (url != null) {
|
if (url != null) {
|
||||||
int words = getFileText(item);
|
int words = getFileText(item);
|
||||||
String fileName = item.getOriginalFilename();
|
String fileName = item.getOriginalFilename();
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.bonus.sgzb.system.service.impl;
|
package com.bonus.sgzb.system.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.http.HttpRequest;
|
||||||
import com.alibaba.druid.util.StringUtils;
|
import com.alibaba.druid.util.StringUtils;
|
||||||
import com.alibaba.fastjson.JSONObject;
|
import com.alibaba.fastjson.JSONObject;
|
||||||
import com.bonus.sgzb.common.core.constant.UserConstants;
|
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) {
|
if (phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
||||||
return AjaxResult.error("手机号格式不正确");
|
return AjaxResult.error("手机号格式不正确");
|
||||||
}
|
}
|
||||||
try {
|
/* try {
|
||||||
String[] args = msg.split(",");
|
String[] args = msg.split(",");
|
||||||
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
String body = sendMessageNew(phone,tencentSmsConfig.getTemplateId().get(0),args);
|
||||||
return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
|
return success("发送手机号码:" + phone + ",内容:" + msg + ",返回结果:" + body);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("发送失败:" + e.getMessage());
|
return AjaxResult.error("发送失败:" + e.getMessage());
|
||||||
}
|
}*/
|
||||||
|
return sendMsgByPhone( phone, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -83,7 +85,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
@Override
|
@Override
|
||||||
public AjaxResult codeLogin(String phone) {
|
public AjaxResult codeLogin(String phone) {
|
||||||
|
|
||||||
try {
|
/*try {
|
||||||
//获取六位验证码
|
//获取六位验证码
|
||||||
String code = getSixBitCode();
|
String code = getSixBitCode();
|
||||||
//调用发送短信的方法
|
//调用发送短信的方法
|
||||||
|
|
@ -93,7 +95,8 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body);
|
return success("手机号:" + phone + ",用户登录验证码:" + code + ",返回结果:" + body);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("发送失败:" + e.getMessage());
|
return AjaxResult.error("发送失败:" + e.getMessage());
|
||||||
}
|
}*/
|
||||||
|
return sendCodeByPhone(phone,null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -102,7 +105,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
* @param phone 手机号码
|
* @param phone 手机号码
|
||||||
* @return AjaxResult对象
|
* @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) {
|
if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
||||||
return AjaxResult.error("手机号码不正确");
|
return AjaxResult.error("手机号码不正确");
|
||||||
|
|
@ -120,7 +123,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("发送失败:" + e.getMessage());
|
return AjaxResult.error("发送失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -128,7 +131,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
* @param phone 手机号码
|
* @param phone 手机号码
|
||||||
* @return AjaxResult对象
|
* @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) {
|
if (phone == null || phone.length() != UserConstants.PHONE_DEFAULT_LENGTH_LOGIN) {
|
||||||
return AjaxResult.error("手机号格式错误,请输入11位数字号码");
|
return AjaxResult.error("手机号格式错误,请输入11位数字号码");
|
||||||
|
|
@ -152,7 +155,7 @@ public class SysSmsServiceImpl implements ISysSmsService {
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
return AjaxResult.error("发送失败:" + e.getMessage());
|
return AjaxResult.error("发送失败:" + e.getMessage());
|
||||||
}
|
}
|
||||||
}*/
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue