Skip to content

Commit b05789f

Browse files
committed
feat: 增加cnzz统计
1 parent 9681cd5 commit b05789f

File tree

8 files changed

+114
-35
lines changed

8 files changed

+114
-35
lines changed

components/Affiche.vue

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
2-
<el-carousel
2+
<div class="affiche" v-if="show">
3+
<el-carousel
34
height="30px"
45
direction="vertical"
56
indicator-position="none"
6-
class="affiche"
77
:setActiveItem="carouselActive"
88
>
99
<el-carousel-item>
@@ -32,16 +32,34 @@
3232
</p>
3333
</el-carousel-item>
3434
</el-carousel>
35+
<i class="el-icon-close" @click="show=false"></i>
36+
</div>
3537
</template>
3638

3739
<script>
38-
export default {};
40+
export default {
41+
data() {
42+
return {
43+
show: true
44+
}
45+
}
46+
};
3947
</script>
4048

4149
<style lang="scss" scoped>
4250
.affiche {
4351
width: 100%;
4452
font-size: 14px;
53+
background: #fff;
54+
border-radius: 5px;
55+
padding: 5px 15px;
56+
display: flex;
57+
align-items: center;
58+
i {
59+
font-size: 18px;
60+
font-weight: bold;
61+
cursor: pointer;
62+
}
4563
.el-carousel {
4664
flex: 1;
4765
}

components/WebsiteItem.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export default {
100100
box-shadow: 1px 2px 3px 7px 13px 11px 9px #f2f6f8;
101101
border-radius: 6px;
102102
background: #fff;
103+
cursor: pointer;
103104
}
104105
105106
a {

layouts/user-layout.vue

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -50,24 +50,23 @@
5050
</el-menu>
5151
</el-col>
5252
</el-row>
53-
<div class="arrow">
54-
<i
55-
@click="isCollapse = true"
56-
class="el-icon-d-arrow-left"
57-
v-if="!isCollapse"
58-
></i>
59-
<i
60-
@click="isCollapse = false"
61-
class="el-icon-d-arrow-right"
62-
v-else
63-
></i>
64-
</div>
6553
</slot>
6654
</el-aside>
6755
<el-container class="body" :style="{ marginLeft: sideBarWidth }">
6856
<el-header>
6957
<slot name="header">
70-
<Affiche />
58+
<div class="arrow">
59+
<i
60+
@click="isCollapse = true"
61+
class="el-icon-s-fold"
62+
v-if="!isCollapse"
63+
></i>
64+
<i
65+
@click="isCollapse = false"
66+
class="el-icon-s-unfold"
67+
v-else
68+
></i>
69+
</div>
7170
<el-button icon="el-icon-plus" @click="dialogFormVisible = true"
7271
>添加网站</el-button
7372
>
@@ -89,11 +88,9 @@
8988
</template>
9089

9190
<script>
92-
import Affiche from "~/components/Affiche";
9391
import AddNavPopup from "~/components/AddNavPopup";
9492
export default {
9593
components: {
96-
Affiche,
9794
AddNavPopup
9895
},
9996
props: {
@@ -167,6 +164,14 @@ $sidebar-w: auto;
167164
top: 0;
168165
z-index: 10;
169166
box-shadow: 0px 1px 6px rgba(142, 142, 142, 0.1);
167+
.arrow {
168+
flex: 1;
169+
cursor: pointer;
170+
}
171+
.arrow i {
172+
color: #999;
173+
font-size: 24px;
174+
}
170175
}
171176
172177
.body {
@@ -185,20 +190,11 @@ $sidebar-w: auto;
185190
left: 0;
186191
overflow: visible;
187192
bottom: 0;
188-
.arrow {
189-
padding: 20px 0;
190-
font-size: 14px;
191-
margin-left: -10px;
192-
}
193+
193194
.el-menu--collapse {
194195
border: 0;
195196
}
196197
197-
i,
198-
.icon-title {
199-
color: #fff;
200-
}
201-
202198
&.aside-hide {
203199
transform: translateX(-$sidebar-w);
204200
}
@@ -235,15 +231,14 @@ $sidebar-w: auto;
235231
236232
@media screen and (max-width: 568px) {
237233
.user-layout {
238-
.arrow,
239-
.affiche {
234+
.arrow {
240235
display: none;
241236
}
242237
}
243238
}
244239
@media screen and (min-width: 569px) {
245240
.user-layout {
246-
.affiche {
241+
.arrow {
247242
display: block;
248243
}
249244
}

navigation.code-workspace

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"folders": [
3+
{
4+
"path": "."
5+
},
6+
{
7+
"path": "../geek-navigation-serve"
8+
}
9+
],
10+
"settings": {
11+
"git.ignoreLimitWarning": true
12+
}
13+
}

nuxt.config.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,11 @@ module.exports = {
44
mode: 'universal',
55
telemetry: false,
66
env: {
7-
baseUrl: process.env.root || 'http://localhost:3000',
7+
baseUrl: process.env.root,
88
mongoUrl: 'mongodb://127.0.0.1:27017/navigation',
99
secretKey: 'xiaobing_19960412_jwttoken',
1010
},
11+
server: {},
1112
/*`
1213
** Headers of the page
1314
*/
@@ -21,10 +22,10 @@ module.exports = {
2122
],
2223
link: [
2324
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
24-
{ rel: 'stylesheet', href: '//at.alicdn.com/t/font_552690_1dhs8z79zur.css' }
25+
{ rel: 'stylesheet', href: '//at.alicdn.com/t/font_552690_njqotmfk5k.css' }
2526
],
2627
script: [
27-
{src: '//v1.cnzz.com/z_stat.php?id=1279139494&web_id=1279139494', defer: 'defer'}
28+
{ src: '//v1.cnzz.com/z_stat.php?id=1279139494&web_id=1279139494', defer: 'defer' }
2829
],
2930
},
3031
/*

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"generate": "nuxt generate"
1313
},
1414
"dependencies": {
15+
"@nuxtjs/axios": "^5.12.2",
1516
"@nuxtjs/style-resources": "^1.0.0",
1617
"axios": "^0.19.2",
1718
"body-parser": "^1.19.0",
@@ -24,6 +25,7 @@
2425
"element-ui": "^2.4.11",
2526
"express": "^4.16.4",
2627
"express-jwt": "5.3.1",
28+
"https": "^1.0.0",
2729
"mongoose": "^5.9.24",
2830
"nuxt": "^2.0.0",
2931
"request": "^2.88.2"

pages/index.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@click="findNav($event.index)"
55
@handleSubMenuClick="handleSubMenuClick"
66
>
7+
<Affiche />
78
<section class="main" v-loading="loading">
89
<div class="website-wrapper" v-for="item in data" :key="item.name">
910
<p class="website-title" :id="item._id">{{ item.name }}</p>
@@ -19,11 +20,14 @@
1920
import WebsiteList from "~/components/WebsiteList";
2021
import Toolbar from "~/components/Toolbar";
2122
import userLayout from "~/layouts/user-layout";
23+
import Affiche from "~/components/Affiche";
24+
2225
import axios from "~/plugins/axios";
2326
import api from "~/api";
2427
export default {
2528
components: {
2629
userLayout,
30+
Affiche,
2731
WebsiteList,
2832
Toolbar,
2933
},

yarn.lock

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,17 @@
11551155
webpack-node-externals "^1.7.2"
11561156
webpackbar "^4.0.0"
11571157

1158+
"@nuxtjs/axios@^5.12.2":
1159+
version "5.12.2"
1160+
resolved "https://registry.npmjs.org/@nuxtjs/axios/-/axios-5.12.2.tgz#ff0d15ba5d3442dcbd12245f864effec3bea3cde"
1161+
integrity sha512-MKSuwHRgLTw1tMS1mDf+7XIvQLvF8GlK3rtuJY4lNmZVxYiBYhG3Nd6OrtH07fljNmvL7/JIUzk+1o/tVS6Pkg==
1162+
dependencies:
1163+
"@nuxtjs/proxy" "^2.0.1"
1164+
axios "^0.20.0"
1165+
axios-retry "^3.1.8"
1166+
consola "^2.15.0"
1167+
defu "^3.1.0"
1168+
11581169
"@nuxtjs/proxy@^2.0.1":
11591170
version "2.0.1"
11601171
resolved "https://registry.npmjs.org/@nuxtjs/proxy/-/proxy-2.0.1.tgz#2469b6e316311aa8c60d348502a54bfe6d5536aa"
@@ -1878,13 +1889,27 @@ aws4@^1.8.0:
18781889
resolved "https://registry.npmjs.org/aws4/-/aws4-1.10.0.tgz#a17b3a8ea811060e74d47d306122400ad4497ae2"
18791890
integrity sha512-3YDiu347mtVtjpyV3u5kVqQLP242c06zwDOgpeRnybmXlYYsLbtTrUBUm8i8srONt+FWobl5aibnU1030PeeuA==
18801891

1892+
axios-retry@^3.1.8:
1893+
version "3.1.8"
1894+
resolved "https://registry.npmjs.org/axios-retry/-/axios-retry-3.1.8.tgz#ffcfed757e1fab8cbf832f8505bb0e0af47c520c"
1895+
integrity sha512-yPw5Y4Bg6Dgmhm35KaJFtlh23s1TecW0HsUerK4/IS1UKl0gtN2aJqdEKtVomiOS/bDo5w4P3sqgki/M10eF8Q==
1896+
dependencies:
1897+
is-retry-allowed "^1.1.0"
1898+
18811899
axios@^0.19.2:
18821900
version "0.19.2"
18831901
resolved "https://registry.npmjs.org/axios/-/axios-0.19.2.tgz#3ea36c5d8818d0d5f8a8a97a6d36b86cdc00cb27"
18841902
integrity sha512-fjgm5MvRHLhx+osE2xoekY70AhARk3a6hkN+3Io1jc00jtquGvxYlKlsFUhmUET0V5te6CcZI7lcv2Ym61mjHA==
18851903
dependencies:
18861904
follow-redirects "1.5.10"
18871905

1906+
axios@^0.20.0:
1907+
version "0.20.0"
1908+
resolved "https://registry.npmjs.org/axios/-/axios-0.20.0.tgz#057ba30f04884694993a8cd07fa394cff11c50bd"
1909+
integrity sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==
1910+
dependencies:
1911+
follow-redirects "^1.10.0"
1912+
18881913
babel-eslint@^10.0.2:
18891914
version "10.1.0"
18901915
resolved "https://registry.npmjs.org/babel-eslint/-/babel-eslint-10.1.0.tgz#6968e568a910b78fb3779cdd8b6ac2f479943232"
@@ -2791,6 +2816,11 @@ consola@^2.10.0, consola@^2.10.1, consola@^2.11.3, consola@^2.14.0, consola@^2.4
27912816
resolved "https://registry.npmjs.org/consola/-/consola-2.14.0.tgz#162ee903b6c9c4de25077d93f34ab902ebcb4dac"
27922817
integrity sha512-A2j1x4u8d6SIVikhZROfpFJxQZie+cZOfQMyI/tu2+hWXe8iAv7R6FW6s6x04/7zBCst94lPddztot/d6GJiuQ==
27932818

2819+
consola@^2.15.0:
2820+
version "2.15.0"
2821+
resolved "https://registry.npmjs.org/consola/-/consola-2.15.0.tgz#40fc4eefa4d2f8ef2e2806147f056ea207fcc0e9"
2822+
integrity sha512-vlcSGgdYS26mPf7qNi+dCisbhiyDnrN1zaRbw3CSuc2wGOMEGGPsp46PdRG5gqXwgtJfjxDkxRNAgRPr1B77vQ==
2823+
27942824
console-browserify@^1.1.0:
27952825
version "1.2.0"
27962826
resolved "https://registry.npmjs.org/console-browserify/-/console-browserify-1.2.0.tgz#67063cef57ceb6cf4993a2ab3a55840ae8c49336"
@@ -3347,6 +3377,11 @@ defu@^2.0.4:
33473377
resolved "https://registry.npmjs.org/defu/-/defu-2.0.4.tgz#09659a6e87a8fd7178be13bd43e9357ebf6d1c46"
33483378
integrity sha512-G9pEH1UUMxShy6syWk01VQSRVs3CDWtlxtZu7A+NyqjxaCA4gSlWAKDBx6QiUEKezqS8+DUlXLI14Fp05Hmpwg==
33493379

3380+
defu@^3.1.0:
3381+
version "3.1.0"
3382+
resolved "https://registry.npmjs.org/defu/-/defu-3.1.0.tgz#a6b5104cacc06aa1efa01923becddbedd32505e8"
3383+
integrity sha512-pc7vS4wbYFtsRL+OaLHKD72VcpOz9eYgzZeoLz9pCs+R8htyPdZnD1CxKP9ttZuT90CLPYFTSaTyc3/7v4gG9A==
3384+
33503385
delayed-stream@~1.0.0:
33513386
version "1.0.0"
33523387
resolved "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
@@ -4086,6 +4121,11 @@ follow-redirects@^1.0.0:
40864121
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.12.1.tgz#de54a6205311b93d60398ebc01cf7015682312b6"
40874122
integrity sha512-tmRv0AVuR7ZyouUHLeNSiO6pqulF7dYa3s19c6t+wz9LD69/uSzdMxJ2S91nTI9U3rt/IldxpzMOFejp6f0hjg==
40884123

4124+
follow-redirects@^1.10.0:
4125+
version "1.13.0"
4126+
resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz#b42e8d93a2a7eea5ed88633676d6597bc8e384db"
4127+
integrity sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==
4128+
40894129
for-in@^1.0.2:
40904130
version "1.0.2"
40914131
resolved "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
@@ -4708,6 +4748,11 @@ https-browserify@^1.0.0:
47084748
resolved "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73"
47094749
integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=
47104750

4751+
https@^1.0.0:
4752+
version "1.0.0"
4753+
resolved "https://registry.npmjs.org/https/-/https-1.0.0.tgz#3c37c7ae1a8eeb966904a2ad1e975a194b7ed3a4"
4754+
integrity sha1-PDfHrhqO65ZpBKKtHpdaGUt+06Q=
4755+
47114756
human-signals@^1.1.1:
47124757
version "1.1.1"
47134758
resolved "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
@@ -5153,7 +5198,7 @@ is-resolvable@^1.0.0:
51535198
resolved "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz#fb18f87ce1feb925169c9a407c19318a3206ed88"
51545199
integrity sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==
51555200

5156-
is-retry-allowed@^1.0.0:
5201+
is-retry-allowed@^1.0.0, is-retry-allowed@^1.1.0:
51575202
version "1.2.0"
51585203
resolved "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz#d778488bd0a4666a3be8a1482b9f2baafedea8b4"
51595204
integrity sha512-RUbUeKwvm3XG2VYamhJL1xFktgjvPzL0Hq8C+6yrWIswDy3BIXGqCxhxkc30N9jqK311gVU137K8Ei55/zVJRg==

0 commit comments

Comments
 (0)