|
@@ -104,6 +104,7 @@ public class SysUserController {
|
|
|
accessToken.setUser(user);
|
|
|
return new Result(ResultCode.SUCCESS,accessToken);
|
|
|
}
|
|
|
+
|
|
|
@PostMapping(value = "/login")
|
|
|
public Result loginMultilevel(HttpServletRequest req, @RequestBody Map<String, String> map) {
|
|
|
String remoteHost = req.getRemoteHost();
|
|
@@ -202,7 +203,7 @@ public class SysUserController {
|
|
|
|
|
|
@PostMapping(value = "/add")
|
|
|
public Result add(HttpServletRequest req,@RequestParam(name = "idCordFrontUrl") MultipartFile idCordFrontUrl,
|
|
|
- @RequestParam(name ="idCordBackUrl") MultipartFile idCordBackUrl,
|
|
|
+ @RequestParam(name ="idCordBackUrl",required = false) MultipartFile idCordBackUrl,
|
|
|
@RequestParam(name ="type") String type,
|
|
|
@RequestParam(name ="userName") String userName,
|
|
|
@RequestParam(name = "idCord",required = false) String idCord,
|
|
@@ -235,29 +236,33 @@ public class SysUserController {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- String content = "https://img.ifarmcloud.com/images/" + path + "/" + imgname;
|
|
|
+
|
|
|
+ String content = "https://dam.img.ifarmcloud.com:8030/images/" + path + "/" + imgname;
|
|
|
String imgname2 = "成功";
|
|
|
- String originalFilename2 = idCordBackUrl.getOriginalFilename();
|
|
|
- String filenameExtension2 = StringUtils.getFilenameExtension(originalFilename2);
|
|
|
- String path2 = DateUtil.format(new Date(), "yyyy-MM");
|
|
|
- try {
|
|
|
- InputStream inputStream = idCordBackUrl.getInputStream();
|
|
|
- BufferedInputStream in = new BufferedInputStream(inputStream);
|
|
|
- ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
|
|
|
- byte[] temp = new byte[1024];
|
|
|
- int size = 0;
|
|
|
- while ((size = in.read(temp)) != -1) {
|
|
|
- out.write(temp, 0, size);
|
|
|
+
|
|
|
+ String content2 ="" ;
|
|
|
+ if (!"2".equals(type)){
|
|
|
+ String originalFilename2 = idCordBackUrl.getOriginalFilename();
|
|
|
+ String filenameExtension2 = StringUtils.getFilenameExtension(originalFilename2);
|
|
|
+ String path2 = DateUtil.format(new Date(), "yyyy-MM");
|
|
|
+ try {
|
|
|
+ InputStream inputStream = idCordBackUrl.getInputStream();
|
|
|
+ BufferedInputStream in = new BufferedInputStream(inputStream);
|
|
|
+ ByteArrayOutputStream out = new ByteArrayOutputStream(1024);
|
|
|
+ byte[] temp = new byte[1024];
|
|
|
+ int size = 0;
|
|
|
+ while ((size = in.read(temp)) != -1) {
|
|
|
+ out.write(temp, 0, size);
|
|
|
+ }
|
|
|
+ in.close();
|
|
|
+ byte[] idCordBackUrlByte = out.toByteArray();
|
|
|
+ imgname2 = UUID.randomUUID() + "." + filenameExtension2;
|
|
|
+ UploadImage.sshSftp(idCordBackUrlByte, path2, imgname2);
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
}
|
|
|
- in.close();
|
|
|
- byte[] content2 = out.toByteArray();
|
|
|
- imgname2 = UUID.randomUUID() + "." + filenameExtension2;
|
|
|
- UploadImage.sshSftp(content2, path2, imgname2);
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
+ content2 = "https://dam.img.ifarmcloud.com:8030/images/" + path2 + "/" + imgname2;
|
|
|
}
|
|
|
- String content2 = "https://img.ifarmcloud.com/images/" + path2 + "/" + imgname2;
|
|
|
-
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("idCordFrontUrl", content);
|
|
@@ -416,7 +421,7 @@ public class SysUserController {
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- String content3 = "https://img.ifarmcloud.com/images/" + path3 + "/" + imgname3;
|
|
|
+ String content3 = "https://dam.img.ifarmcloud.com:8030/images/" + path3 + "/" + imgname3;
|
|
|
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
map.put("id", id);
|