修改上传文件路径

main
杜函宇 8 months ago
parent 714f3656e1
commit 7178e8e0d1

@ -1,12 +1,12 @@
<p align="center">
<img alt="logo" src="https://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
<img alt="logo" src="httpsRequest://oscimg.oschina.net/oscnet/up-d3d0a9303e11d522a06cd263f3079027715.png">
</p>
<h1 align="center" style="margin: 30px 0 30px; font-weight: bold;">RuoYi v3.8.6</h1>
<h4 align="center">基于SpringBoot+Vue前后端分离的Java快速开发框架</h4>
<p align="center">
<a href="https://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="https://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue"><img src="https://img.shields.io/badge/RuoYi-v3.8.6-brightgreen.svg"></a>
<a href="https://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="https://img.shields.io/github/license/mashape/apistatus.svg"></a>
<a href="httpsRequest://gitee.com/y_project/RuoYi-Vue/stargazers"><img src="httpsRequest://gitee.com/y_project/RuoYi-Vue/badge/star.svg?theme=dark"></a>
<a href="httpsRequest://gitee.com/y_project/RuoYi-Vue"><img src="httpsRequest://img.shields.io/badge/RuoYi-v3.8.6-brightgreen.svg"></a>
<a href="httpsRequest://gitee.com/y_project/RuoYi-Vue/blob/master/LICENSE"><img src="httpsRequest://img.shields.io/github/license/mashape/apistatus.svg"></a>
</p>
## 平台简介
@ -18,11 +18,11 @@
* 权限认证使用Jwt支持多终端认证系统。
* 支持加载动态权限菜单,多方式轻松权限控制。
* 高效率开发,使用代码生成器可以一键生成前后端代码。
* 提供了技术栈([Vue3](https://v3.cn.vuejs.org) [Element Plus](https://element-plus.org/zh-CN) [Vite](https://cn.vitejs.dev))版本[RuoYi-Vue3](https://github.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](https://github.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](https://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](https://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](https://gitee.com/y_project/RuoYi-Cloud)
* 提供了技术栈([Vue3](httpsRequest://v3.cn.vuejs.org) [Element Plus](httpsRequest://element-plus.org/zh-CN) [Vite](httpsRequest://cn.vitejs.dev))版本[RuoYi-Vue3](httpsRequest://github.com/yangzongzhuan/RuoYi-Vue3),保持同步更新。
* 提供了单应用版本[RuoYi-Vue-fast](httpsRequest://github.com/yangzongzhuan/RuoYi-Vue-fast)Oracle版本[RuoYi-Vue-Oracle](httpsRequest://github.com/yangzongzhuan/RuoYi-Vue-Oracle),保持同步更新。
* 不分离版本,请移步[RuoYi](httpsRequest://gitee.com/y_project/RuoYi),微服务版本,请移步[RuoYi-Cloud](httpsRequest://gitee.com/y_project/RuoYi-Cloud)
* 阿里云折扣场:[点我进入](http://aly.ruoyi.vip),腾讯云秒杀场:[点我进入](http://txy.ruoyi.vip)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](https://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](https://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
* 阿里云优惠券:[点我领取](httpsRequest://www.aliyun.com/minisite/goods?userCode=brki8iof&share_source=copy_link),腾讯云优惠券:[点我领取](httpsRequest://cloud.tencent.com/redirect.php?redirect=1025&cps_key=198c8df2ed259157187173bc7f4f32fd&from=console)&nbsp;&nbsp;
## 内置功能
@ -57,40 +57,40 @@
<table>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/cd1f90be5f2684f4560c9519c0f2a232ee8.jpg"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/1cbcf0e6f257c7d3a063c0e3f2ff989e4b3.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-8074972883b5ba0622e13246738ebba237a.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-9f88719cdfca9af2e58b352a20e23d43b12.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-39bf2584ec3a529b0d5a3b70d15c9b37646.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-936ec82d1f4872e1bc980927654b6007307.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-b2d62ceb95d2dd9b3fbe157bb70d26001e9.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-d67451d308b7a79ad6819723396f7c3d77a.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/5e8c387724954459291aafd5eb52b456f53.jpg"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/644e78da53c2e92a95dfda4f76e6d117c4b.jpg"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-8370a0d02977eebf6dbf854c8450293c937.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-49003ed83f60f633e7153609a53a2b644f7.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-d4fe726319ece268d4746602c39cffc0621.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-c195234bbcd30be6927f037a6755e6ab69c.png"/></td>
</tr>
<tr>
<td><img src="https://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="https://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/b6115bc8c31de52951982e509930b20684a.jpg"/></td>
<td><img src="httpsRequest://oscimg.oschina.net/oscnet/up-5e4daac0bb59612c5038448acbcef235e3a.png"/></td>
</tr>
</table>
## 若依前后端分离交流群
QQ群 [![加入QQ群](https://img.shields.io/badge/已满-937441-blue.svg)](https://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](https://img.shields.io/badge/已满-887144332-blue.svg)](https://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](https://img.shields.io/badge/已满-180251782-blue.svg)](https://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](https://img.shields.io/badge/已满-104180207-blue.svg)](https://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](https://img.shields.io/badge/已满-186866453-blue.svg)](https://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](https://img.shields.io/badge/已满-201396349-blue.svg)](https://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](https://img.shields.io/badge/已满-101456076-blue.svg)](https://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](https://img.shields.io/badge/已满-101539465-blue.svg)](https://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](https://img.shields.io/badge/已满-264312783-blue.svg)](https://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](https://img.shields.io/badge/已满-167385320-blue.svg)](https://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](https://img.shields.io/badge/已满-104748341-blue.svg)](https://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](https://img.shields.io/badge/已满-160110482-blue.svg)](https://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](https://img.shields.io/badge/已满-170801498-blue.svg)](https://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](https://img.shields.io/badge/已满-108482800-blue.svg)](https://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](https://img.shields.io/badge/已满-101046199-blue.svg)](https://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](https://img.shields.io/badge/已满-136919097-blue.svg)](https://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](https://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](https://img.shields.io/badge/174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) 点击按钮入群。
QQ群 [![加入QQ群](httpsRequest://img.shields.io/badge/已满-937441-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=5bVB1og) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-887144332-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=5eiA4DH) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-180251782-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=5AxMKlC) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-104180207-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=51G72yr) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-186866453-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=VvjN2nvu) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-201396349-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=5vYAqA05) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-101456076-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=kOIINEb5) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-101539465-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=UKtX5jhs) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-264312783-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=EI9an8lJ) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-167385320-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=SWCtLnMz) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-104748341-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=96Dkdq0k) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-160110482-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=0fsNiYZt) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-170801498-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=7xw4xUG1) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-108482800-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=eCx8eyoJ) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-101046199-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=SpyH2875) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-136919097-blue.svg)](httpsRequest://jq.qq.com/?_wv=1027&k=tKEt51dz) [![加入QQ群](httpsRequest://img.shields.io/badge/已满-143961921-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=0vBbSb0ztbBgVtn3kJS-Q4HUNYwip89G&authKey=8irq5PhutrZmWIvsUsklBxhj57l%2F1nOZqjzigkXZVoZE451GG4JHPOqW7AW6cf0T&noverify=0&group_code=143961921) [![加入QQ群](httpsRequest://img.shields.io/badge/174951577-blue.svg)](http://qm.qq.com/cgi-bin/qm/qr?_wv=1027&k=ZFAPAbp09S2ltvwrJzp7wGlbopsc0rwi&authKey=HB2cxpxP2yspk%2Bo3WKTBfktRCccVkU26cgi5B16u0KcAYrVu7sBaE7XSEqmMdFQp&noverify=0&group_code=174951577) 点击按钮入群。

@ -193,7 +193,7 @@
<repository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<url>httpsRequest://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>
@ -204,7 +204,7 @@
<pluginRepository>
<id>public</id>
<name>aliyun nexus</name>
<url>https://maven.aliyun.com/repository/public</url>
<url>httpsRequest://maven.aliyun.com/repository/public</url>
<releases>
<enabled>true</enabled>
</releases>

@ -39,6 +39,13 @@
<artifactId>ruoyi-framework</artifactId>
</dependency>
<!--hutoll-->
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>5.8.16</version>
</dependency>
<!-- 定时任务-->
<dependency>
<groupId>com.ruoyi</groupId>

@ -0,0 +1,70 @@
package com.ruoyi.tcZz.controller;
import cn.hutool.core.io.FileUtil;
import cn.hutool.http.HttpUtil;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.file.FileUtils;
import com.ruoyi.framework.config.ServerConfig;
import com.ruoyi.tcZz.domain.httpsRequest;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.io.FilenameUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.net.URL;
/**
* @author du
* @since 2024/1/17 16:04
*/
@Api(tags = "文件通用包装")
@RestController
@RequestMapping("/tcZz/networkEcology/getHttp")
public class httpController {
@Value("${ruoyi.profile}")
private String profile;
@Autowired
private ServerConfig serverConfig;
/**
*
*/
@ApiOperation(value = "根据文件地址去请求该地址的数据")
@PostMapping
public AjaxResult screenSupervision(@RequestBody httpsRequest httpsRequest) throws IOException {
URL url1 = new URL(httpsRequest.getUrls());
// if (FilenameUtils.getExtension(url.getPath()).equals("docx") || FilenameUtils.getExtension(url.getPath()).equals("doc")) {
// long l = HttpUtil.downloadFile(httpsRequest.getUrls(), FileUtil.file(this.profile));
// // 设置响应头,用于告诉浏览器该响应是一个文件下载
// response.setContentType("application/octet-stream");
// response.setHeader("Content-Disposition", "attachment; filename=" + URLEncoder.encode(FilenameUtils.getName(url.getPath()), "UTF-8"));
// // 获取文件流
// InputStream inputStream = FileUtil.getInputStream(this.profile + "/" + FilenameUtils.getName(url.getPath()));
// // 将文件流写入响应体中
// ServletOutputStream outputStream = response.getOutputStream();
// byte[] buffer = new byte[1024];
// int bytesRead;
// while ((bytesRead = inputStream.read(buffer)) != -1) {
// outputStream.write(buffer, 0, bytesRead);
// }
// inputStream.close();
// outputStream.flush();
// outputStream.close();
// boolean success = FileUtil.del(this.profile + "/" + FilenameUtils.getName(url.getPath()));
// } else if (FilenameUtils.getExtension(url.getPath()).equals("pdf")) {
// }
long l = HttpUtil.downloadFile(httpsRequest.getUrls(), FileUtil.file(this.profile));
String https = "/profile/"+FilenameUtils.getName(url1.getPath());
AjaxResult ajax = AjaxResult.success();
ajax.put("url", https);
return ajax;
}
}

@ -0,0 +1,20 @@
package com.ruoyi.tcZz.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author du
* @since 2024/1/17 18:22
*/
@Data
@ApiModel("http实体类")
public class httpsRequest {
/**
* url
*/
@ApiModelProperty(value = "url地址")
private String urls;
}

@ -110,7 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.antMatchers("/login", "/register", "/captchaImage").permitAll()
// 静态资源,可匿名访问
.antMatchers(HttpMethod.GET, "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**",
.antMatchers(HttpMethod.GET,"/tcZz/networkEcology/getHttp", "/", "/*.html", "/**/*.html", "/**/*.css", "/**/*.js", "/profile/**",
"/tcZz/netWorkYq/yqzs/ListNoToken", "/tcZz/netWorkYq/cy/ListNoToken",
"/tcZz/networkSecurity/cybersecurity/ListNoToken", "/tcZz/networkSecurity/cybersecurity/ListNoToken",
"/tcZz/networkSecurity/jgdw/ListNoToken",

Loading…
Cancel
Save