api修改

This commit is contained in:
dzl 2025-05-29 10:43:15 +08:00
parent 1c2e09ab2c
commit 514eecedee
5 changed files with 51 additions and 43 deletions

View File

@ -3,7 +3,9 @@ import {
HttpFileUpload
} from './request';
import config from './config';
export const baseUrl = config.apiUrl;
export const apiUrl = config.apiUrl;
let baseUrl = apiUrl
// baseUrl += "ebike/"
export const calluser = (url, parmas = {}) => {
return HttpRequest(baseUrl + "user/" + url, 'post', parmas);
@ -59,6 +61,6 @@ export const callMaintenanceApi = (url, parmas = {}, method = 'post') => {
return HttpRequest(baseUrl + "maintenance/" + url, method, parmas);
}
export const fileUploadApi = (url,file) => {
export const fileUploadApi = (url, file) => {
return HttpFileUpload(baseUrl + url, file);
}

View File

@ -1,8 +1,10 @@
import httpInstance from '@/utils/request.js'
let baseUrl = ""
baseUrl += "/ebike"
const callOperate = (url, parmas = {}, method = "post") => {
return httpInstance({
baseURL: '/operate',
baseURL: baseUrl + '/operate',
url: url,
method: method,
data: parmas
@ -11,7 +13,7 @@ const callOperate = (url, parmas = {}, method = "post") => {
const callUser = (url, parmas = {}, method = "post") => {
return httpInstance({
baseURL: '/user',
baseURL: baseUrl + '/user',
url: url,
method: method,
data: parmas
@ -20,7 +22,7 @@ const callUser = (url, parmas = {}, method = "post") => {
const callOrder = (url, parmas = {}, method = "post") => {
return httpInstance({
baseURL: '/order',
baseURL: baseUrl + '/order',
url: url,
method: method,
data: parmas
@ -29,7 +31,7 @@ const callOrder = (url, parmas = {}, method = "post") => {
const callPayment = (url, parmas = {}, method = "post") => {
return httpInstance({
baseURL: '/payment',
baseURL: baseUrl + '/payment',
url: url,
method: method,
data: parmas

View File

@ -1,9 +1,11 @@
import httpInstance from '@/utils/request.js'
let baseUrl = ""
baseUrl += "/ebike"
//登录
const getLoginAPI = (username, password) => {
return httpInstance({
baseURL: '/user',
baseURL: baseUrl + '/user',
url: '/auth/loginByPwd',
method: 'POST',
data: {
@ -15,7 +17,7 @@ const getLoginAPI = (username, password) => {
const getUserZone = () => {
return httpInstance({
baseURL: '/operate',
baseURL: baseUrl + '/operate',
url: '/ebikeRegion/getZone',
method: 'GET',
data: {}
@ -24,7 +26,7 @@ const getUserZone = () => {
const getUserOperation = () => {
return httpInstance({
baseURL: '/operate',
baseURL: baseUrl + '/operate',
url: '/ebikeRegion/getOperation',
method: 'GET',
data: {}
@ -35,7 +37,7 @@ const getUserOperation = () => {
//退出登录
const getLogoutAPI = () => {
return httpInstance({
baseURL: '/user',
baseURL: baseUrl + '/user',
url: '/auth/logout',
method: 'POST',
data: {}

View File

@ -5,9 +5,9 @@ import vue from '@vitejs/plugin-vue'
import Components from 'unplugin-vue-components/vite';
import { AntDesignVueResolver } from 'unplugin-vue-components/resolvers';
let targetUrl = 'http://127.0.0.1:10010/'
let targetUrl = 'http://192.168.2.151:10010/'
//targetUrl = 'https://attiya.fun/ebike/'
// targetUrl = 'https://www.cdzhuojing.cn/'
targetUrl = 'https://www.cdzhuojing.cn/'
// https://vite.dev/config/
export default defineConfig({
plugins: [
@ -30,7 +30,7 @@ export default defineConfig({
},
server: {
proxy: {
'^/operate/*': {
'^/ebike/operate/*': {
changeOrigin: true,
target: targetUrl,
rewrite: (path) => {
@ -44,7 +44,7 @@ export default defineConfig({
// res.setHeader('x-res-proxyUrl',proxyUrl)
// }
},
'^/maintenance/*': {
'^/ebike/maintenance/*': {
changeOrigin: true,
target: targetUrl,
rewrite: (path) => {
@ -58,7 +58,7 @@ export default defineConfig({
// res.setHeader('x-res-proxyUrl',proxyUrl)
// }
},
'^/user/*': {
'^/ebike/user/*': {
changeOrigin: true,
target: targetUrl,
rewrite: (path) => {
@ -72,7 +72,7 @@ export default defineConfig({
// res.setHeader('x-res-proxyUrl',proxyUrl)
// }
},
'^/order/*': {
'^/ebike/order/*': {
changeOrigin: true,
target: targetUrl,
rewrite: (path) => {
@ -86,7 +86,7 @@ export default defineConfig({
// res.setHeader('x-res-proxyUrl',proxyUrl)
// }
},
'^/payment/*': {
'^/ebike/payment/*': {
changeOrigin: true,
target: targetUrl,
rewrite: (path) => {

View File

@ -3,7 +3,9 @@ import {
HttpFileUpload
} from './request';
import config from './config';
export const baseUrl = config.apiUrl;
export const apiUrl = config.apiUrl;
let baseUrl = apiUrl
baseUrl += "ebike/"
export const callCoreApi = (url, parmas = {}, method = 'post') => {
return HttpRequest(baseUrl + "maintenance/core/" + url, method, parmas);