Skip to content

Commit b8ff413

Browse files
author
zhongchubing
committed
fix: 前台缓存跳转问题
1 parent 794a069 commit b8ff413

File tree

5 files changed

+28
-37
lines changed

5 files changed

+28
-37
lines changed

geekape-nav-main/layouts/default.vue

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,26 @@
11
<template>
2-
<div>
2+
3+
<div :style="{ marginLeft: contentMarginLeft }">
4+
<AppNavMenus
5+
:categorys="category"
6+
:show-menu-type="showMenuType"
7+
@showMenus="toggleMenu2"
8+
/>
9+
<AppHeader
10+
@handleShowPopup="showPopup = true"
11+
@handleShowMenu="toggleMenu"
12+
/>
313
<nuxt />
414
</div>
515
</template>
616

717
<script>
818
9-
export default {
19+
import layoutMixin from "../mixins/layoutMixin";
20+
import navActionMixin from "../mixins/navActionMixin";
1021
22+
export default {
23+
mixins: [layoutMixin, navActionMixin],
1124
}
1225
</script>
1326

geekape-nav-main/nuxt.config.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ module.exports = {
107107
/*
108108
** 服务器端中间件--针对首页做缓存
109109
*/
110-
serverMiddleware: [
111-
{
112-
path: '/',
113-
handler: '~/plugins/pageCache.js',
114-
},
115-
]
110+
// serverMiddleware: [
111+
// {
112+
// path: '/',
113+
// handler: '~/plugins/pageCache.js',
114+
// },
115+
// ]
116116
}

geekape-nav-main/pages/index.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ import NavRankingList from "../components/NavRankingList";
4444
import Affiche from "../components/Affiche";
4545
export default {
4646
mixins: [layoutMixin],
47+
layout: 'second',
4748
components: {
4849
Affiche,
4950
NavRankingList,

geekape-nav-main/pages/nav/_id.vue

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
<template>
2-
<div :style="{ marginLeft: contentMarginLeft }">
3-
<AppNavMenus
4-
:categorys="category"
5-
:show-menu-type="showMenuType"
6-
@showMenus="toggleMenu2"
7-
/>
8-
<AppHeader
9-
@handleShowPopup="showPopup = true"
10-
@handleShowMenu="toggleMenu"
11-
/>
2+
<div>
123
<div class="background-fx">
134
<img src="https://nav.iowen.cn/wp-content/themes/onenav/images/fx/shape-01.svg" class="shape-01"> <img
145
src="https://nav.iowen.cn/wp-content/themes/onenav/images/fx/shape-02.svg" class="shape-02"> <img
@@ -114,9 +105,8 @@ import layoutMixin from "../../mixins/layoutMixin";
114105
import navActionMixin from "../../mixins/navActionMixin";
115106
116107
export default {
117-
mixins: [layoutMixin, navActionMixin],
118108
name: "NavDetail",
119-
layout: 'second',
109+
mixins: [navActionMixin],
120110
head() {
121111
const { name, desc } = this.detail
122112
return {

geekape-nav-main/pages/recommend.vue

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,6 @@
11
<template>
2-
<div :style="{ marginLeft: contentMarginLeft }">
3-
<AppNavMenus
4-
:categorys="category"
5-
:show-menu-type="showMenuType"
6-
@showMenus="toggleMenu2"
7-
/>
8-
<AppHeader
9-
@handleShowPopup="showPopup = true"
10-
@handleShowMenu="toggleMenu"
11-
/>
12-
13-
<div class="container">
14-
<el-card>
2+
<div class="container">
3+
<el-card>
154
<el-form ref="ruleForm" label-width="100px" :model="form" :rules="rules" v-loading="formLoading">
165

176
<el-form-item label="网站链接" prop="href">
@@ -79,18 +68,16 @@
7968
</el-form-item>
8069
</el-form>
8170
</el-card>
82-
</div>
8371
</div>
8472
</template>
8573

8674
<script>
8775
import layoutMixin from "../mixins/layoutMixin";
8876
import axios from "../plugins/axios";
89-
import {API_NAV_REPTILE, API_TAG_LIST} from "../api";
77+
import {API_NAV, API_NAV_REPTILE, API_TAG_LIST} from "../api";
9078
9179
export default {
9280
name: "recommend",
93-
mixins: [layoutMixin],
9481
data() {
9582
return {
9683
loading: false,
@@ -162,7 +149,7 @@ export default {
162149
this.loading = true
163150
// 判断编辑还是更新
164151
165-
const res = await this.$api.addNav(this.form)
152+
const res = await axios.post(API_NAV, this.form)
166153
if (res.code === 0) {
167154
this.$message.error(`${res.msg}`)
168155
} else {

0 commit comments

Comments
 (0)