update 客户端下载修复
This commit is contained in:
@@ -65,6 +65,7 @@ public class LoginInterceptor implements HandlerInterceptor {
|
||||
* 验证token 并刷新token
|
||||
*/
|
||||
private boolean isValidToken(String token) {
|
||||
System.out.println("token:"+token);
|
||||
String userEmail = JwtUtils.getUserName(token);
|
||||
String getUserId = JwtUtils.getUserId(token);
|
||||
//1.把userEmail存入ThreadLocal 本地线程变量中
|
||||
|
||||
@@ -101,12 +101,14 @@ public class LeaseUserController {
|
||||
}
|
||||
|
||||
@GetMapping("/downloadClient")
|
||||
@LoginRequired(value = false)
|
||||
@ApiOperation(value = "卖家:下载客户端")
|
||||
public void downloadClient(@RequestParam String userEmail,@RequestParam String type,HttpServletRequest request, HttpServletResponse response){
|
||||
leaseUserService.downloadClient(userEmail,type,request, response);
|
||||
}
|
||||
|
||||
@GetMapping("/getClientVersion")
|
||||
@LoginRequired(value = false)
|
||||
@ApiOperation(value = "获取客户端版本号")
|
||||
public String getClientVersion(){
|
||||
return leaseUserService.getClientVersion();
|
||||
|
||||
@@ -1470,7 +1470,8 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
|
||||
System.out.println("获取下载权限码"+userEmail);
|
||||
LeaseShop leaseShop = leaseShopMapper.selectOne(new LambdaQueryWrapper<LeaseShop>()
|
||||
.select(LeaseShop::getUserEmail)
|
||||
.eq(LeaseShop::getUserEmail, userEmail));
|
||||
.eq(LeaseShop::getUserEmail, userEmail)
|
||||
.eq(LeaseShop::getDel,false));
|
||||
|
||||
if (leaseShop == null){
|
||||
throw new RuntimeException("下载失败,下载客户端权限,请重新登录并创建店铺");
|
||||
@@ -1512,7 +1513,13 @@ public class LeaseUserServiceImpl extends ServiceImpl<LeaseUserMapper, LeaseUser
|
||||
Files.write(authFile, auth.getBytes(StandardCharsets.UTF_8));
|
||||
|
||||
//读取/home/ubuntu/web/client/linux 或 /home/ubuntu/web/client/windows 下所有文件和 auth文件一起压缩
|
||||
Path sourceDir = Paths.get(downloadClientLinux);
|
||||
Path sourceDir;
|
||||
if (type.equals("linux")){
|
||||
sourceDir = Paths.get(downloadClientLinux);
|
||||
}else{
|
||||
sourceDir = Paths.get(downloadClientWindows);
|
||||
}
|
||||
|
||||
try {
|
||||
Files.walk(sourceDir)
|
||||
.filter(path -> !Files.isDirectory(path))
|
||||
|
||||
Reference in New Issue
Block a user