|
@@ -8,6 +8,7 @@ import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.common.util.JwtUtil;
|
|
|
import com.fdkankan.common.util.NumberUtils;
|
|
|
import com.fdkankan.common.util.SecurityUtil;
|
|
|
+import com.fdkankan.fyun.face.FYunFileServiceInterface;
|
|
|
import com.fdkankan.image.MatrixToImageWriterUtil;
|
|
|
import com.fdkankan.ucenter.common.MailUtil;
|
|
|
import com.fdkankan.ucenter.common.constants.ConstantFilePath;
|
|
@@ -30,6 +31,8 @@ import com.fdkankan.ucenter.vo.request.LoginParam;
|
|
|
import com.fdkankan.ucenter.vo.request.RegisterParam;
|
|
|
import com.fdkankan.ucenter.vo.response.LoginVo;
|
|
|
import com.fdkankan.ucenter.vo.response.UserVo;
|
|
|
+
|
|
|
+import java.io.File;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
import java.util.Map;
|
|
@@ -60,6 +63,8 @@ public class LoginService {
|
|
|
private String cnCode;
|
|
|
@Value("${admin.register.validCode:2a22bac40f44af4d3b5fdc20ea706fc5}")
|
|
|
private String registerValidCode;
|
|
|
+ @Autowired
|
|
|
+ private FYunFileServiceInterface fYunFileServiceInterface;
|
|
|
|
|
|
|
|
|
public LoginVo login(LoginParam param) {
|
|
@@ -183,8 +188,11 @@ public class LoginService {
|
|
|
public JSONObject createLoginQrCode() throws Exception {
|
|
|
String uuid = NumberUtils.getUUID();
|
|
|
String filePath = QrCodeFilePath.LOGIN_QR_CODE_PATH + uuid + ".png";
|
|
|
- String path =this.getClass().getResource("/static/img/logo.jpg").getPath();
|
|
|
- MatrixToImageWriterUtil.createQRCode(NacosProperty.getMainUrl() + "app/index.html?m="+uuid, filePath,true,path);
|
|
|
+ File file = new File(QrCodeFilePath.LOGO_IMAGE_LOCAL);
|
|
|
+ if(!file.exists()){
|
|
|
+ fYunFileServiceInterface.downloadFile(QrCodeFilePath.LOGO_IMAGE_OSS,QrCodeFilePath.LOGO_IMAGE_LOCAL);
|
|
|
+ }
|
|
|
+ MatrixToImageWriterUtil.createQRCode(NacosProperty.getMainUrl() + "app/index.html?m="+uuid, filePath,true,QrCodeFilePath.LOGO_IMAGE_LOCAL);
|
|
|
JSONObject json = new JSONObject();
|
|
|
json.put("url", filePath.replace(ConstantFilePath.BASE_PATH, ""));
|
|
|
json.put("uuid", uuid);
|