Browse Source

在vite-config里进行统一接口管理

master
hongxilin 4 months ago
parent
commit
cc8244cc90
  1. 12
      vue/gold-system/src/views/audit/rechargeAudit.vue
  2. 10
      vue/gold-system/src/views/audit/refundAudit.vue
  3. 10
      vue/gold-system/src/views/consume/addConsume.vue
  4. 4
      vue/gold-system/src/views/consume/allConsume.vue
  5. 2
      vue/gold-system/src/views/index.vue
  6. 2
      vue/gold-system/src/views/login.vue
  7. 8
      vue/gold-system/src/views/managerecharge/activity.vue
  8. 14
      vue/gold-system/src/views/managerecharge/rate.vue
  9. 28
      vue/gold-system/src/views/recharge/addRecharge.vue
  10. 10
      vue/gold-system/src/views/recharge/adminRecharge.vue
  11. 6
      vue/gold-system/src/views/recharge/allRecharge.vue
  12. 10
      vue/gold-system/src/views/refund/addRefund.vue
  13. 8
      vue/gold-system/src/views/refund/allRefund.vue
  14. 6
      vue/gold-system/src/views/usergold/index.vue
  15. 4
      vue/gold-system/src/views/usergoldInfo/index.vue
  16. 22
      vue/gold-system/src/views/workspace/index.vue
  17. 10
      vue/gold-system/vite.config.ts

12
vue/gold-system/src/views/audit/rechargeAudit.vue

@ -19,7 +19,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -120,7 +120,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge",
"/hwjb/recharge/recharge",
{ ...getObj.value, rechargeVo: { ...rechargeVo.value } }
);
@ -250,7 +250,7 @@ const getActivity = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{}
);
@ -269,7 +269,7 @@ const getArea = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/search",
"/hwjb/recharge/user/search",
{}
);
//
@ -334,7 +334,7 @@ const passConfirm = async function () {
console.log("通过对象", passObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/audit/audit/goldedit",
"/hwjb/audit/audit/goldedit",
passObj.value
);
@ -381,7 +381,7 @@ const rejectConfirm = async function () {
console.log("驳回对象", rejectObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/audit/audit/goldedit",
"/hwjb/audit/audit/goldedit",
rejectObj.value
);

10
vue/gold-system/src/views/audit/refundAudit.vue

@ -88,7 +88,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/audit/audit/refund",
"/hwjb/audit/audit/refund",
{ ...getObj.value, detail: { ...detail.value } }
);
@ -216,7 +216,7 @@ const handleClick = function (tab, event) {
const getProduct = async function () {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/product", {});
const result = await API.post("/hwjb/product", {});
//
console.log("请求成功", result);
@ -234,7 +234,7 @@ const getArea = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/search",
"/hwjb/recharge/user/search",
{}
);
//
@ -296,7 +296,7 @@ const passConfirm = async function () {
console.log("通过对象", passObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/audit/audit/edit",
"/hwjb/audit/audit/edit",
passObj.value
);
@ -342,7 +342,7 @@ const rejectConfirm = async function () {
console.log("驳回对象", rejectObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/audit/audit/edit",
"/hwjb/audit/audit/edit",
rejectObj.value
);

10
vue/gold-system/src/views/consume/addConsume.vue

@ -14,7 +14,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -40,7 +40,7 @@ const add = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/consume/add",
"/hwjb/consume/add",
addConsume.value
);
if (result.code === 0) {
@ -138,7 +138,7 @@ const user = ref({
const getUser = async function (jwcode) {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/recharge/user", {
const result = await API.post("/hwjb/recharge/user", {
jwcode: jwcode,
});
@ -168,7 +168,7 @@ const goods = ref([]);
const getGoods = async function () {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/product", {});
const result = await API.post("/hwjb/product", {});
//
console.log("请求成功", result);
@ -188,7 +188,7 @@ const userGold = ref({});
const getUserGold = async function (jwcode) {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/recharge/user", {
const result = await API.post("/hwjb/recharge/user", {
jwcode: jwcode,
});
//

4
vue/gold-system/src/views/consume/allConsume.vue

@ -81,7 +81,7 @@ const get = async function (val) {
}
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://39.99.159.73:20090/consume/select", {
const result = await API.post("/hwjb/consume/select", {
...getObj.value,
consumeDetail: { ...detailVo.value },
});
@ -218,7 +218,7 @@ const goods = ref([]);
const getGoods = async function () {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/product", {});
const result = await API.post("/hwjb/product", {});
//
console.log("请求成功", result);
//

2
vue/gold-system/src/views/index.vue

@ -19,7 +19,7 @@ const adminData = ref({
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;

2
vue/gold-system/src/views/login.vue

@ -16,7 +16,7 @@ const form = ref({ jwcode: "", password: "", token: "" });
const login = async function () {
try {
const result = await axios.post(
"http://39.99.159.73:20090/admin/login",
"/hwjb/admin/login",
form.value
);
if (result.data.code == 200) {

8
vue/gold-system/src/views/managerecharge/activity.vue

@ -12,7 +12,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -75,7 +75,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{ ...getObj.value, activity: { ...activity.value } }
);
@ -138,7 +138,7 @@ const add = async function () {
console.log("添加对象", addObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/add",
"/hwjb/recharge/activity/add",
addObj.value
);
@ -193,7 +193,7 @@ const delConfirm = async function () {
console.log("delObj", delObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/edit",
"/hwjb/recharge/activity/edit",
delObj.value
);
//

14
vue/gold-system/src/views/managerecharge/rate.vue

@ -14,7 +14,7 @@ const adminData = ref({
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -74,7 +74,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://39.99.159.73:20090/rates/search", {
const result = await API.post("/hwjb/rates/search", {
...getObj.value,
rate: { ...time.value },
});
@ -120,7 +120,7 @@ const addRate = async function () {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/rates/add",
"/hwjb/rates/add",
rateAdd.value
);
if (result.code == 0) {
@ -170,7 +170,7 @@ const getEditData = async function (row) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/rates/searchById?rateId=" + row.rateId,
"/hwjb/rates/searchById?rateId=" + row.rateId,
{}
);
@ -205,7 +205,7 @@ const editRate = async function () {
console.log("搜索参数", rateEdit.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/rates/update",
"/hwjb/rates/update",
rateEdit.value
);
//
@ -232,7 +232,7 @@ const deleteRate = async function (row) {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/rates/delete/ " + row.rateId,
"/hwjb/rates/delete/ " + row.rateId,
{}
);
//
@ -388,7 +388,7 @@ const delConfirm = async function (row) {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/rates/delete/ " + row.rateId,
"/hwjb/rates/delete/ " + row.rateId,
{}
);
//

28
vue/gold-system/src/views/recharge/addRecharge.vue

@ -18,7 +18,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -48,7 +48,7 @@ const add = async function () {
console.log("开始添加充值信息", addRecharge.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge/add",
"/hwjb/recharge/recharge/add",
addRecharge.value
);
if (result.code === 0) {
@ -130,7 +130,7 @@ const user = ref({
const getUser = async function (jwcode) {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/recharge/user", {
const result = await API.post("/hwjb/recharge/user", {
jwcode: jwcode,
});
@ -161,7 +161,7 @@ const getActivity = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{ activity: { status: 1 } }
);
@ -182,7 +182,7 @@ const currency = ref([]);
const getCurrency = async function () {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/rates/status", {});
const result = await API.post("/hwjb/rates/status", {});
//
console.log("货币请求成功", result);
@ -201,7 +201,7 @@ getCurrency();
const handleAvatarSuccess = (response, uploadFile) => {
imageUrl.value = URL.createObjectURL(uploadFile.raw);
console.log("图片上传成功", response, uploadFile);
addRecharge.value.rechargeVoucher = `http://39.99.159.73:20090/upload/${response.data}`;
addRecharge.value.rechargeVoucher = `/hwjb/upload/${response.data}`;
console.log("图片名称", addRecharge.value.rechargeVoucher);
};
@ -238,7 +238,7 @@ const getActivityById = async function (row) {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{ activity: { activityId: row } }
);
addRecharge.value.rechargeRatio = result.data[0].rechargeRatio;
@ -298,7 +298,7 @@ const getJwcodeList = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/jwcode",
"/hwjb/recharge/user/jwcode",
{}
);
@ -648,7 +648,7 @@ const changeVoucher = function (row) {
const handleBatchAvatarSuccess = (response, uploadFile) => {
imageUrl.value = URL.createObjectURL(uploadFile.raw);
console.log("图片上传成功", response, uploadFile);
rechargeVoucher.value = `http://39.99.159.73:20090/upload/${response.data}`;
rechargeVoucher.value = `/hwjb/upload/${response.data}`;
console.log("图片名称", rechargeVoucher.value);
};
//
@ -731,7 +731,7 @@ const batchAdd = async function () {
console.log("batchData===", batchData.value);
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge/addmore",
"/hwjb/recharge/recharge/addmore",
{ ...batchData.value }
);
@ -778,7 +778,7 @@ const batchSettingInit = function () {
const batchSettingHandleAvatarSuccess = (response, uploadFile) => {
batchSettingObj.value.imageUrl = URL.createObjectURL(uploadFile.raw);
console.log("图片上传成功", response, uploadFile);
batchSettingObj.value.rechargeVoucher = `http://39.99.159.73:20090/upload/${response.data}`;
batchSettingObj.value.rechargeVoucher = `/hwjb/upload/${response.data}`;
console.log("图片名称", batchSettingObj.value.rechargeVoucher);
};
//
@ -963,7 +963,7 @@ onMounted(async function () {
style="margin-bottom: 5px"
>
<el-upload
action="http://39.99.159.73:20090/upload"
action="/hwjb/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="handleAvatarSuccess"
@ -1285,7 +1285,7 @@ onMounted(async function () {
<el-table-column property="rechargeVoucher" label="充值凭证">
<template #default="scope">
<el-upload
action="http://39.99.159.73:20090/upload"
action="/hwjb/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="handleBatchAvatarSuccess"
@ -1450,7 +1450,7 @@ onMounted(async function () {
</el-form-item>
<el-form-item prop="rechargeVoucher" label="交款凭证">
<el-upload
action="http://39.99.159.73:20090/upload"
action="/hwjb/upload"
class="avatar-uploader"
:show-file-list="false"
:on-success="batchSettingHandleAvatarSuccess"

10
vue/gold-system/src/views/recharge/adminRecharge.vue

@ -11,7 +11,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -105,7 +105,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge",
"/hwjb/recharge/recharge",
{ ...getObj.value, rechargeVo: { ...rechargeVo.value } }
);
@ -233,7 +233,7 @@ const getActivity = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{}
);
@ -253,7 +253,7 @@ const getArea = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/search",
"/hwjb/recharge/user/search",
{}
);
//
@ -277,7 +277,7 @@ const delConfirm = async function () {
try {
console.log("delObj2", delObj.value);
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge/edit",
"/hwjb/recharge/recharge/edit",
delObj.value
);
console.log("删除成功", result);

6
vue/gold-system/src/views/recharge/allRecharge.vue

@ -86,7 +86,7 @@ const get = async function (val) {
console.log("搜索参数", getObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/recharge",
"/hwjb/recharge/recharge",
{ ...getObj.value, rechargeVo: { ...rechargeVo.value } }
);
@ -214,7 +214,7 @@ const getActivity = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/activity/select",
"/hwjb/recharge/activity/select",
{}
);
@ -234,7 +234,7 @@ const getArea = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/search",
"/hwjb/recharge/user/search",
{}
);
//

10
vue/gold-system/src/views/refund/addRefund.vue

@ -17,7 +17,7 @@ const adminData = ref({});
const getAdminData = async function () {
try {
const result = await API.post(
"http://39.99.159.73:20090/admin/userinfo",
"/hwjb/admin/userinfo",
{}
);
adminData.value = result;
@ -56,7 +56,7 @@ const add = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/refund/add",
"/hwjb/refund/add",
addRefund.value
);
if (result.code === 0) {
@ -143,7 +143,7 @@ const user = ref({
const getUser = async function (jwcode) {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/recharge/user", {
const result = await API.post("/hwjb/recharge/user", {
jwcode: jwcode,
});
@ -203,7 +203,7 @@ const getGoods = async function (jwcode) {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/consume/getDeatil/" + addRefund.value.jwcode,
"/hwjb/consume/getDeatil/" + addRefund.value.jwcode,
{}
);
if (result.code === 0) {
@ -246,7 +246,7 @@ const getProductByOrderCode = async function (item) {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/refund/searchByOrderCode?orderCode=" + item,
"/hwjb/refund/searchByOrderCode?orderCode=" + item,
{}
);
addRefund.value.contactId = result.data.detailId;

8
vue/gold-system/src/views/refund/allRefund.vue

@ -67,7 +67,7 @@ const get = async function (val) {
}
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://39.99.159.73:20090/refund/search", {
const result = await API.post("/hwjb/refund/search", {
...getObj.value,
detail: { ...detail.value },
});
@ -197,7 +197,7 @@ const getArea = async function () {
try {
// POST
const result = await API.post(
"http://39.99.159.73:20090/recharge/user/search",
"/hwjb/recharge/user/search",
{}
);
//
@ -227,7 +227,7 @@ const delConfirm = async function () {
console.log("delObj", delObj.value);
// POST
const result = await API.post(
"http://39.99.159.73:20090/refund/softDelete?detailId=" +
"/hwjb/refund/softDelete?detailId=" +
delObj.value.detailId,
{}
);
@ -246,7 +246,7 @@ const goods = ref([]);
const getGoods = async function () {
try {
// POST
const result = await API.post("http://39.99.159.73:20090/product", {});
const result = await API.post("/hwjb/product", {});
//
console.log("请求成功", result);
//

6
vue/gold-system/src/views/usergold/index.vue

@ -79,11 +79,11 @@ const get = async function (val) {
}
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://39.99.159.73:20090/detailY", {
const result = await API.post("/hwjb/detailY", {
...getObj.value,
detailY: { ...detailY.value },
});
const result2 = await API.post("http://39.99.159.73:20090/detailY", {
const result2 = await API.post("/hwjb/detailY", {
...getAllObj.value,
detailY: { ...detailY.value },
});
@ -273,7 +273,7 @@ const areyour = async function () {
try {
loading.value = true;
const result = await API.post(
"http://39.99.159.73:20090/detailY/searchAll",
"/hwjb/detailY/searchAll",
{ ...putExcel.value }
);
excelInfo.value = result.data;

4
vue/gold-system/src/views/usergoldInfo/index.vue

@ -72,11 +72,11 @@ const get = async function (val) {
}
console.log("搜索参数", getObj.value);
// POST
const result = await API.post("http://39.99.159.73:20090/detailY/select", {
const result = await API.post("/hwjb/detailY/select", {
...getObj.value,
detailYgold: { ...detailY.value },
});
// const result2 = await API.post("http://39.99.159.73:20090/detailY/select", {
// const result2 = await API.post("/hwjb/detailY/select", {
// ...getAllObj.value,
// detailY: { ...detailY.value },
// });

22
vue/gold-system/src/views/workspace/index.vue

@ -90,40 +90,40 @@ const get = async function () {
getMiddleBar();
// POST
const result1 = await API.post(
"http://39.99.159.73:20090/statistics/getSumCoin",
"/hwjb/statistics/getSumCoin",
{}
);
const result2 = await API.post(
"http://39.99.159.73:20090/statistics/a",
"/hwjb/statistics/a",
{}
);
const result3 = await API.post(
"http://39.99.159.73:20090/statistics/getYearConsumeCoin",
"/hwjb/statistics/getYearConsumeCoin",
{}
);
const result4 = await API.post(
"http://39.99.159.73:20090/statistics/getDayConsumeCoin",
"/hwjb/statistics/getDayConsumeCoin",
{}
);
// const result5 = await API.post(
// "http://39.99.159.73:20090/statistics/getMediumAreaPay",
// "/hwjb/statistics/getMediumAreaPay",
// {}
// );
// const result6 = await API.post(
// "http://39.99.159.73:20090/statistics/getMediumAreaConsume",
// "/hwjb/statistics/getMediumAreaConsume",
// {}
// );
// const result7 = await API.post(
// "http://39.99.159.73:20090/statistics/getMediuPayCoin",
// "/hwjb/statistics/getMediuPayCoin",
// {}
// );
// const result8 = await API.post(
// "http://39.99.159.73:20090/statistics/getMediuConsumeCoin",
// "/hwjb/statistics/getMediuConsumeCoin",
// {}
// );
const result9 = await API.post(
"http://39.99.159.73:20090/statistics/b",
"/hwjb/statistics/b",
{}
);
@ -368,7 +368,7 @@ const get = async function () {
//
const getMiddleBar = async function () {
const result = await API.post(
"http://39.99.159.73:20090/statistics/getCoinTime",
"/hwjb/statistics/getCoinTime",
getMiddleBarObj.value
);
@ -570,7 +570,7 @@ const getMiddleBar = async function () {
//
const getAreaRank = async function () {
const result = await API.post(
"http://39.99.159.73:20090/statistics/getMee",
"/hwjb/statistics/getMee",
getAreaRankObj.value
);

10
vue/gold-system/vite.config.ts

@ -4,5 +4,13 @@ import vue from '@vitejs/plugin-vue'
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
server:{
proxy: {
'/hwjb': {
target: 'http://39.99.159.73:20090',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/hwjb/, ''),
},
},
}
})
Loading…
Cancel
Save