diff --git a/gold-system/src/router/index.js b/gold-system/src/router/index.js index 4812f37..13640ff 100644 --- a/gold-system/src/router/index.js +++ b/gold-system/src/router/index.js @@ -1,57 +1,85 @@ -import { createRouter,createWebHashHistory } from 'vue-router'; +import { createRouter, createWebHashHistory } from 'vue-router'; + +const router = createRouter({ + history: createWebHashHistory(), + routes: [ + { path: '/login', name: "login", component: () => import("../views/login.vue") }, + { path: '/', redirect: "/login" }, + { path: '/test', component: () => import("../views/z.vue") }, -const router=createRouter({ - history:createWebHashHistory(), - routes:[ - {path:'/login', name:"login", component:()=>import("../views/login.vue")}, - {path:'/',redirect:"/login"}, - {path:'/test',component:()=>import("../views/z.vue")}, { - meta:{requireAuth:true}, - path:'/index',component:()=>import("../views/index.vue"), - children:[ + meta: { requireAuth: true }, + path: '/index', component: () => import("../views/index.vue"), + children: [ + // 工作台 - {path:'/workspace',component:()=>import("../views/workspace/index.vue")}, + { path: '/workspace', name: "workspace", component: () => import("../views/workspace/index.vue") }, // 充值审核 - {path:'/rechargeAudit',component:()=>import("../views/audit/rechargeAudit.vue")}, + { path: '/rechargeAudit', name: "rechargeAudit", component: () => import("../views/audit/rechargeAudit.vue") }, // 退款审核 - {path:'/refundAudit',component:()=>import("../views/audit/refundAudit.vue")}, + { path: '/refundAudit', name: "refundAudit", component: () => import("../views/audit/refundAudit.vue") }, // 新增消费 - {path:'/addConsume',component:()=>import("../views/consume/addConsume.vue")}, + { path: '/addConsume', name: "addConsume", component: () => import("../views/consume/addConsume.vue") }, // 所有消费明细 - {path:'/allConsume',component:()=>import("../views/consume/allConsume.vue")}, + { path: '/allConsume', name: "allConsume", component: () => import("../views/consume/allConsume.vue") }, // 活动管理 - {path:'/activity',component:()=>import("../views/managerecharge/activity.vue")}, + { path: '/activity', name: "activity", component: () => import("../views/managerecharge/activity.vue") }, // 汇率管理 - {path:'/rate',component:()=>import("../views/managerecharge/rate.vue")}, + { path: '/rate', name: "rate", component: () => import("../views/managerecharge/rate.vue") }, // 新增充值 - {path:'/addRecharge',component:()=>import("../views/recharge/addRecharge.vue")}, + { path: '/addRecharge', name: "addRecharge", component: () => import("../views/recharge/addRecharge.vue") }, // 客户充值明细 - {path:'/adminRecharge',component:()=>import("../views/recharge/adminRecharge.vue")}, + { path: '/adminRecharge', name: "adminRecharge", component: () => import("../views/recharge/adminRecharge.vue") }, // 所有充值明细 - {path:'/allRecharge',component:()=>import("../views/recharge/allRecharge.vue")}, + { path: '/allRecharge', name: "allRecharge", component: () => import("../views/recharge/allRecharge.vue") }, // 新增退款 - {path:'/addRefund',component:()=>import("../views/refund/addRefund.vue")}, + { path: '/addRefund', name: "addRefund", component: () => import("../views/refund/addRefund.vue") }, // 退款明细 - {path:'/allRefund',component:()=>import("../views/refund/allRefund.vue")}, + { path: '/allRefund', name: "allRefund", component: () => import("../views/refund/allRefund.vue") }, // 客户金币明细 - {path:'/usergold',component:()=>import("../views/usergold/index.vue")}, + { path: '/usergold', name: "usergold", component: () => import("../views/usergold/index.vue") }, // 客户金币余额 - {path:'/usergoldInfo',component:()=>import("../views/usergoldInfo/index.vue")}, + { path: '/usergoldInfo', name: "usergoldInfo", component: () => import("../views/usergoldInfo/index.vue") }, // 权限管理 - {path:'/permissions',component:()=>import("../views/permissions/index.vue")}, + { path: '/permissions', name: "permissions", component: () => import("../views/permissions/index.vue") }, + // 没有权限 + { path: '/noPermission', name: "noPermission", component: () => import("../views/noPermissionPage.vue") }, ] }, - + ] }); -router.beforeEach((to,from,next)=>{ - const token=localStorage.getItem("token"); - if(to.name!="login"&&!token){ - next({name:"login"}); - }else{ - next(); +router.beforeEach((to, from, next) => { + const token = localStorage.getItem("token"); + const permission = localStorage.getItem("permission"); + if (to.name != "login" && !token) { + next({ name: "login" }); + } else { + if (permission == "4" && to.name != "noPermission") { + next({ name: "noPermission" }); + } else if (permission == "2") { + if (to.name == "addConsume" || to.name == "allConsume" + || to.name == "addRecharge" || to.name == "adminRecharge" || to.name == "allRecharge" + || to.name == "addRefund" || to.name == "allRefund" + || to.name == "permissions") { + next({ name: "workspace" }); + } else { + next(); + } + } else if (permission == '3') { + if (to.name == "rechargeAudit" || to.name == "refundAudit" + || to.name == "activity" || to.name == "rate" + || to.name == "permissions") { + next({ name: "workspace" }) + } else { + next(); + } + } + else { + next(); + } + } }) diff --git a/gold-system/src/views/audit/rechargeAudit.vue b/gold-system/src/views/audit/rechargeAudit.vue index 3c629f4..40453b9 100644 --- a/gold-system/src/views/audit/rechargeAudit.vue +++ b/gold-system/src/views/audit/rechargeAudit.vue @@ -23,14 +23,13 @@ const getAdminData = async function () { {} ); adminData.value = result; - addConsume.value.adminId = adminData.value.adminId; console.log("请求成功", result); console.log("用户信息", adminData.value); } catch (error) { console.log("请求失败", error); } }; -getAdminData(); + // 充值明细表格 const tableData = ref([]); @@ -103,6 +102,10 @@ const Ref = ref(null); // 搜索方法 const get = async function (val) { try { + // 地区赋值 + if (adminData.value.area != "总部") { + rechargeVo.value.area = adminData.value.area; + } // 搜索参数页码赋值 if (typeof val === "number") { getObj.value.pageNum = val; @@ -316,7 +319,7 @@ const checkNumber = function () { const pass = function (row) { // 通过初始化 passObj.value = row; - passObj.value.adminId = admin.value.adminId; + passObj.value.adminId = adminData.value.adminId; passObj.value.auditId = row.auditId; passObj.value.status = 1; passObj.value.rechargeId = row.rechargeId; @@ -364,7 +367,7 @@ const closeRejectVisible = function () { // 驳回按钮 const reject = function (row) { // 驳回初始化 - rejectObj.value.adminId = admin.value.adminId; + rejectObj.value.adminId = adminData.value.adminId; rejectObj.value.auditId = row.auditId; rejectObj.value.status = 2; rejectObj.value.reson = ""; @@ -418,9 +421,10 @@ const rules = reactive({ // 挂载 onMounted(async function () { - await get(); - getActivity(); + await getAdminData(); + await getActivity(); await getArea(); + await get(); }); @@ -432,69 +436,32 @@ onMounted(async function () {
精网号: - +
活动名称: - - + +
充值方式: - - + +
-
+
所属地区: - - + +
@@ -503,16 +470,9 @@ onMounted(async function () {
充值时间: - - + + 近7天
@@ -530,12 +490,7 @@ onMounted(async function () { - + @@ -543,12 +498,7 @@ onMounted(async function () {
- + - + - + - + 驳回
@@ -685,42 +585,17 @@ onMounted(async function () { @@ -729,29 +604,12 @@ onMounted(async function () {
- + - + - + - + 驳回
@@ -636,42 +565,17 @@ onMounted(async function () { @@ -680,29 +584,12 @@ onMounted(async function () { - +