diff --git a/.env.development b/.env.development index f2e81e2..f5143b4 100644 --- a/.env.development +++ b/.env.development @@ -1,4 +1,11 @@ # VITE_API_BASE='http://54.251.137.151:10704/' # VITE_API_BASE='https://hwjb.homilychart.com/gold_htms_dev' # VITE_API_BASE='http://54.251.137.151:10704/' +<<<<<<< HEAD VITE_API_BASE='http://192.168.8.94:8080/' +======= +# VITE_API_BASE='http://192.168.8.225:8080/' +# VITE_API_BASE='http://192.168.8.94:8080/' +VITE_API_BASE='http://192.168.8.247:8081/' + +>>>>>>> milestone-20250623-金币前端 diff --git a/src/router/index.js b/src/router/index.js index 8716011..f1ac976 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,13 +2,13 @@ import { createRouter, createWebHashHistory } from 'vue-router'; const router = createRouter({ history: createWebHashHistory(), - routes: [ - { path: '/login', name: "login", component: () => import("../views/login.vue") }, - { path: '/', redirect: "/login" }, + routes: [//此处在做登录之前做成默认跳转工作台 + { path: '/workspace', name: "workspace", component: () => import("../views/workspace/index.vue") }, + { path: '/', redirect: "/workspace" }, // { path: '/test', component: () => import("../views/z.vue") }, { meta: { requireAuth: true }, - path: '/index', component: () => import("../views/index.vue"), + path: '/', component: () => import("../views/home.vue"), children: [ // 工作台 @@ -19,6 +19,7 @@ const router = createRouter({ { path: '/refundAudit', name: "refundAudit", component: () => import("../views/audit/refundAudit.vue") }, // 金币消耗 { path: '/coinConsume', name: "coinConsume", component: () => import("../views/consume/coinConsume.vue"), + redirect: '/coinConsume/add',// 重定向到新增消耗页面 children: [ // 金币新增消耗 { path: 'add', name: "addCoinConsume", component: () => import("../views/consume/addCoinConsume.vue") }, @@ -31,15 +32,32 @@ const router = createRouter({ // 汇率管理 { path: '/rate', name: "rate", component: () => import("../views/managerecharge/rate.vue") }, // 金币充值 - { path: '/coinRecharge', name: "coinRecharge", component: () => import("../views/recharge/coinRecharge.vue") }, + { path: '/coinRecharge', name: "coinRecharge", component: () => import("../views/recharge/coinRecharge.vue"), + redirect: '/coinRecharge/add',// 重定向到新增充值页面 + children: [ + // 金币新增充值 + { path: 'add', name: "addCoinRecharge", component: () => import("../views/recharge/addCoinRecharge.vue") }, + // 金币充值明细详情 + { path: 'detail', name: "coinRechargeDetail", component: () => import("../views/recharge/coinRechargeDetail.vue") } + ] + }, // 金豆充值 { path: '/beanRecharge', name: "beanRecharge", component: () => import("../views/recharge/beanRecharge.vue") }, // 金币退款 - { path: '/coinRefund', name: "coinRefund", component: () => import("../views/refund/coinRefund.vue") }, + { path: '/coinRefund', name: "coinRefund", component: () => import("../views/refund/coinRefund.vue"), + redirect: '/coinRefund/add',// 重定向到新增退款页面 + children: [ + // 金币新增消耗 + { path: 'add', name: "addCoinRefund", component: () => import("../views/refund/addCoinRefund.vue") }, + // 金币消耗明细详情 + { path: 'detail', name: "coinRefundDetail", component: () => import("../views/refund/coinRefundDetail.vue") } + ] + }, // 金豆退款 { path: '/beanRefund', name: "beanRefund", component: () => import("../views/refund/beanRefund.vue") }, // 客户账户明细 { path: '/usergold', name: "usergold", component: () => import("../views/usergold/clientCount.vue"), + redirect: '/usergold/detail',// 重定向到客户账户明细页面 children: [ // 金币明细 { path: 'detail', name: "clientCountDetail", component: () => import("../views/usergold/clientCountDetail.vue") }, @@ -48,7 +66,7 @@ const router = createRouter({ ] }, // 权限管理 - { path: '/permissions', name: "permissions", component: () => import("../views/permissions/index.vue") }, + { path: '/permissions', name: "permissions", component: () => import("../views/permissions/permission.vue") }, // 没有权限 { path: '/noPermission', name: "noPermission", component: () => import("../views/noPermissionPage.vue") } ] @@ -58,42 +76,43 @@ const router = createRouter({ }); 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 == "3") { - 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 == '2') { - if (to.name == "rechargeAudit" || to.name == "refundAudit" - || to.name == "activity" || to.name == "rate" - || to.name == "permissions") { - next({ name: "workspace" }) - } else { - next(); - } - } else if (permission == '5') { - if (to.name == "permissions") { - next({ name: "workspace" }) - } else { - next(); - } - } - else { - 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 == "3") { + // 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 == '2') { + // if (to.name == "rechargeAudit" || to.name == "refundAudit" + // || to.name == "activity" || to.name == "rate" + // || to.name == "permissions") { + // next({ name: "workspace" }) + // } else { + // next(); + // } + // } else if (permission == '5') { + // if (to.name == "permissions") { + // next({ name: "workspace" }) + // } else { + // next(); + // } + // } + // else { + // next(); + // } - } + // } + next(); }) export default router; diff --git a/src/util/request.js b/src/util/request.js index 15579ed..541b9f3 100644 --- a/src/util/request.js +++ b/src/util/request.js @@ -1,13 +1,13 @@ import axios from 'axios' // 创建axios实例 const service = axios.create({ - baseURL: import.meta.env.VITE_API_BASE, + baseURL: import.meta.env.VITE_API_BASE,//.env.development timeout: 10000, headers: { 'Content-Type': 'application/json' }, // 设置请求头,指定请求体的格式为 JSON - // 设置默认请求方法为 POST 这行对应的代码搁哪呢? + // 设置默认请求方法为 POST 这行对应的代码搁哪呢? util/http.js自己看 }) // 请求拦截器 diff --git a/src/views/audit/refundAudit.vue b/src/views/audit/refundAudit.vue index a022a4b..4143d4b 100644 --- a/src/views/audit/refundAudit.vue +++ b/src/views/audit/refundAudit.vue @@ -190,7 +190,11 @@ const getProducts = async () => { // 查地区 const getAreas = async () => { try { +<<<<<<< HEAD const result = await request({ url: '' }) +======= + const result = await request({ url: 'http://192.168.8.247:8081/general/market' }) +>>>>>>> milestone-20250623-金币前端 areaOptions.value = result.data || [] } catch (error) { console.error('获取地区列表失败', error) diff --git a/src/views/consume/addCoinConsume.vue b/src/views/consume/addCoinConsume.vue index 86f6a89..da0679c 100644 --- a/src/views/consume/addCoinConsume.vue +++ b/src/views/consume/addCoinConsume.vue @@ -1,22 +1,85 @@ + diff --git a/src/views/index.vue b/src/views/index.vue index b85908f..85121ba 100644 --- a/src/views/index.vue +++ b/src/views/index.vue @@ -56,16 +56,16 @@ const message = function () { // 获取machineId -function logout() { - const machineId = localStorage.getItem('machineId') - console.log('machineId:', machineId) - localStorage.removeItem('token') - // localStorage.clear(); - router.push('/login?machineId=' + machineId) - //添加刷新页面的代码 - // window.location.reload(); - ElMessage.success('退出成功') -} +// function logout() { +// const machineId = localStorage.getItem('machineId') +// console.log('machineId:', machineId) +// localStorage.removeItem('token') +// // localStorage.clear(); +// router.push('/login?machineId=' + machineId) +// //添加刷新页面的代码 +// // window.location.reload(); +// ElMessage.success('退出成功') +// } // 挂载 onMounted(async function () { diff --git a/src/views/login.vue b/src/views/login.vue index f764989..efe9035 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -27,9 +27,7 @@ getMachineId() const router = useRouter() // 获取路由实例 let formData = new FormData() -// 添加表单数据到FormData对象中 -// formData.append("jwcode", form.value.jwcode); -// formData.append("password", form.value.password); + const form = ref({ jwcode: '', password: '', token: '', machineId: machineId }) //调用方法 @@ -63,7 +61,7 @@ const login = async function () { } catch (error) { console.log('请求失败', error) ElMessage.error('登录失败,请检查账号密码') - // 在这里可以处理错误逻辑,比如显示错误提示等 + } } @@ -78,7 +76,7 @@ const login = async function () { class="bg" fit="fit" /> - + @@ -113,18 +111,13 @@ const login = async function () {

登录

- +
+ - \ No newline at end of file diff --git a/src/views/managerecharge/rate.vue b/src/views/managerecharge/rate.vue index 7071076..7f45288 100644 --- a/src/views/managerecharge/rate.vue +++ b/src/views/managerecharge/rate.vue @@ -1,4 +1,5 @@ + + + - - - + diff --git a/src/views/recharge/coinRechargeDetail.vue b/src/views/recharge/coinRechargeDetail.vue new file mode 100644 index 0000000..7a0e5b3 --- /dev/null +++ b/src/views/recharge/coinRechargeDetail.vue @@ -0,0 +1,770 @@ + + + + + diff --git a/src/views/refund/addCoinRefund.vue b/src/views/refund/addCoinRefund.vue new file mode 100644 index 0000000..1c947ab --- /dev/null +++ b/src/views/refund/addCoinRefund.vue @@ -0,0 +1,560 @@ + + + + + + + diff --git a/src/views/refund/coinRefund.vue b/src/views/refund/coinRefund.vue index e29bd2a..482e909 100644 --- a/src/views/refund/coinRefund.vue +++ b/src/views/refund/coinRefund.vue @@ -1,1310 +1,61 @@ - - - - - + diff --git a/src/views/refund/coinRefundDetail.vue b/src/views/refund/coinRefundDetail.vue new file mode 100644 index 0000000..d327af4 --- /dev/null +++ b/src/views/refund/coinRefundDetail.vue @@ -0,0 +1,612 @@ + + + + + diff --git a/src/views/usergold/clientCountBalance.vue b/src/views/usergold/clientCountBalance.vue index d6c0e69..2c48295 100644 --- a/src/views/usergold/clientCountBalance.vue +++ b/src/views/usergold/clientCountBalance.vue @@ -1,3 +1,466 @@ + + \ No newline at end of file + + + +
+
+ 精网号: + +
+
+ 所属地区: + + + +
+ 查询 + 导出Excel +
+ +
+
+
+ + + +
+ 金币总数:{{ Math.abs(goldtotal) }} + 永久金币:{{ Math.abs(permanentGold) }} + 免费金币:{{ Math.abs(freeGold) }} + 任务金币:{{ Math.abs(taskGold) }} +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+
+
+ + + + diff --git a/src/views/usergold/clientCountDetail.vue b/src/views/usergold/clientCountDetail.vue index 7256755..98263d4 100644 --- a/src/views/usergold/clientCountDetail.vue +++ b/src/views/usergold/clientCountDetail.vue @@ -1,4 +1,4 @@ - + @@ -501,84 +348,6 @@ onMounted(async function () {
- - - - - - - -
导出信息
- - -
- 你正在导出所有数据 -
-
- 你正在导出以下数据 -
-
精网号:{{ detailY.jwcode || '' }}
-
平台信息:{{ detailY.consumePlatform ? (platform.find(item => item.value === detailY.consumePlatform)?.label) : '' }}
-
数量更新类型:{{ detailY.num ? (num.find(item => item.value === detailY.num)?.label || '') : '' }}
-
所属地区:{{ detailY.area || '' }}
-
- 更新时间: - - - {{ moment(getTime[0]).format('YYYY-MM-DD HH:mm:ss') }} 至 {{ moment(getTime[1]).format('YYYY-MM-DD HH:mm:ss') }} - - -
- -
- - - - -
- 已导出 {{ Math.round((exportProgress / 100) * total) }} 条 / 共 {{ total }} 条 -
- -
@@ -588,7 +357,7 @@ onMounted(async function () {
精网号: 平台信息:
- +
数量更新类型: 所属地区: +
+ 金币总数:{{ Math.abs(sumGoldTotal) }} + 永久金币:{{ Math.abs( permanentGold) }} + 免费金币:{{ Math.abs(totalFreeGold) }} + 任务金币:{{ Math.abs(taskGold) }} +
@@ -707,80 +483,73 @@ onMounted(async function () { label="精网号" width="120" /> - + - + - - - + + - + - + @@ -810,11 +579,7 @@ onMounted(async function () { - - - - - +
diff --git a/src/views/workspace/index.vue b/src/views/workspace/index.vue index 3ff2fe5..2d717e0 100644 --- a/src/views/workspace/index.vue +++ b/src/views/workspace/index.vue @@ -223,7 +223,7 @@ const handleDateRangeChange = () => { const getAreas = async () => { try { const result = await API({ - url: '/recharge/user/search', + url: 'http://192.168.8.247:8081/general/market', data: {} }) middleCategory.value = result.data.map(item => item.name) diff --git a/vite.config.ts b/vite.config.ts index 2aaafd5..c6803fa 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -39,6 +39,9 @@ export default defineConfig(({ mode }) => { ] }) ], + server: { + host: true // 允许外部设备访问 + }, resolve: { alias: { '@': path.resolve(__dirname, './src')