Commit c8c08bda by yanju

博客发布页添加心跳

parent 9c52c6d7
......@@ -54,6 +54,7 @@ export default {
active:'/api/user/actives',//活跃用户
repliers:'/api/user/hotRepliers',//热门答主
logout:'/api/user/logout',//注销登录
keepAlive:'/api/user/keepAlive',//心跳接口
},
......
......@@ -169,6 +169,15 @@ export default {
};
}
},
created(){
this.keepAlive()
},
destroyed() {
this.keepAliveTimer = null;
},
mounted() {
if (this.$route.query.id) {
this.blogTitle = this.detailContent.blogTitle;
......@@ -198,6 +207,7 @@ export default {
components: {SelectCard, CardContainer},
data() {
return {
keepAliveTimer:null,
markdownOption: {
bold: true, // 粗体
italic: true, // 斜体
......@@ -250,6 +260,13 @@ export default {
}
},
methods: {
keepAlive(){
this.keepAliveTimer = setInterval(()=>{
this.$axios.$get(config.api.get.User.keepAlive).then((response)=>{
})
},10000)
},
preview() {
this.$nextTick(() => {
// this.$refs.content.readmodel();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment