From c75f12a2b159db35af8fd28584020a9c9c25b1c3 Mon Sep 17 00:00:00 2001
From: Bunny <1319900154@qq.com>
Date: Sun, 29 Dec 2024 15:00:42 +0800
Subject: [PATCH] =?UTF-8?q?feat:=20=F0=9F=9A=80=20=E6=B7=BB=E5=8A=A0?=
=?UTF-8?q?=E6=9D=83=E9=99=90=E6=98=BE=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.env.development | 4 +-
build/data.js | 8 ++--
.../financial/account-bill/bill/index.vue | 30 +++++++++---
.../financial/account-bill/bill/utils/auth.ts | 12 +++++
.../financial/account-bill/category/index.vue | 26 +++++++---
.../account-bill/category/utils/auth.ts | 10 ++++
.../budget-saving/budget-category/index.vue | 34 ++++++++++---
.../budget-category/utils/auth.ts | 10 ++++
.../budget-saving/saving-goal/index.vue | 32 ++++++++++---
.../budget-saving/saving-goal/utils/auth.ts | 10 ++++
.../debt/debt-repayment-plan/index.vue | 48 +++++++++++++++----
.../debt/debt-repayment-plan/utils/auth.ts | 10 ++++
.../financial/debt/debt-tracking/index.vue | 32 ++++++++++---
.../debt/debt-tracking/utils/auth.ts | 10 ++++
src/views/i18n/i18n-setting/index.vue | 12 ++++-
15 files changed, 243 insertions(+), 45 deletions(-)
create mode 100644 src/views/financial/account-bill/bill/utils/auth.ts
create mode 100644 src/views/financial/account-bill/category/utils/auth.ts
create mode 100644 src/views/financial/budget-saving/budget-category/utils/auth.ts
create mode 100644 src/views/financial/budget-saving/saving-goal/utils/auth.ts
create mode 100644 src/views/financial/debt/debt-repayment-plan/utils/auth.ts
create mode 100644 src/views/financial/debt/debt-tracking/utils/auth.ts
diff --git a/.env.development b/.env.development
index c61e5b8..260865c 100644
--- a/.env.development
+++ b/.env.development
@@ -1,5 +1,5 @@
# 平台本地运行端口号
-VITE_PORT=1010
+VITE_PORT=1000
# 预发布环境路由历史模式(Hash模式传"hash"、HTML5模式传"h5"、Hash模式带base参数传"hash,base参数"、HTML5模式带base参数传"h5,base参数")
VITE_ROUTER_HISTORY="hash"
@@ -8,7 +8,7 @@ VITE_ROUTER_HISTORY="hash"
VITE_BASE_API=/api
# 跨域代理地址
-VITE_APP_URL=http://localhost:1000
+VITE_APP_URL=http://localhost:1010
# mock地址
VITE_MOCK_BASE_API=/mock
diff --git a/build/data.js b/build/data.js
index bc345a1..53b805d 100644
--- a/build/data.js
+++ b/build/data.js
@@ -1,9 +1,11 @@
+const baseRequestUrl = 'http://localhost:1010';
+
/**
* * 自动创建权限内容
*/
(async function requestPath() {
// 获取基础paths对象
- const response = await fetch('http://localhost:7070/v3/api-docs/%E9%BB%98%E8%AE%A4%E8%AF%B7%E6%B1%82%E6%8E%A5%E5%8F%A3', { method: 'GET' });
+ const response = await fetch(`${baseRequestUrl}/v3/api-docs/%E5%90%8E%E5%8F%B0%E7%AE%A1%E7%90%86`, { method: 'GET' });
const json = await response.json();
const paths = json.paths;
@@ -71,12 +73,12 @@
// 向服务器添加的内容
async function add(data) {
- const response = await fetch('http://localhost:7070/admin/power/addPower', {
+ const response = await fetch(`${baseRequestUrl}/admin/power/addPower`, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
token:
- 'eyJhbGciOiJIUzI1NiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAA_yWLywqFIBQA_-WsE9Sjt2xXuz7jmAYGWfiAIu6_X-HuhmHmhVwtjDDXGB_owN8XjKJH3iMayTuo2afFNffHSIdv-eSOEEMuicqZ2raX0Kx22g4ciRkUyBRpw6yxgq1S0SBXubnPBt8fEjhnWnMAAAA.YwSm-NO_6Kg1k1GRwucIt50Y70FbPHoldsdTPVHK_Y4',
+ 'eyJhbGciOiJIUzI1NiIsInppcCI6IkdaSVAifQ.H4sIAAAAAAAA_yWLSwrDIBQA7_LWCjE-f9k1ux7D1CdYiCl-ICXk7hW6G4aZC2rfYIG15_wFBnR-YBFGKus0WsOgVyrPMNwfs99p5I-wp5xqK74dZWzvloZVOEvnhea0ReI4aeQe0XCrhCP10jJOEe4fV-ghSXMAAAA.Vr41db3JGTYyZyz2H1YxNFvJjFkOZ0bq6RziYJ3uhBc',
},
body: JSON.stringify(data),
});
diff --git a/src/views/financial/account-bill/bill/index.vue b/src/views/financial/account-bill/bill/index.vue
index 4e7f60f..c1af70b 100644
--- a/src/views/financial/account-bill/bill/index.vue
+++ b/src/views/financial/account-bill/bill/index.vue
@@ -18,6 +18,8 @@ import LoadingSvg from '@/assets/svg/loading.svg';
import { useAdminUserStore } from '@/store/system/adminUser';
import Upload from '@iconify-icons/ep/upload';
import { currentMouth, currentWeek, currentYear, shortcutsAllMouth } from '@/enums/dateEnums';
+import { hasAuth } from '@/router/utils';
+import { auth } from '@/views/financial/account-bill/bill/utils/auth';
const tableRef = ref();
const formRef = ref();
@@ -132,15 +134,23 @@ onMounted(() => {
- {{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('search') }}
+
+
+ {{ $t('buttons.reset') }}
+
- {{ $t('exportBill') }}
- {{ $t('addNew') }}
+
+ {{ $t('exportBill') }}
+
+
+ {{ $t('addNew') }}
+
@@ -188,10 +198,18 @@ onMounted(() => {
-
+
{{ $t('modify') }}
-
+
{{ $t('delete') }}
diff --git a/src/views/financial/account-bill/bill/utils/auth.ts b/src/views/financial/account-bill/bill/utils/auth.ts
new file mode 100644
index 0000000..86f1f09
--- /dev/null
+++ b/src/views/financial/account-bill/bill/utils/auth.ts
@@ -0,0 +1,12 @@
+export const auth = {
+ // 分页查询
+ search: ['bill::getBillList'],
+ // 添加操作
+ add: ['bill::addBill'],
+ // 更新操作
+ update: ['bill::updateBill'],
+ // 删除操作
+ deleted: ['bill::deleteBill'],
+ // 导出账单
+ exportBill: ['bill::exportBillByAdmin'],
+};
diff --git a/src/views/financial/account-bill/category/index.vue b/src/views/financial/account-bill/category/index.vue
index e4b46c5..37ee1d9 100644
--- a/src/views/financial/account-bill/category/index.vue
+++ b/src/views/financial/account-bill/category/index.vue
@@ -25,6 +25,8 @@ import { usePublicHooks } from '@/views/hooks';
import { isDefaultOptions } from '@/enums/baseConstant';
import LoadingSvg from '@/assets/svg/loading.svg';
import { useAdminUserStore } from '@/store/system/adminUser';
+import { auth } from '@/views/financial/account-bill/category/utils/auth';
+import { hasAuth } from '@/router/utils';
const tableRef = ref();
const formRef = ref();
@@ -113,19 +115,23 @@ onMounted(() => {
-
+
{{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('buttons.reset') }}
+
- {{ $t('addNew') }}
+
+ {{ $t('addNew') }}
+
-
+
{{ $t('delete_batches') }}
@@ -186,10 +192,18 @@ onMounted(() => {
-
+
{{ $t('modify') }}
-
+
{{ $t('delete') }}
diff --git a/src/views/financial/account-bill/category/utils/auth.ts b/src/views/financial/account-bill/category/utils/auth.ts
new file mode 100644
index 0000000..688c3d9
--- /dev/null
+++ b/src/views/financial/account-bill/category/utils/auth.ts
@@ -0,0 +1,10 @@
+export const auth = {
+ // 分页查询
+ search: ['category::getCategoryList'],
+ // 添加操作
+ add: ['category::addCategory'],
+ // 更新操作
+ update: ['category::updateCategory'],
+ // 删除操作
+ deleted: ['category::deleteCategory'],
+};
diff --git a/src/views/financial/budget-saving/budget-category/index.vue b/src/views/financial/budget-saving/budget-category/index.vue
index b86f200..7311f5a 100644
--- a/src/views/financial/budget-saving/budget-category/index.vue
+++ b/src/views/financial/budget-saving/budget-category/index.vue
@@ -17,6 +17,8 @@ import { useAdminUserStore } from '@/store/system/adminUser';
import LoadingSvg from '@/assets/svg/loading.svg';
import { budget } from '@/enums/bill/budget';
import { handleTree } from '@pureadmin/utils';
+import { auth } from '@/views/financial/budget-saving/budget-category/utils/auth';
+import { hasAuth } from '@/router/utils';
const tableRef = ref();
const formRef = ref();
@@ -142,10 +144,18 @@ onMounted(() => {
-
+
{{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('buttons.reset') }}
+
@@ -158,10 +168,12 @@ onMounted(() => {
@refresh="onSearch"
>
- {{ $t('addNew') }}
+
+ {{ $t('addNew') }}
+
-
+
{{ $t('delete_batches') }}
@@ -211,13 +223,21 @@ onMounted(() => {
-
+
{{ $t('modify') }}
-
+
{{ $t('addNew') }}
-
+
{{ $t('delete') }}
diff --git a/src/views/financial/budget-saving/budget-category/utils/auth.ts b/src/views/financial/budget-saving/budget-category/utils/auth.ts
new file mode 100644
index 0000000..d3045db
--- /dev/null
+++ b/src/views/financial/budget-saving/budget-category/utils/auth.ts
@@ -0,0 +1,10 @@
+export const auth = {
+ // 分页查询
+ search: ['budgetCategory::getBudgetCategoryList'],
+ // 添加操作
+ add: ['budgetCategory::addBudgetCategory'],
+ // 更新操作
+ update: ['budgetCategory::updateBudgetCategory'],
+ // 删除操作
+ deleted: ['budgetCategory::deleteBudgetCategory'],
+};
diff --git a/src/views/financial/budget-saving/saving-goal/index.vue b/src/views/financial/budget-saving/saving-goal/index.vue
index 56a634d..6f6b64a 100644
--- a/src/views/financial/budget-saving/saving-goal/index.vue
+++ b/src/views/financial/budget-saving/saving-goal/index.vue
@@ -17,6 +17,8 @@ import LoadingSvg from '@/assets/svg/loading.svg';
import { budget } from '@/enums/bill/budget';
import { selectUserinfo } from '@/components/Table/Userinfo/columns';
import { savingGoal } from '@/enums/bill/savingGoal';
+import { hasAuth } from '@/router/utils';
+import { auth } from '@/views/financial/budget-saving/saving-goal/utils/auth';
const tableRef = ref();
const formRef = ref();
@@ -136,19 +138,29 @@ onMounted(() => {
-
+
{{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('buttons.reset') }}
+
- {{ $t('addNew') }}
+
+ {{ $t('addNew') }}
+
-
+
{{ $t('delete_batches') }}
@@ -197,10 +209,18 @@ onMounted(() => {
-
+
{{ $t('modify') }}
-
+
{{ $t('delete') }}
diff --git a/src/views/financial/budget-saving/saving-goal/utils/auth.ts b/src/views/financial/budget-saving/saving-goal/utils/auth.ts
new file mode 100644
index 0000000..e519749
--- /dev/null
+++ b/src/views/financial/budget-saving/saving-goal/utils/auth.ts
@@ -0,0 +1,10 @@
+export const auth = {
+ // 分页查询
+ search: ['savingGoal::getSavingGoalList'],
+ // 添加操作
+ add: ['savingGoal::addSavingGoal'],
+ // 更新操作
+ update: ['savingGoal::updateSavingGoal'],
+ // 删除操作
+ deleted: ['savingGoal::deleteSavingGoal'],
+};
diff --git a/src/views/financial/debt/debt-repayment-plan/index.vue b/src/views/financial/debt/debt-repayment-plan/index.vue
index 2ec515f..492fed2 100644
--- a/src/views/financial/debt/debt-repayment-plan/index.vue
+++ b/src/views/financial/debt/debt-repayment-plan/index.vue
@@ -16,6 +16,8 @@ import { selectUserinfo } from '@/components/Table/Userinfo/columns';
import LoadingSvg from '@/assets/svg/loading.svg';
import { useAdminUserStore } from '@/store/system/adminUser';
import { debtTracking } from '@/enums/bill/debtTracking';
+import { hasAuth } from '@/router/utils';
+import { auth } from '@/views/financial/debt/debt-repayment-plan/utils/auth';
const tableRef = ref();
const formRef = ref();
@@ -89,12 +91,22 @@ onMounted(() => {
-
+
-
+
@@ -133,19 +145,29 @@ onMounted(() => {
-
+
{{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('buttons.reset') }}
+
- {{ $t('addNew') }}
+
+ {{ $t('addNew') }}
+
-
+
{{ $t('delete_batches') }}
@@ -194,8 +216,18 @@ onMounted(() => {
- {{ $t('modify') }}
-
+
+ {{ $t('modify') }}
+
+
{{ $t('delete') }}
diff --git a/src/views/financial/debt/debt-repayment-plan/utils/auth.ts b/src/views/financial/debt/debt-repayment-plan/utils/auth.ts
new file mode 100644
index 0000000..c8c3868
--- /dev/null
+++ b/src/views/financial/debt/debt-repayment-plan/utils/auth.ts
@@ -0,0 +1,10 @@
+export const auth = {
+ // 分页查询
+ search: ['debtRepaymentPlan::getDebtRepaymentPlanList'],
+ // 添加操作
+ add: ['debtRepaymentPlan::addDebtRepaymentPlan'],
+ // 更新操作
+ update: ['debtRepaymentPlan::updateDebtRepaymentPlan'],
+ // 删除操作
+ deleted: ['debtRepaymentPlan::deleteDebtRepaymentPlan'],
+};
diff --git a/src/views/financial/debt/debt-tracking/index.vue b/src/views/financial/debt/debt-tracking/index.vue
index 439cdad..7f27f1e 100644
--- a/src/views/financial/debt/debt-tracking/index.vue
+++ b/src/views/financial/debt/debt-tracking/index.vue
@@ -16,6 +16,8 @@ import { selectUserinfo } from '@/components/Table/Userinfo/columns';
import LoadingSvg from '@/assets/svg/loading.svg';
import { useAdminUserStore } from '@/store/system/adminUser';
import { debtTracking, debtType } from '@/enums/bill/debtTracking';
+import { hasAuth } from '@/router/utils';
+import { auth } from '@/views/financial/debt/debt-tracking/utils/auth';
const tableRef = ref();
const formRef = ref();
@@ -143,19 +145,29 @@ onMounted(() => {
-
+
{{ $t('search') }}
- {{ $t('buttons.reset') }}
+
+ {{ $t('buttons.reset') }}
+
- {{ $t('addNew') }}
+
+ {{ $t('addNew') }}
+
-
+
{{ $t('delete_batches') }}
@@ -208,10 +220,18 @@ onMounted(() => {
-
+
{{ $t('modify') }}
-
+
{{ $t('delete') }}
diff --git a/src/views/financial/debt/debt-tracking/utils/auth.ts b/src/views/financial/debt/debt-tracking/utils/auth.ts
new file mode 100644
index 0000000..5395252
--- /dev/null
+++ b/src/views/financial/debt/debt-tracking/utils/auth.ts
@@ -0,0 +1,10 @@
+export const auth = {
+ // 分页查询
+ search: ['debtTracking::getDebtTrackingList'],
+ // 添加操作
+ add: ['debtTracking::addDebtTracking'],
+ // 更新操作
+ update: ['debtTracking::updateDebtTracking'],
+ // 删除操作
+ deleted: ['debtTracking::deleteDebtTracking'],
+};
diff --git a/src/views/i18n/i18n-setting/index.vue b/src/views/i18n/i18n-setting/index.vue
index 8eb81e2..e01e0b5 100644
--- a/src/views/i18n/i18n-setting/index.vue
+++ b/src/views/i18n/i18n-setting/index.vue
@@ -119,7 +119,17 @@ onMounted(() => {
- {{ $t('modify') }}
+
+ {{ $t('modify') }}
+