From e3898caa56109a29f94e4dabc7db421a5bd4b730 Mon Sep 17 00:00:00 2001
From: xuxy <1059738716@qq.com>
Date: 星期一, 15 七月 2024 00:14:27 +0800
Subject: [PATCH] update fix bug
---
mixin/mixin.js | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/mixin/mixin.js b/mixin/mixin.js
index 7459a6f..0435a8b 100644
--- a/mixin/mixin.js
+++ b/mixin/mixin.js
@@ -13,7 +13,7 @@
return state.hasLogin || false
},
selftype: state => {
- return state.type || ''
+ return (state.currentInfo || {}).type || ''
},
currentInfo: state => {
return state.currentInfo || {}
@@ -255,13 +255,21 @@
}
return true
},
- async getList() {
+ async refreshList(){
+ this.page.current = 1
+ await this.getList()
+ },
+ async getList(type='get') {
if (this.listApi) {
this.$message.showLoading()
const {
data
- } = await this.$http.request('get', this.listApi, {
+ } = await this.$http.request(type, this.listApi, {
params: {
+ ...this.query,
+ ...this.page
+ },
+ data:{
...this.query,
...this.page
}
@@ -288,10 +296,10 @@
}
},
- async getMore() {
+ async getMore(type='get') {
if (this.page.total > this.page.current * this.page.size) {
this.page.current += 1
- await this.getList()
+ await this.getList(type)
}
},
backHome() {
--
Gitblit v1.9.3