Browse Source

文章详情获取

zxm
zhangxiaomeng 1 year ago
parent
commit
b5ae69c4c5
  1. 4
      kcui/src/api/kcInfo.js
  2. BIN
      kcui/src/assets/img/leftBox1.png
  3. BIN
      kcui/src/assets/img/tt.png
  4. BIN
      kcui/src/assets/img/twbg.jpg
  5. 6
      kcui/src/router/router.js
  6. 66
      kcui/src/view/TWInfo.vue
  7. 2
      src/main/java/com/main/woka/Filter/TestFilter.java
  8. 3
      src/main/resources/application.properties

4
kcui/src/api/kcInfo.js

@ -12,11 +12,11 @@ export function getDocList(data) {
}
})
}
export function getTwInfo(id) {
export function getTwInfo(params) {
return request({
url: '/kcDoc/getTwInfo',
method: 'get',
id,
params,
headers: {
'Authorization': 'Bearer '+ getToken() // 将 token 放在请求头中
}

BIN
kcui/src/assets/img/leftBox1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

BIN
kcui/src/assets/img/tt.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

BIN
kcui/src/assets/img/twbg.jpg

Binary file not shown.

After

Width:  |  Height:  |  Size: 971 KiB

6
kcui/src/router/router.js

@ -5,6 +5,7 @@ import Home from '@/view/Graph.vue'
import Book from '@/view/Book.vue'
import Calculator from "@/view/Calculator.vue";
import TwInfo from '@/view/TWInfo.vue'
import TwInfoXq from '@/view/TWInfoXq.vue'
import Login from '@/view/Login.vue'
import Mulu from '@/view/Mulu.vue'
//2.调用vue.use() 函数,把 VueRouter 安装为 Vue 的插件
@ -44,5 +45,10 @@ export default new VueRouter({
name: 'TwInfo', //路由名称,
component: TwInfo //对应的组件模板
},
{ //每一个链接都是一个对象
path: '/TwInfoXq', //链接路径
name: 'TwInfoXq', //路由名称,
component: TwInfoXq //对应的组件模板
},
]
})

66
kcui/src/view/TWInfo.vue

@ -1,5 +1,6 @@
<template>
<div style="width: 100%;height: 100%;background-color: #00173a">
<div style="width: 100%;height: 100%;">
<img style="width: 100%;height: 100%;position: absolute;z-index:-1;" src="../assets/img/twbg.jpg">
<headInfo></headInfo>
<!-- 这是内容界面 -->
<div class="content">
@ -12,18 +13,18 @@
</div>
<div class="leftBox2">
<div class="muluBox">
<img src="../assets/img/leftBox.png" style="width: 100%;object-fit: contain;z-index: 1;position: absolute;">
<img src="../assets/img/leftBox1.png" style="width: 100%;object-fit: contain;z-index: 1;position: absolute;">
<div class="muluList">
<div v-for="item in mulu" :key="item" >
<div v-for="item in mulu" :key="item">
<div class="oneMulu" v-if="page!=item" @click="goInfo(item.info)">
<div style="width: 80%;text-align: center;">{{ item.name }}</div>
<img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 13%;">
</div>
<div class="oneMuluXuan" v-else >
<div style="width: 72%;text-align: center;" >{{ item.name }}</div>
<div class="oneMuluXuan" v-else>
<div style="width: 72%;text-align: center;">{{ item.name }}</div>
<img src="../assets/img/jiantou.png"
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;" >
style="width: 0.9vw;height:0.9vw;object-fit: contain;float: right;margin-top: 8%;">
</div>
</div>
</div>
@ -44,17 +45,19 @@
</div>
<div
style="width: 94%;height:3vw;position: absolute;z-index: 1;top: 4.9vw;left: 3%;background-color: #0c3068;box-shadow: 0px -9px 10px 0px rgb(75,230,255);"></div>
<div style="width: 94.4%;height: 2.9vw;position: absolute;z-index: 2;margin-left: 2.6%;top: 5vw;" v-if="this.userType==1">
<div style="width: 94.4%;height: 2.9vw;position: absolute;z-index: 2;margin-left: 2.6%;top: 5vw;"
v-if="this.userType==1">
<div
style="width: 100%;height: 100%;display: flex;flex-direction: row;line-height: 2.9vw;text-align: center;color: #ffffff;">
<div style="width: 10%;">序号</div>
<div style="width: 20%;">标题</div>
<div style="width: 60%;">图片</div>
<div style="width: 10%;">详情</div>
<div style="width: 10%;">操作</div>
<div style="width: 10%;">操作</div>
</div>
</div>
<div style="width: 94.4%;height: 2.9vw;position: absolute;z-index: 2;margin-left: 2.6%;top: 5vw;" v-if="this.userType==0">
<div style="width: 94.4%;height: 2.9vw;position: absolute;z-index: 2;margin-left: 2.6%;top: 5vw;"
v-if="this.userType==0">
<div
style="width: 100%;height: 100%;display: flex;flex-direction: row;line-height: 2.9vw;text-align: center;color: #ffffff;">
<div style="width: 10%;">序号</div>
@ -71,7 +74,7 @@
<div style="width: 8%;">{{ item.id }}</div>
<div style="width: 22%;">{{ item.name }}</div>
<div style="width: 60%;">图片</div>
<div style="width: 10%;text-decoration: underline;font-style: italic;">点击查看详情</div>
<div style="width: 10%;text-decoration: underline;font-style: italic;" @click="goXq(item.id)">点击查看详情</div>
</div>
</div>
<div class="rightListContent" v-if="this.userType==1">
@ -79,8 +82,9 @@
<div style="width: 8%;">{{ item.id }}</div>
<div style="width: 22%;">{{ item.name }}</div>
<div style="width: 60%;">图片</div>
<div style="width: 10%;text-decoration: underline;font-style: italic;">点击查看详情</div>
<div style="width: 9%;text-decoration: underline;font-style: italic;display: flex;justify-content: space-around;margin-left: 1%;">
<div style="width: 10%;text-decoration: underline;font-style: italic;" @click="goXq(item.id)">点击查看详情</div>
<div
style="width: 9%;text-decoration: underline;font-style: italic;display: flex;justify-content: space-around;margin-left: 1%;">
<div @click="editTw(item.id)">修改</div>
<div @click="deleteTw(item.id)">删除</div>
</div>
@ -117,7 +121,7 @@ export default {
data() {
return {
userName: "",
userType:0,
userType: 0,
mulu: [
{id: 0, name: "图文资源", info: "TwInfo"},
{id: 1, name: "视频资源", info: "SpInfo"},
@ -141,9 +145,9 @@ export default {
},
methods: {
goInfo(info){
goInfo(info) {
console.log(info)
this.$router.push('/'+info)
this.$router.push('/' + info)
},
changeType(item) {
this.twType = item;
@ -188,26 +192,34 @@ export default {
})
},
goXq(id) {
var data = {
id: id
}
getTwInfo(data).then((res) => {
this.$router.push({path: '/TwInfoXq', query: {id: id, level: res.data.level, type: "tw"}})
})
},
//
deleteTw(){
deleteTw() {
console.log("这是删除操作")
},
editTw(id){
editTw(id) {
//
var docId = id;
getTwInfo(docId).then((res)=>{
console.log(res);
var data = {
id: id
}
getTwInfo(data).then((res) => {
console.log(res.data)
})
console.log("这是修改操作")
}
},
mounted() {
this.userType = localStorage.getItem("type");
this.userName = localStorage.getItem("name");
this.userType = localStorage.getItem("type");
this.userName = localStorage.getItem("name");
this.getContentList();
}
}
@ -227,7 +239,7 @@ export default {
.leftBox1 {
width: 100%;
height: 10%;
margin-top: 12%;
margin-top: 10%;
color: #7cdeff;
}
@ -238,7 +250,7 @@ export default {
}
.muluBox {
margin: 3% 14%;
margin: 0% 14%;
height: 92%;
width: 72%;
position: relative;

2
src/main/java/com/main/woka/Filter/TestFilter.java

@ -49,7 +49,7 @@ public class TestFilter implements Filter {
response.setHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept, Origin, X-Requested-With"); // 确保包含 Content-Type
response.setHeader("Access-Control-Allow-Credentials", "true");
//校验重复提交
System.out.println("laile");
if(true){

3
src/main/resources/application.properties

@ -6,7 +6,8 @@
#spring.task.execution.shutdown.await-termination:是否等待剩余任务完成后才关闭应用
#spring.task.execution.shutdown.await-termination-period:等待剩余任务完成的最大时间
#spring.task.execution.thread-name-prefix:线程名的前缀,设置好了之后可以方便我们在日志中查看处理任务所在的线程池
spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB
spring.task.execution.pool.core-size=8
spring.task.execution.pool.max-size=20
spring.task.execution.pool.queue-capacity=20

Loading…
Cancel
Save