修改 wiki view 显示

This commit is contained in:
simple321vip
2023-02-04 22:57:10 +08:00
parent 0e5e35057b
commit 86f63ff973
7 changed files with 51 additions and 16 deletions
+16 -3
View File
@@ -1,10 +1,10 @@
<template>
<div>
<el-container>
<div class="homeWrap">
<el-container class="main_container">
<el-aside width="180px">
<SideBar></SideBar>
</el-aside>
<el-container>
<el-container style="margin-left: 180px;">
<el-header>
<NavBar></NavBar>
</el-header>
@@ -83,11 +83,13 @@ iniPage()
.el-main {
padding: 16px;
overflow: hidden;
height: 100%;
}
.el-aside {
margin-left: -10px;
background: #191a23;
position: fixed;
}
.el-footer {
@@ -95,4 +97,15 @@ iniPage()
display: flex;
justify-content: space-around;
}
.main_container {
/* height: 100%; */
}
.homeWrap {
position: absolute;
top: 0;
height: 100%;
width: 100%;
}
</style>
+10 -4
View File
@@ -4,10 +4,11 @@ import { getToken, getTenant } from './utils/auth'
import { Tenant } from './entity/index'
import { tenantStore } from './store/modules/tenant'
const whiteList = ['/login', '/register', '/sorryPage']
const whiteList = ['/login', '/register', '/sorryPage', '/BlogViewer']
let url = window.location.href
router.beforeEach((to, from, next) => {
console.log(to.path)
const token = getToken()
@@ -20,13 +21,16 @@ router.beforeEach((to, from, next) => {
const tenant = <Tenant>(JSON.parse(getTenant() as string))
if (url.search("write") != -1) {
next('/BlogEditer')
} else if (url.search("view") != -1) {
let bid = Cookies.get('bid')
}
if (url.search("view") != -1) {
let arr = url.split('?')
let bid = arr[1].split('=')[1]
router.push({
path: '/BlogViewer',
query: { bid: bid }
})
} else {
}
else {
router.push({
path: '/home',
query: tenant
@@ -75,6 +79,7 @@ router.beforeEach((to, from, next) => {
window.open(href, '_self');
})
}
if (url.search("sorryPage") != -1) {
router.push({
path: '/sorryPage',
@@ -86,4 +91,5 @@ router.beforeEach((to, from, next) => {
next('/login')
}
}
})
+2 -4
View File
@@ -34,8 +34,8 @@
<h3 style="cursor: pointer; width: min-content;white-space:nowrap" @click="openBlog(item.bid)">{{ item.title }}</h3>
<div style="display: flex; justify-content: space-between; align-items: center">
<p style="font-size: 12px; height: 16px;line-height: 16px;overflow: hidden;text-overflow: ellipsis;">{{
item.content
}}</p>
item.content
}}</p>
<el-button size="small" type="success" @click="publishbyBid(item.bid)">重新发布
</el-button>
</div>
@@ -91,8 +91,6 @@ const onSubmit = () => {
}
const openBlog = (bid: string) => {
Cookies.set('bid', bid)
const { href } = router.resolve({
path: '/view',
query: {
+4
View File
@@ -1,4 +1,5 @@
<template>
<h2>{{ title }}</h2>
<md-editor v-model="text" previewOnly />
</template>
@@ -9,16 +10,19 @@ import { ref } from 'vue';
import { useRoute } from 'vue-router'
import { getBlog } from '../../api/blogView'
let text = ref<string>('')
let title = ref<string>('')
const route = useRoute()
const params = route.query
const init = () => {
getBlog(params.bid as string).then(response => {
text.value = response.data.content
title.value = response.data.title
})
}
init()
</script>
<style>
</style>