测试文件
This commit is contained in:
@@ -7,7 +7,7 @@
|
|||||||
//export const SUPA_URL: string = 'http://192.168.1.61:18000'
|
//export const SUPA_URL: string = 'http://192.168.1.61:18000'
|
||||||
//export const SUPA_KEY: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlLTEiLCJpYXQiOjE3Njk2NzY0OTgsImV4cCI6MTkyNzM1NjQ5OH0.ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
|
//export const SUPA_KEY: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlLTEiLCJpYXQiOjE3Njk2NzY0OTgsImV4cCI6MTkyNzM1NjQ5OH0.ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
|
||||||
export const SUPA_URL: string = 'http://192.168.1.62:18000'
|
export const SUPA_URL: string = 'http://192.168.1.62:18000'
|
||||||
export const SUPA_KEY: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoiYW5vbiIsImlzcyI6InN1cGFiYXNlLTEiLCJpYXQiOjE3Njk2NzY0OTgsImV4cCI6MTkyNzM1NjQ5OH0.ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
|
export const SUPA_KEY: string = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJyb2xlIjoic2VydmljZV9yb2xlIiwiaXNzIjoic3VwYWJhc2UtMSIsImlhdCI6MTc2OTY3NjQ5OCwiZXhwIjoxOTI3MzU2NDk4fQ.ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'
|
||||||
// export const SUPA_URL: string = 'http://192.168.1.63:18000'
|
// export const SUPA_URL: string = 'http://192.168.1.63:18000'
|
||||||
// export const SUPA_KEY: string = 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJyb2xlIjogImFub24iLCAiaXNzIjogInN1cGFiYXNlIiwgImlhdCI6IDE3Njk4NDczMzQsICJleHAiOiAyMDg1MjA3MzM0fQ.js-2CS5_cUmf4iVv8aCmmx9iyFsQvLNDbt8YYOngeLU'
|
// export const SUPA_KEY: string = 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJyb2xlIjogImFub24iLCAiaXNzIjogInN1cGFiYXNlIiwgImlhdCI6IDE3Njk4NDczMzQsICJleHAiOiAyMDg1MjA3MzM0fQ.js-2CS5_cUmf4iVv8aCmmx9iyFsQvLNDbt8YYOngeLU'
|
||||||
|
|
||||||
|
|||||||
159
manifest.json
159
manifest.json
@@ -1,74 +1,89 @@
|
|||||||
{
|
{
|
||||||
"name": "mall",
|
"name": "mall",
|
||||||
"appid": "__UNI__YOUR_APP_ID__",
|
"appid": "uni.app.UNI9462CA7",
|
||||||
"description": "A multi-role e-commerce application.",
|
"description": "A multi-role e-commerce application.",
|
||||||
"versionName": "1.0.0",
|
"versionName": "1.0.0",
|
||||||
"versionCode": "100",
|
"versionCode": "100",
|
||||||
"transformPx": false,
|
"transformPx": false,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"usingComponents": true,
|
"usingComponents": true,
|
||||||
"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": {},
|
||||||
"distribute": {
|
"distribute": {
|
||||||
"android": {
|
"android": {
|
||||||
"permissions": [
|
"permissions": [
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
"<uses-feature android:name=\"android.hardware.camera\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
|
||||||
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
"<uses-permission android:name=\"android.permission.WRITE_EXTERNAL_STORAGE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
|
"<uses-permission android:name=\"android.permission.READ_EXTERNAL_STORAGE\"/>",
|
||||||
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
"<uses-permission android:name=\"android.permission.INTERNET\"/>"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"ios": {},
|
"ios": {},
|
||||||
"sdkConfigs": {}
|
"sdkConfigs": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"quickapp": {},
|
"quickapp": {},
|
||||||
"mp-weixin": {
|
"mp-weixin": {
|
||||||
"appid": "",
|
"appid": "",
|
||||||
"setting": {
|
"setting": {
|
||||||
"urlCheck": false
|
"urlCheck": false
|
||||||
},
|
},
|
||||||
"usingComponents": true
|
"usingComponents": true,
|
||||||
},
|
"unipush": {
|
||||||
"mp-alipay": {
|
"enable": false
|
||||||
"usingComponents": true
|
}
|
||||||
},
|
},
|
||||||
"mp-baidu": {
|
"mp-alipay": {
|
||||||
"usingComponents": true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"mp-toutiao": {
|
"mp-baidu": {
|
||||||
"usingComponents": true
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"uniStatistics": {
|
"mp-toutiao": {
|
||||||
"enable": false
|
"usingComponents": true
|
||||||
},
|
},
|
||||||
"vueVersion": "3",
|
"uniStatistics": {
|
||||||
"uni-app-x": {},
|
"enable": false
|
||||||
"h5": {
|
},
|
||||||
"title": "mall",
|
"vueVersion": "3",
|
||||||
"router": {
|
"uni-app-x": {},
|
||||||
"mode": "hash",
|
"h5": {
|
||||||
"base": "./"
|
"title": "mall",
|
||||||
}
|
"router": {
|
||||||
}
|
"mode": "hash",
|
||||||
|
"base": "./"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"web": {
|
||||||
|
"router": {
|
||||||
|
"mode": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"app-android": {
|
||||||
|
"distribute": {
|
||||||
|
"modules": {
|
||||||
|
"uni-push": {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
42
pages/mall/delivery/webhook-server/test-send.js
Normal file
42
pages/mall/delivery/webhook-server/test-send.js
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
const http = require('http')
|
||||||
|
const https = require('https')
|
||||||
|
const crypto = require('crypto')
|
||||||
|
|
||||||
|
const PORT = process.env.PORT || 7201
|
||||||
|
const URL = `http://localhost:${PORT}/webhook/express/status`
|
||||||
|
const SECRET = process.env.WEBHOOK_SECRET || 'test_secret'
|
||||||
|
|
||||||
|
const payload = {
|
||||||
|
tracking_no: 'LOCALTEST123',
|
||||||
|
status_code: 'DELIVERED',
|
||||||
|
acceptTime: new Date().toISOString(),
|
||||||
|
remark: 'local test event'
|
||||||
|
}
|
||||||
|
|
||||||
|
const bodyText = JSON.stringify(payload)
|
||||||
|
const ts = Math.floor(Date.now() / 1000).toString()
|
||||||
|
const sig = crypto.createHmac('sha256', SECRET).update(bodyText + ts).digest('hex')
|
||||||
|
|
||||||
|
const options = {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
'Content-Length': Buffer.byteLength(bodyText),
|
||||||
|
'X-Timestamp': ts,
|
||||||
|
'X-Signature': sig
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const req = http.request(URL, options, (res) => {
|
||||||
|
let data = ''
|
||||||
|
res.on('data', (chunk) => data += chunk)
|
||||||
|
res.on('end', () => {
|
||||||
|
console.log('STATUS', res.statusCode)
|
||||||
|
try { console.log('BODY', JSON.parse(data)) } catch (e) { console.log('BODY', data) }
|
||||||
|
process.exit(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
req.on('error', (e) => { console.error('request error', e); process.exit(2) })
|
||||||
|
req.write(bodyText)
|
||||||
|
req.end()
|
||||||
Reference in New Issue
Block a user