diff --git a/components/Footer.vue b/components/Footer.vue index 1375ae5..9fa7c86 100644 --- a/components/Footer.vue +++ b/components/Footer.vue @@ -14,6 +14,8 @@
{{ this.nowTime }}
+
+
@@ -33,7 +35,38 @@ export default { }); return { toolNum: num, + visit: "", } + }, + mounted() { + this.cnt(); + }, + methods: { + cnt() { + let site = this.$store.state.env.url + this.$route.path; + this.$axios + .get('https://story.hhui.top/count/ncc?appKey=tool&referer=' + decodeURI(site)) + .then(e => { + let result = e.data; + console.log(result); + if (result.status.code === 200) { + result = result.result; + this.visit = '本站总访量: ' + result.appVO.hot + '  | 总访问人次: ' + result.appVO.uv + '  | 恭喜您为第 ' + result.appVO.rank + '  访问者'; + + let node = document.getElementById("tool_visit_count") + if (node) { + node.innerHTML = '当前工具访问次数:' + result.uriVO.hot; + } + } + }) + .catch(err => { + this.$swal({ + type: 'error', + title: '计数失败', + text: `ERROR: 获取数据失败,请刷新页面重试 ${err}` + }); + }); + }, } }; @@ -57,5 +90,11 @@ export default { margin: 4px; font-size: .8em; } + + + .visit_cnt { + color: #e96900; + font-size: 1.4em; + } } diff --git a/components/SideBar.vue b/components/SideBar.vue index 5cde938..cf944a6 100644 --- a/components/SideBar.vue +++ b/components/SideBar.vue @@ -5,6 +5,10 @@ :copy-icon="true"> + +
+ + diff --git a/pages/tools/editor/md.vue b/pages/tools/editor/md.vue index 7a5d610..f86f280 100644 --- a/pages/tools/editor/md.vue +++ b/pages/tools/editor/md.vue @@ -1,7 +1,7 @@