feat(frontend): optimize frontend interaction (#8)

Support auto refresh. Change authentication method. Streamline the frontend code.
This commit is contained in:
Li4n0
2021-04-25 22:15:56 +08:00
committed by GitHub
parent 50a6749070
commit 7e99d93e43
21 changed files with 347 additions and 232 deletions
+8 -3
View File
@@ -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,
}