diff --git a/vue/gold-system/src/views/recharge/adminRecharge.vue b/vue/gold-system/src/views/recharge/adminRecharge.vue index 851dd3f..af66f35 100644 --- a/vue/gold-system/src/views/recharge/adminRecharge.vue +++ b/vue/gold-system/src/views/recharge/adminRecharge.vue @@ -6,20 +6,29 @@ import { AiFillRead } from "vue-icons-plus/ai"; import axios from "axios"; import moment from "moment"; import API from "../../api/index.js"; +//这是获取用户信息的接口 +const adminData = ref({}); +const getAdminData = async function () { + try { + const result = await API.post( + "http://192.168.8.93:10010/admin/userinfo", + {} + ); + adminData.value = result; + rechargeVo.value.adminId = adminData.value.adminId; + console.log("请求成功", result); + console.log("用户信息", adminData.value); + } catch (error) { + console.log("请求失败", error); + } +}; // 变量 -// 用户对象假的 -const admin = ref({ - adminId: 1, - name: "赵刚", - area: "中国", -}); - // 充值明细表格 const tableData = ref([]); // 搜索=========================================== // 搜索recharge const rechargeVo = ref({ - adminId: admin.value.adminId, + adminId: adminData.value.adminId, }); // 搜索对象 const getObj = ref({ @@ -313,6 +322,7 @@ const checkNumber = function () { // 挂载 onMounted(async function () { + await getAdminData(); await get(); getActivity(); await getArea();