mirror of
https://github.com/Li4n0/revsuit.git
synced 2026-09-25 16:11:53 +08:00
feat(frontend): optimize frontend interaction (#8)
Support auto refresh. Change authentication method. Streamline the frontend code.
This commit is contained in:
@@ -274,6 +274,7 @@ export default {
|
||||
name: 'HttpRules',
|
||||
data() {
|
||||
return {
|
||||
store,
|
||||
data: [],
|
||||
formVisible: false,
|
||||
pagination: {current: 1},
|
||||
@@ -341,18 +342,17 @@ export default {
|
||||
this.fetch();
|
||||
},
|
||||
fetch: function () {
|
||||
this.loading = true;
|
||||
let params = {
|
||||
...this.filters,
|
||||
page: this.pagination.current,
|
||||
order: this.order
|
||||
}
|
||||
this.loading = true;
|
||||
getHttpRule(params).then(res => {
|
||||
let result = res.data.result
|
||||
this.data = result.data
|
||||
const pagination = {...this.pagination};
|
||||
// Read total count from server
|
||||
// pagination.total = data.totalCount;
|
||||
|
||||
pagination.total = result.count;
|
||||
this.pagination = pagination;
|
||||
this.loading = false
|
||||
@@ -497,6 +497,11 @@ export default {
|
||||
mounted() {
|
||||
this.fetch({page: "1"});
|
||||
},
|
||||
watch: {
|
||||
'store.authed'() {
|
||||
this.fetch()
|
||||
}
|
||||
},
|
||||
components: {
|
||||
BasicRule,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user