修改 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
+1 -1
View File
@@ -5,7 +5,7 @@
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>violin-home-manage</title>
<title>violin-home</title>
</head>
<body>
+14
View File
@@ -25,6 +25,20 @@ export default [
]
}
},
{
url: '/wiki/api/v1/reader/blog/string',
method: 'get',
response: () => {
return {
bid: "1",
btId: "2",
btName: "3",
title: "1.2 java neicun",
blog_prex: "5",
content: "关键字volatile是java虚拟机提供的最轻量级的同步机制。\n当一个变量被定义为volatile时,它具备两种特性。\n第一种是**可见性**。\n即每次get时,强制刷新。\n一个误解区,字节码就是原子操作,这是不对的,一个字节码指令在解释执行时,如果是编译执行,一条字节码会有可能被转化为若干个本地机器指令。此处,用-XX:+PrintAssembly参数输出反汇编来分析。\n\n第二种是,**有序性**。\n即,禁止指令重排序(Instruction Recorder)优化。\n被volatile修饰的变量,赋值后会多执行一个\"lock addl\"操作,这个操作相当于一个memory barrier(内存屏障),指令重拍时,不能把后面的指令排序到内存屏障前面去,只有一个处理器访问时,不需要内存屏障。\naddl 是一个空操作,(把ESP寄存器的值 + 0),这个操作相当于把缓存中的变量做了一次store和write操作。\nlock iddl指令把修改同步到内存时,意味着所有的之前的操作都已完成,便形成了指令重排序无法穿越内存屏障的效果。\n针对于long和double的类型变量,不通虚拟机是有着不同的实现,此处不做描述。\n",
}
}
},
{
url: '/wiki/api/v1/reader/blog_type',
method: 'get',
+4 -4
View File
@@ -7,14 +7,14 @@ export default [
response: () => {
return [
{
date: '2023-01-09',
event_date: '2023-01-09',
title: '春游',
eventInfo: '春节不觉晓,处处闻啼鸟,夜来风雨声,花落知多少',
event_info: '春节不觉晓,处处闻啼鸟,夜来风雨声,花落知多少',
},
{
date: '2023-01-30',
event_date: '2023-01-30',
title: '月底发工资',
eventInfo: '发了工资少一半,还了信用卡再少一半,试问如何攒下钱,只有两个字:做梦',
event_info: '发了工资少一半,还了信用卡再少一半,试问如何攒下钱,只有两个字:做梦',
}
]
}
+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>