:art:完善部分新功能

This commit is contained in:
hello-hao
2022-07-18 17:12:18 +08:00
parent cec4db6947
commit 9293c0d295
7 changed files with 82 additions and 27 deletions
@@ -6,6 +6,7 @@ import cn.hellohao.service.*;
import cn.hellohao.service.impl.AlbumServiceImpl;
import cn.hellohao.service.impl.UploadServicel;
import cn.hellohao.service.impl.deleImages;
import cn.hellohao.utils.MyVersion;
import cn.hellohao.utils.verifyCode.IVerifyCodeGen;
import cn.hellohao.utils.verifyCode.SimpleCharVerifyCodeGenImpl;
import cn.hutool.captcha.CaptchaUtil;
@@ -13,6 +14,7 @@ import cn.hutool.captcha.ShearCaptcha;
import cn.hutool.captcha.generator.MathGenerator;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.subject.Subject;
@@ -304,6 +306,32 @@ public class IndexController {
return msg;
}
@PostMapping("/getClientVersion")
@ResponseBody
public Msg getClientVersion(@RequestParam(value = "data", defaultValue = "") String data) {
Msg msg = new Msg();
msg.setCode("000");
try {
JSONObject jsonObj = JSONObject.parseObject(data);
String appv = jsonObj.getString("version");
AppClient app = appClientService.getAppClientData("app");
if(!StringUtils.isBlank(app.getAppupdate())){
String version = app.getAppupdate().replaceAll("\\.","");
if(MyVersion.compareVersion(app.getAppupdate(),appv)==1){
JSONObject jsonObject = new JSONObject();
jsonObject.put("winpackurl",app.getWinpackurl());
jsonObject.put("macpackurl",app.getMacpackurl());
msg.setCode("200");
msg.setData(jsonObject);
}
}
}catch (Exception e){
msg.setCode("000");
}
return msg;
}
@RequestMapping("/authError")
@ResponseBody
public Msg authError(HttpServletRequest request){