重新提交
Change-Id: I41d894c30f6945402022f7309d52d9dfc0ff4c79
diff --git a/src/api/administer.js b/src/api/administer.js
index 5f28e45..d90bffa 100644
--- a/src/api/administer.js
+++ b/src/api/administer.js
@@ -1,10 +1,10 @@
import axios from 'axios';
-const API_BASE_URL = 'http://localhost:8088'; // 替换为你的后端API基础URL
+// const API_BASE_URL = 'http://team2.10813352.xyz:8088'; // 替换为你的后端API基础URL
export const getAllUsers = async () => {
try {
- const response = await axios.get(`${API_BASE_URL}/user/allUser`, {
+ const response = await axios.get(`/user/allUser`, {
headers: {
Authorization: localStorage.getItem('token')
}
@@ -27,7 +27,7 @@
export const searchUsers = async (key) => {
try {
- const response = await axios.get(`${API_BASE_URL}/user/searchUser`, {
+ const response = await axios.get(`/user/searchUser`, {
params: { key },
headers: {
Authorization: localStorage.getItem('token')
@@ -50,7 +50,7 @@
// 修改用户权限
export const updateUserAuthority = async (username, authority) => {
try {
- const response = await axios.put(`${API_BASE_URL}/user/changeAuthority`,
+ const response = await axios.put(`/user/changeAuthority`,
{
changeUsername: username,
authority: authority
@@ -113,7 +113,7 @@
// 修改 getAllDiscounts 和 getCurrentDiscount 方法
export const getAllDiscounts = async () => {
try {
- const response = await axios.get(`${API_BASE_URL}/discount/all`, {
+ const response = await axios.get(`/discount/all`, {
headers: {
Authorization: localStorage.getItem('token')
}
@@ -133,7 +133,7 @@
export const getCurrentDiscount = async () => {
try {
- const response = await axios.get(`${API_BASE_URL}/discount/current`, {
+ const response = await axios.get(`/discount/current`, {
headers: {
Authorization: localStorage.getItem('token')
}
@@ -156,7 +156,7 @@
// 添加折扣
export const addDiscount = async (discountData) => {
try {
- const response = await axios.post(`${API_BASE_URL}/discount/add`, discountData, {
+ const response = await axios.post(`/discount/add`, discountData, {
headers: {
Authorization: localStorage.getItem('token')
}
@@ -176,7 +176,7 @@
// 删除折扣
export const deleteDiscount = async (id) => {
try {
- const response = await axios.delete(`${API_BASE_URL}/discount/delete/${id}`, {
+ const response = await axios.delete(`/discount/delete/${id}`, {
headers: {
Authorization: localStorage.getItem('token')
}