1
This commit is contained in:
@@ -11,6 +11,8 @@ function authRequest(path, data) {
|
|||||||
success(response) {
|
success(response) {
|
||||||
const body = response.data || {}
|
const body = response.data || {}
|
||||||
console.info('[Overseas PDA auth] response', { url, statusCode: response.statusCode, code: body.code,
|
console.info('[Overseas PDA auth] response', { url, statusCode: response.statusCode, code: body.code,
|
||||||
|
message: typeof body === 'object' ? body.message : String(body).slice(0, 160),
|
||||||
|
contentType: response.header?.['Content-Type'] || response.header?.['content-type'],
|
||||||
requestId: body.requestId || response.header?.['X-Request-Id'] || response.header?.['x-request-id'],
|
requestId: body.requestId || response.header?.['X-Request-Id'] || response.header?.['x-request-id'],
|
||||||
traceId: body.traceId || response.header?.['X-Trace-Id'] || response.header?.['x-trace-id'] })
|
traceId: body.traceId || response.header?.['X-Trace-Id'] || response.header?.['x-trace-id'] })
|
||||||
if (String(body.code ?? response.statusCode) !== '200') {
|
if (String(body.code ?? response.statusCode) !== '200') {
|
||||||
|
|||||||
+84
-88
@@ -1,91 +1,87 @@
|
|||||||
{
|
{
|
||||||
"name" : "柏悦物流 PDA 海外版",
|
"name": "柏悦物流 PDA 海外版",
|
||||||
"appid" : "__UNI__936D079",
|
"appid": "__UNI__936D079",
|
||||||
"description" : "柏悦物流海外仓 PDA 作业端",
|
"description": "柏悦物流海外仓 PDA 作业端",
|
||||||
"versionName" : "0.0.1",
|
"versionName": "0.0.1",
|
||||||
"versionCode" : 1,
|
"versionCode": 1,
|
||||||
"transformPx" : false,
|
"transformPx": false,
|
||||||
"app-plus" : {
|
"app-plus": {
|
||||||
"usingComponents" : true,
|
"usingComponents": true,
|
||||||
"nvueCompiler" : "uni-app",
|
"nvueCompiler": "uni-app",
|
||||||
"nvueStyleCompiler" : "uni-app",
|
"nvueStyleCompiler": "uni-app",
|
||||||
"compilerVersion" : 3,
|
"compilerVersion": 3,
|
||||||
"splashscreen" : {
|
"splashscreen": {
|
||||||
"alwaysShowBeforeRender" : true,
|
"alwaysShowBeforeRender": true,
|
||||||
"waiting" : true,
|
"waiting": true,
|
||||||
"autoclose" : true,
|
"autoclose": true,
|
||||||
"delay" : 0
|
"delay": 0
|
||||||
},
|
},
|
||||||
"modules" : {
|
"modules": {
|
||||||
"Barcode" : {},
|
"Barcode": {},
|
||||||
"Bluetooth" : {},
|
"Bluetooth": {},
|
||||||
"Camera" : {},
|
"Camera": {},
|
||||||
"Contacts" : {},
|
"Contacts": {},
|
||||||
"UIWebview" : {}
|
"UIWebview": {}
|
||||||
},
|
},
|
||||||
"distribute" : {
|
"distribute": {
|
||||||
"android" : {
|
"android": {
|
||||||
"packagename" : "com.baiyuelogistics.pda.overseas",
|
"packagename": "com.baiyuelogistics.pda.overseas",
|
||||||
"permissions" : [],
|
"permissions": [],
|
||||||
"abiFilters" : [ "armeabi-v7a", "arm64-v8a" ]
|
"abiFilters": ["armeabi-v7a", "arm64-v8a"]
|
||||||
},
|
|
||||||
"ios" : {
|
|
||||||
"dSYMs" : false
|
|
||||||
},
|
|
||||||
"sdkConfigs" : {},
|
|
||||||
"icons" : {
|
|
||||||
"android" : {
|
|
||||||
"hdpi" : "static/app-icons/72x72.png",
|
|
||||||
"xhdpi" : "static/app-icons/96x96.png",
|
|
||||||
"xxhdpi" : "static/app-icons/144x144.png",
|
|
||||||
"xxxhdpi" : "static/app-icons/192x192.png"
|
|
||||||
},
|
|
||||||
"ios" : {
|
|
||||||
"appstore" : "static/app-icons/1024x1024.png",
|
|
||||||
"ipad" : {
|
|
||||||
"app" : "static/app-icons/76x76.png",
|
|
||||||
"app@2x" : "static/app-icons/152x152.png",
|
|
||||||
"notification" : "static/app-icons/20x20.png",
|
|
||||||
"notification@2x" : "static/app-icons/40x40.png",
|
|
||||||
"proapp@2x" : "static/app-icons/167x167.png",
|
|
||||||
"settings" : "static/app-icons/29x29.png",
|
|
||||||
"settings@2x" : "static/app-icons/58x58.png",
|
|
||||||
"spotlight" : "static/app-icons/40x40.png",
|
|
||||||
"spotlight@2x" : "static/app-icons/80x80.png"
|
|
||||||
},
|
|
||||||
"iphone" : {
|
|
||||||
"app@2x" : "static/app-icons/120x120.png",
|
|
||||||
"app@3x" : "static/app-icons/180x180.png",
|
|
||||||
"notification@2x" : "static/app-icons/40x40.png",
|
|
||||||
"notification@3x" : "static/app-icons/60x60.png",
|
|
||||||
"settings@2x" : "static/app-icons/58x58.png",
|
|
||||||
"settings@3x" : "static/app-icons/87x87.png",
|
|
||||||
"spotlight@2x" : "static/app-icons/80x80.png",
|
|
||||||
"spotlight@3x" : "static/app-icons/120x120.png"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"quickapp" : {},
|
|
||||||
"mp-weixin" : {
|
|
||||||
"appid" : "",
|
|
||||||
"setting" : {
|
|
||||||
"urlCheck" : false
|
|
||||||
},
|
|
||||||
"usingComponents" : true
|
|
||||||
},
|
|
||||||
"uniStatistics" : {
|
|
||||||
"enable" : false
|
|
||||||
},
|
|
||||||
"vueVersion" : "3",
|
|
||||||
"h5" : {
|
|
||||||
"devServer" : {
|
|
||||||
"proxy": {
|
|
||||||
|
|
||||||
},
|
},
|
||||||
"port" : 5176,
|
"ios": {
|
||||||
"https": false
|
"dSYMs": false
|
||||||
}
|
},
|
||||||
}
|
"sdkConfigs": {},
|
||||||
|
"icons": {
|
||||||
|
"android": {
|
||||||
|
"hdpi": "static/app-icons/72x72.png",
|
||||||
|
"xhdpi": "static/app-icons/96x96.png",
|
||||||
|
"xxhdpi": "static/app-icons/144x144.png",
|
||||||
|
"xxxhdpi": "static/app-icons/192x192.png"
|
||||||
|
},
|
||||||
|
"ios": {
|
||||||
|
"appstore": "static/app-icons/1024x1024.png",
|
||||||
|
"ipad": {
|
||||||
|
"app": "static/app-icons/76x76.png",
|
||||||
|
"app@2x": "static/app-icons/152x152.png",
|
||||||
|
"notification": "static/app-icons/20x20.png",
|
||||||
|
"notification@2x": "static/app-icons/40x40.png",
|
||||||
|
"proapp@2x": "static/app-icons/167x167.png",
|
||||||
|
"settings": "static/app-icons/29x29.png",
|
||||||
|
"settings@2x": "static/app-icons/58x58.png",
|
||||||
|
"spotlight": "static/app-icons/40x40.png",
|
||||||
|
"spotlight@2x": "static/app-icons/80x80.png"
|
||||||
|
},
|
||||||
|
"iphone": {
|
||||||
|
"app@2x": "static/app-icons/120x120.png",
|
||||||
|
"app@3x": "static/app-icons/180x180.png",
|
||||||
|
"notification@2x": "static/app-icons/40x40.png",
|
||||||
|
"notification@3x": "static/app-icons/60x60.png",
|
||||||
|
"settings@2x": "static/app-icons/58x58.png",
|
||||||
|
"settings@3x": "static/app-icons/87x87.png",
|
||||||
|
"spotlight@2x": "static/app-icons/80x80.png",
|
||||||
|
"spotlight@3x": "static/app-icons/120x120.png"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"quickapp": {},
|
||||||
|
"mp-weixin": {
|
||||||
|
"appid": "",
|
||||||
|
"setting": {
|
||||||
|
"urlCheck": false
|
||||||
|
},
|
||||||
|
"usingComponents": true
|
||||||
|
},
|
||||||
|
"uniStatistics": {
|
||||||
|
"enable": false
|
||||||
|
},
|
||||||
|
"vueVersion": "3",
|
||||||
|
"h5": {
|
||||||
|
"devServer": {
|
||||||
|
"port": 5176
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+20
-3
@@ -1,6 +1,23 @@
|
|||||||
import { defineConfig, loadEnv } from 'vite'
|
import { defineConfig, loadEnv } from 'vite'
|
||||||
import uni from '@dcloudio/vite-plugin-uni'
|
import uni from '@dcloudio/vite-plugin-uni'
|
||||||
|
|
||||||
|
function loggedProxy(name, options) {
|
||||||
|
return {
|
||||||
|
...options,
|
||||||
|
configure(proxy) {
|
||||||
|
proxy.on('proxyReq', (proxyRequest, request) => {
|
||||||
|
console.info(`[Overseas PDA H5 proxy] ${name}`, `${request.method} ${request.url}`, '->', `${options.target}${proxyRequest.path}`)
|
||||||
|
})
|
||||||
|
proxy.on('proxyRes', (response, request) => {
|
||||||
|
console.info(`[Overseas PDA H5 proxy] ${name} response`, `${request.method} ${request.url}`, response.statusCode)
|
||||||
|
})
|
||||||
|
proxy.on('error', (error, request) => {
|
||||||
|
console.error(`[Overseas PDA H5 proxy] ${name} error`, `${request.method} ${request.url}`, error.message)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export default defineConfig(({ mode }) => {
|
export default defineConfig(({ mode }) => {
|
||||||
const env = loadEnv(mode, process.cwd(), '')
|
const env = loadEnv(mode, process.cwd(), '')
|
||||||
const domesticTarget = env.API_PROXY_TARGET || 'http://127.0.0.1:9000'
|
const domesticTarget = env.API_PROXY_TARGET || 'http://127.0.0.1:9000'
|
||||||
@@ -9,12 +26,12 @@ export default defineConfig(({ mode }) => {
|
|||||||
plugins: [uni()],
|
plugins: [uni()],
|
||||||
server: {
|
server: {
|
||||||
proxy: {
|
proxy: {
|
||||||
'/api': { target: domesticTarget, changeOrigin: true },
|
'/api': loggedProxy('auth', { target: domesticTarget, changeOrigin: true }),
|
||||||
'/overseas-api': {
|
'/overseas-api': loggedProxy('overseas', {
|
||||||
target: overseasTarget,
|
target: overseasTarget,
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/overseas-api/, '/api')
|
rewrite: (path) => path.replace(/^\/overseas-api/, '/api')
|
||||||
}
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
css: {
|
css: {
|
||||||
|
|||||||
Reference in New Issue
Block a user