From 9ef74969a497bda31534b49d0e8b8a320018d860 Mon Sep 17 00:00:00 2001 From: donghaolin <17667510818@163.com> Date: Wed, 4 Dec 2024 19:50:55 +0800 Subject: [PATCH] =?UTF-8?q?12.4=E6=9C=80=E5=90=8E=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vue/gold-system/src/api/index.js | 9 +++++++++ vue/gold-system/src/views/recharge/addRecharge.vue | 7 ++++--- vue/gold-system/src/views/refund/addRefund.vue | 3 +-- 3 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 vue/gold-system/src/api/index.js diff --git a/vue/gold-system/src/api/index.js b/vue/gold-system/src/api/index.js new file mode 100644 index 0000000..eae8ed7 --- /dev/null +++ b/vue/gold-system/src/api/index.js @@ -0,0 +1,9 @@ +import http from '../util/http.js'; + +const API={ + post: function(url,data){ + return http({url:url,method:'post',data:data}) + }, +}; + +export default API; \ No newline at end of file diff --git a/vue/gold-system/src/views/recharge/addRecharge.vue b/vue/gold-system/src/views/recharge/addRecharge.vue index d5b495e..5a4a127 100644 --- a/vue/gold-system/src/views/recharge/addRecharge.vue +++ b/vue/gold-system/src/views/recharge/addRecharge.vue @@ -5,6 +5,7 @@ import { ElMessage } from "element-plus"; import { Plus } from "@element-plus/icons-vue"; import axios from "axios"; import { ElMessageBox } from "element-plus"; +import API from "../../api/index.js"; // 这是添加充值信息的表单 const addRecharge = ref({ @@ -19,7 +20,7 @@ const addRecharge = ref({ const add = async function () { try { // 发送POST请求 - const result = await axios.post( + const result = await API.post( "http://192.168.8.93:10010/recharge/recharge/add", addRecharge.value ); @@ -85,7 +86,7 @@ const user = ref({}); const getUser = async function (jwcode) { try { // 发送POST请求 - const result = await axios.post("http://192.168.8.93:10020/recharge/user", { + const result = await API.post("http://192.168.8.93:10020/recharge/user", { jwcode: jwcode, }); @@ -111,7 +112,7 @@ const activity = ref([]); const getActivity = async function () { try { // 发送POST请求 - const result = await axios.post( + const result = await API.post( "http://192.168.8.93:10010/recharge/activity/select", {} ); diff --git a/vue/gold-system/src/views/refund/addRefund.vue b/vue/gold-system/src/views/refund/addRefund.vue index 1a39a6d..2333413 100644 --- a/vue/gold-system/src/views/refund/addRefund.vue +++ b/vue/gold-system/src/views/refund/addRefund.vue @@ -5,7 +5,6 @@ import { ElMessage } from "element-plus"; import { Plus } from "@element-plus/icons-vue"; import axios from "axios"; import { ElMessageBox } from "element-plus"; -import http from "src/util/http.js"; // 这是添加充值信息的表单 const addRefund = ref({ @@ -90,7 +89,7 @@ const user = ref({}); const getUser = async function (jwcode) { try { // 发送POST请求 - const result = await http.post("http://192.168.8.93:10020/recharge/user", { + const result = await axios.post("http://192.168.8.93:10020/recharge/user", { jwcode: jwcode, });