文章页分页和搜索缓存

master
yujialong 3 months ago
parent 9ee415c399
commit f69230529e
  1. 7
      src/pages/article/add/index.vue
  2. 6
      src/pages/article/list/index.vue
  3. 2
      src/setting.js

@ -1275,7 +1275,12 @@ export default {
this.$post(this.api.updateArticle, form).then(res => { this.$post(this.api.updateArticle, form).then(res => {
this.updateFile(fileId, form, form.id) this.updateFile(fileId, form, form.id)
Util.successMsg('修改成功') Util.successMsg('修改成功')
next ? next() : this.$router.push(`list?columnId=` + form.columnId + (form.columnId != this.originColumnId ? '&last=1' : '')) // last if (next) {
next()
} else {
// last
form.columnId != this.originColumnId ? this.$router.push(`list?columnId=${form.columnId}&last=1`) : this.$router.back()
}
}).catch(err => { }).catch(err => {
this.submiting = false this.submiting = false
}) })

@ -139,9 +139,9 @@ export default {
name: '修改人' name: '修改人'
} }
], ],
keyword: '', keyword: this.$route.query.keyword || '',
list: [], list: [],
page: 1, page: +this.$route.query.page || 1,
pageSize: 10, pageSize: 10,
total: 0, total: 0,
modifiedTimeSort: '', modifiedTimeSort: '',
@ -263,7 +263,7 @@ export default {
// //
getData () { getData () {
const id = this.$refs.column.getCurrentKey() const id = this.$refs.column.getCurrentKey()
this.$router.push(`/article?columnId=${id}`).catch(e => { }) this.$router.push(`/article?columnId=${id}&page=${this.page}&keyword=${this.keyword || ''}`).catch(e => { })
const { keyword } = this const { keyword } = this
const data = { const data = {
siteId: this.$store.state.content.site.id, siteId: this.$store.state.content.site.id,

@ -4,7 +4,7 @@
const isDev = process.env.NODE_ENV === 'development' // 开发环境 const isDev = process.env.NODE_ENV === 'development' // 开发环境
let host = location.origin let host = location.origin
if (isDev) { if (isDev) {
host = 'https://huorantech.com' host = 'https://info.izhixinyun.com'
// host = 'http://192.168.31.217:10000' // host = 'http://192.168.31.217:10000'
} }

Loading…
Cancel
Save