diff --git a/ebike-maintenance/utils/api.js b/ebike-maintenance/utils/api.js index 3cc6f19..eb18d6c 100644 --- a/ebike-maintenance/utils/api.js +++ b/ebike-maintenance/utils/api.js @@ -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); @@ -36,7 +38,7 @@ export const callCoreApi = (url, parmas = {}, method = 'post') => { export const callEcuCoreApi = (url, parmas = {}, method = 'post') => { return HttpRequest(baseUrl + "maintenance/testCore/" + url, method, parmas); } - + export const fileUpload = (file) => { return HttpFileUpload(baseUrl + "maintenance/ebikeBikeInfo/fileUpload", file); } @@ -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); } \ No newline at end of file diff --git a/ebike-operate/src/apis/call.js b/ebike-operate/src/apis/call.js index 08bf0b7..c754bc9 100644 --- a/ebike-operate/src/apis/call.js +++ b/ebike-operate/src/apis/call.js @@ -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 diff --git a/ebike-operate/src/apis/login.js b/ebike-operate/src/apis/login.js index 6436270..ce64428 100644 --- a/ebike-operate/src/apis/login.js +++ b/ebike-operate/src/apis/login.js @@ -1,45 +1,47 @@ import httpInstance from '@/utils/request.js' +let baseUrl = "" +baseUrl += "/ebike" //登录 const getLoginAPI = (username, password) => { - return httpInstance({ - baseURL: '/user', - url: '/auth/loginByPwd', - method: 'POST', - data: { - username, - password - } - }) + return httpInstance({ + baseURL: baseUrl + '/user', + url: '/auth/loginByPwd', + method: 'POST', + data: { + username, + password + } + }) } const getUserZone = () => { - return httpInstance({ - baseURL: '/operate', - url: '/ebikeRegion/getZone', - method: 'GET', - data: {} - }) + return httpInstance({ + baseURL: baseUrl + '/operate', + url: '/ebikeRegion/getZone', + method: 'GET', + data: {} + }) } const getUserOperation = () => { - return httpInstance({ - baseURL: '/operate', - url: '/ebikeRegion/getOperation', - method: 'GET', - data: {} - }) + return httpInstance({ + baseURL: baseUrl + '/operate', + url: '/ebikeRegion/getOperation', + method: 'GET', + data: {} + }) } //退出登录 const getLogoutAPI = () => { - return httpInstance({ - baseURL: '/user', - url: '/auth/logout', - method: 'POST', - data: {} - }) + return httpInstance({ + baseURL: baseUrl + '/user', + url: '/auth/logout', + method: 'POST', + data: {} + }) } export { getLoginAPI, getUserZone, getUserOperation, getLogoutAPI } diff --git a/ebike-operate/vite.config.js b/ebike-operate/vite.config.js index e0249dc..d2c9e64 100644 --- a/ebike-operate/vite.config.js +++ b/ebike-operate/vite.config.js @@ -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) => { diff --git a/ebike-user/utils/api.js b/ebike-user/utils/api.js index e1adc08..1bf09c9 100644 --- a/ebike-user/utils/api.js +++ b/ebike-user/utils/api.js @@ -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); @@ -34,4 +36,4 @@ export const fileUploadUser = (file) => { export const fileUploadUserPicture = (file) => { return HttpFileUpload(baseUrl + "order/ebikeOrdersSystem/fileUploadUserPicture", file); -} +} \ No newline at end of file