@ -0,0 +1,13 @@ |
|||
import request from '@/utils/request'; |
|||
import {getToken} from "@/utils/auth"; |
|||
|
|||
export function getBaoGaoInfo(params) { |
|||
return request({ |
|||
url: '/baoGao/getBaoGaoInfo', |
|||
method: 'post', |
|||
data:params, |
|||
headers: { |
|||
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
|
|||
} |
|||
}) |
|||
} |
|||
|
After Width: | Height: | Size: 69 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 1.0 KiB |
|
After Width: | Height: | Size: 882 B |
|
After Width: | Height: | Size: 1.7 KiB |
|
After Width: | Height: | Size: 91 KiB |
@ -0,0 +1,36 @@ |
|||
<template> |
|||
<div style="width: 100%;height: 8.8%;"> |
|||
<img src="../assets/img/head.png" style="width: 100%;object-fit: contain;"> |
|||
<div style="width: 5vw;height: 1.5vw;background-color: #3967a4;text-align: center;font-size: 0.9vw;color: white;box-shadow: 0px 0px 10px #69cbff inset; |
|||
line-height: 1.5vw;position: absolute;top: 2.5vw;right: 2.6vw;" @click="log()">退出登录</div> |
|||
</div> |
|||
|
|||
</template> |
|||
<script> |
|||
|
|||
export default { |
|||
// eslint-disable-next-line vue/multi-word-component-names |
|||
name: 'headMulu', |
|||
data() { |
|||
return{ |
|||
|
|||
} |
|||
|
|||
}, |
|||
methods:{ |
|||
log(){ |
|||
localStorage.clear(); |
|||
this.$router.push('/') |
|||
}, |
|||
goMulu(){ |
|||
this.$router.push('/Mulu') |
|||
} |
|||
}, |
|||
mounted() { |
|||
|
|||
} |
|||
} |
|||
</script> |
|||
<style scoped> |
|||
|
|||
</style> |
|||
@ -0,0 +1,281 @@ |
|||
package com.main.woka.Web.Controller; |
|||
|
|||
import com.main.woka.Web.Dao.KcInfo; |
|||
import com.main.woka.Web.Mapper.KcFileMapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
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.BufferedReader; |
|||
import java.io.File; |
|||
import java.io.FileInputStream; |
|||
import java.io.InputStreamReader; |
|||
import java.util.*; |
|||
|
|||
@RestController |
|||
@RequestMapping("/baoGao") |
|||
public class BaoGaoController extends BaseController{ |
|||
|
|||
@Autowired |
|||
KcFileMapper kcFileMapper; |
|||
|
|||
@PostMapping(value = "/getBaoGaoInfo") |
|||
public String getBaoGaoInfo(@RequestBody Map<String,String> requestBody){ |
|||
|
|||
String one = requestBody.get("one"); |
|||
String two = requestBody.get("two"); |
|||
String three = requestBody.get("three"); |
|||
String four = requestBody.get("four"); |
|||
String five = requestBody.get("five"); |
|||
String six = requestBody.get("six"); |
|||
String seven = requestBody.get("seven"); |
|||
|
|||
|
|||
|
|||
String contentInfo = ""; |
|||
if(one!=null && !one.equals("")){ |
|||
if(one.contains(",")){ |
|||
String[] ids = one.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(one)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
if(two!=null && !two.equals("")){ |
|||
if(two.contains(",")){ |
|||
String[] ids = two.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(two)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
if(three!=null && !three.equals("")){ |
|||
if(three.contains(",")){ |
|||
String[] ids = three.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(three)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
if(four!=null && !four.equals("")){ |
|||
if(four.contains(",")){ |
|||
String[] ids = four.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(four)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
if(five!=null && !five.equals("")){ |
|||
if(five.contains(",")){ |
|||
String[] ids = five.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(five)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
|
|||
if(six!=null && !six.equals("")){ |
|||
if(six.contains(",")){ |
|||
String[] ids = six.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(six)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
if(seven!=null && !seven.equals("")){ |
|||
if(seven.contains(",")){ |
|||
String[] ids = seven.split(","); |
|||
for(int a=0;a<ids.length;a++){ |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(ids[a])); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
}else { |
|||
KcInfo kk = kcFileMapper.selectDocByIdId(Long.valueOf(seven)); |
|||
String url = kk.getTwUrl(); |
|||
File file = new File(url); |
|||
String content = txt2String(file); |
|||
if(contentInfo==""){ |
|||
contentInfo = "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
}else { |
|||
contentInfo = contentInfo+ "<p>"+kk.getName()+"</p>"+"<p>"+content+"</p>"; |
|||
} |
|||
} |
|||
} |
|||
|
|||
|
|||
contentInfo = contentInfo.replaceAll("img","img style='width:60%;height:auto;object-fit: contain;'"); |
|||
|
|||
//一层一层查询这个关系
|
|||
// if(one!=null && !one.equals("")){
|
|||
// if(one.contains(",")){
|
|||
// String[] ids = one.split(",");
|
|||
// for()
|
|||
// List<KcInfo> listone = kcFileMapper.getOneHeader(Long.valueOf(ids));
|
|||
//
|
|||
// }else {
|
|||
//
|
|||
// List<KcInfo> listone = kcFileMapper.getOneHeader(Long.valueOf(one));
|
|||
//
|
|||
// }
|
|||
//
|
|||
//
|
|||
// }
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
return contentInfo; |
|||
} |
|||
|
|||
|
|||
public static String txt2String(File file) { |
|||
StringBuilder result = new StringBuilder(); |
|||
try { |
|||
// 构造一个BufferedReader类来读取文件
|
|||
BufferedReader br = new BufferedReader(new InputStreamReader(new FileInputStream(file))); |
|||
// BufferedReader br = new BufferedReader(new FileReader(file));
|
|||
String s = null; |
|||
// 使用readLine方法,一次读一行
|
|||
while ((s = br.readLine()) != null) { |
|||
result.append(System.lineSeparator() + s); |
|||
} |
|||
br.close(); |
|||
} catch (Exception e) { |
|||
e.printStackTrace(); |
|||
} |
|||
return result.toString(); |
|||
} |
|||
|
|||
|
|||
|
|||
} |
|||