From 7894d4c3a4c939774dfdbd3bb1bcaa2599d28c48 Mon Sep 17 00:00:00 2001 From: ronger Date: Sun, 30 Oct 2022 16:56:15 +0800 Subject: [PATCH 1/3] =?UTF-8?q?:art:=20=E5=A2=9E=E5=8A=A0=20axios=20?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E8=AF=B7=E6=B1=82=E5=8F=96=E6=B6=88=E6=9C=BA?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/layouts/pc/main.vue | 2 +- pages/admin.vue | 59 ++++++------------- pages/admin/articles.vue | 3 - pages/admin/bank-accounts.vue | 3 - pages/admin/banks.vue | 3 - pages/admin/comments.vue | 3 - pages/admin/currency-rules.vue | 3 - pages/admin/dashboard.vue | 8 ++- pages/admin/products.vue | 3 - pages/admin/tag/post/_tag_id.vue | 2 - pages/admin/tags.vue | 3 - pages/admin/topic/post/_topic_id.vue | 2 - pages/admin/topics.vue | 3 - pages/admin/users.vue | 3 - pages/answer.vue | 3 +- pages/article/post/_article_id.vue | 3 +- pages/draft/_draft_id.vue | 3 +- pages/index.vue | 6 +- pages/open-data.vue | 7 ++- pages/portfolio/_portfolio_id.vue | 12 ++-- pages/portfolio/manager/_portfolio_id.vue | 3 +- .../portfolio/manager/bind/_portfolio_id.vue | 3 +- pages/portfolios.vue | 6 +- pages/product/_product_id.vue | 3 +- pages/products.vue | 6 +- pages/rules/currency.vue | 3 +- pages/topic/_topic_uri.vue | 10 ++-- plugins/axios.js | 55 +++++++++++++++-- 28 files changed, 116 insertions(+), 107 deletions(-) diff --git a/components/layouts/pc/main.vue b/components/layouts/pc/main.vue index 15b4d23..38ba69f 100644 --- a/components/layouts/pc/main.vue +++ b/components/layouts/pc/main.vue @@ -4,7 +4,7 @@ - + diff --git a/pages/admin.vue b/pages/admin.vue index e968c88..e06a58a 100644 --- a/pages/admin.vue +++ b/pages/admin.vue @@ -3,7 +3,7 @@ @@ -28,7 +34,8 @@ import Records from "../components/common/bank/account/records"; export default { name: "wallet", components: {Records}, - fetch({store, error}) { + fetch() { + let {store, error} = this.$nuxt.context return Promise.all([ store .dispatch('wallet/fetchDetail') @@ -45,8 +52,7 @@ export default { }) }, data() { - return { - } + return {} }, methods: { handleCurrentChange(search) { @@ -67,6 +73,14 @@ export default { startDate: startDate, endDate: endDate }) + }, + createBankAccount() { + let _ts = this + _ts.$axios.$post('/api/wallet/create').then(function (res) { + if (res) { + _ts.$fetch() + } + }) } }, mounted() { @@ -80,4 +94,8 @@ export default { font-size: 32px; padding-left: 15vw; } +code { + color: red; + font-weight: bold; +}