修改app二维码路径

master
gongzhenkun 2 years ago
parent 996f0b414f
commit c48c5c1ab3

@ -134,10 +134,18 @@ public class RuoYiConfig
} }
/** /**
* *
*/ */
public static String getAppInfoPath() public static String getAppInfoPath()
{ {
return getProfile() + "/appInfo"; return getProfile() + "/appInfo";
} }
/**
*
*/
public static String getQRCodePath()
{
return getProfile() + "/qrCode";
}
} }

@ -282,7 +282,7 @@ public class FileUploadUtils
try { try {
String codeName = UUID.randomUUID().toString();// 二维码的图片名 String codeName = UUID.randomUUID().toString();// 二维码的图片名
String imageType = "jpg";// 图片类型 String imageType = "jpg";// 图片类型
picPath = codeName + "." + imageType; picPath = DateUtils.datePath() + "/" + codeName + "." + imageType;
MultiFormatWriter multiFormatWriter = new MultiFormatWriter(); MultiFormatWriter multiFormatWriter = new MultiFormatWriter();
Map<EncodeHintType, String> hints = new HashMap<EncodeHintType, String>(); Map<EncodeHintType, String> hints = new HashMap<EncodeHintType, String>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8"); hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");

@ -3,11 +3,11 @@ package com.ruoyi.framework.web.service;
import javax.annotation.Resource; import javax.annotation.Resource;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.UserStatus; import com.ruoyi.common.enums.UserStatus;
import com.ruoyi.common.utils.*; import com.ruoyi.common.utils.*;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.system.domain.TDoctor; import com.ruoyi.system.domain.TDoctor;
import com.ruoyi.system.domain.req.AppRegisterReq; import com.ruoyi.system.domain.req.AppRegisterReq;
import com.ruoyi.system.mapper.TDoctorMapper; import com.ruoyi.system.mapper.TDoctorMapper;
@ -15,7 +15,6 @@ import com.ruoyi.system.service.impl.UserTokenService;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.BadCredentialsException; import org.springframework.security.authentication.BadCredentialsException;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken; import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
@ -50,8 +49,6 @@ public class SysLoginService
{ {
private static final Logger log = LoggerFactory.getLogger(SysLoginService.class); private static final Logger log = LoggerFactory.getLogger(SysLoginService.class);
@Value("${ruoyi.profile}")
private String uploadFilePath;
@Autowired @Autowired
private TokenService tokenService; private TokenService tokenService;
@ -208,7 +205,7 @@ public class SysLoginService
map.put("id", tDoctor.getId()); map.put("id", tDoctor.getId());
map.put("from", "yinuo"); map.put("from", "yinuo");
String content = JSONObject.toJSONString(map); String content = JSONObject.toJSONString(map);
String qrCode = FileUploadUtils.code(content, uploadFilePath); String qrCode = FileUploadUtils.code(content, RuoYiConfig.getQRCodePath());
tDoctor.setQrCode(qrCode); tDoctor.setQrCode(qrCode);
log.info("update doctor :{}", tDoctor); log.info("update doctor :{}", tDoctor);
tDoctorMapper.updateTDoctor(tDoctor); tDoctorMapper.updateTDoctor(tDoctor);

@ -1,13 +1,13 @@
package com.ruoyi.system.service.impl; package com.ruoyi.system.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.domain.entity.SysUser; import com.ruoyi.common.core.domain.entity.SysUser;
import com.ruoyi.common.core.domain.model.LoginUser; import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.file.FileUploadUtils; import com.ruoyi.common.utils.file.FileUploadUtils;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.common.utils.http.HttpUtils; import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.common.utils.ip.IpUtils; import com.ruoyi.common.utils.ip.IpUtils;
import com.ruoyi.common.utils.wechat.WechatKeys; import com.ruoyi.common.utils.wechat.WechatKeys;
@ -59,9 +59,6 @@ public class WechatServiceImpl implements IWechatService {
@Value("${wx.wechatSecret}") @Value("${wx.wechatSecret}")
private String wechatSecret; private String wechatSecret;
@Value("${ruoyi.profile}")
private String uploadFilePath;
@Resource @Resource
private TWechatUserMapper tWechatUserMapper; private TWechatUserMapper tWechatUserMapper;
@ -190,7 +187,7 @@ public class WechatServiceImpl implements IWechatService {
map.put("id", tDoctor.getId()); map.put("id", tDoctor.getId());
map.put("from", "yinuo"); map.put("from", "yinuo");
String content = JSONObject.toJSONString(map); String content = JSONObject.toJSONString(map);
String qrCode = FileUploadUtils.code(content, uploadFilePath); String qrCode = FileUploadUtils.code(content, RuoYiConfig.getQRCodePath());
tDoctor.setQrCode(qrCode); tDoctor.setQrCode(qrCode);
logger.info("update doctor :{}", tDoctor); logger.info("update doctor :{}", tDoctor);
tDoctorMapper.updateTDoctor(tDoctor); tDoctorMapper.updateTDoctor(tDoctor);

Loading…
Cancel
Save