|
@@ -18,6 +18,8 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import java.io.File;
|
|
|
import java.io.IOException;
|
|
|
+import java.net.InetAddress;
|
|
|
+import java.net.UnknownHostException;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.Date;
|
|
@@ -265,15 +267,16 @@ public class NoticeManagementController {
|
|
|
* @return 结果
|
|
|
*/
|
|
|
@GetMapping(value = "/filePreview")
|
|
|
- public R convertToHtml(@RequestParam("url") String url) {
|
|
|
+ public R convertToHtml(@RequestParam("url") String url) throws UnknownHostException {
|
|
|
String os = System.getProperty("os.name");
|
|
|
String ip = "";
|
|
|
if (os.toLowerCase().startsWith("win")) {
|
|
|
- ip = "192.168.2.10";
|
|
|
+ InetAddress localHost = InetAddress.getLocalHost();
|
|
|
+ ip = localHost.getHostAddress();
|
|
|
} else {
|
|
|
ip = "10.65.78.23";
|
|
|
}
|
|
|
- String httpUrl = "http://" + ip + ":8098/office/" + url;
|
|
|
+ String httpUrl = "http://" + ip + ":8098/file/" + url;
|
|
|
return R.ok().data(httpUrl);
|
|
|
}
|
|
|
}
|