This commit is contained in:
parent
5636d9f770
commit
535fea46d8
|
|
@ -90,9 +90,8 @@ service.interceptors.request.use(
|
||||||
const userSecret = getSecretKey()
|
const userSecret = getSecretKey()
|
||||||
const method = config.method.toUpperCase()
|
const method = config.method.toUpperCase()
|
||||||
const timestamp = Date.now().toString()
|
const timestamp = Date.now().toString()
|
||||||
|
|
||||||
let requestUrl = config.url
|
let requestUrl = config.url
|
||||||
|
console.log(config);
|
||||||
if (config.params && typeof config.params === 'object') {
|
if (config.params && typeof config.params === 'object') {
|
||||||
// 使用URLSearchParams自动处理嵌套对象
|
// 使用URLSearchParams自动处理嵌套对象
|
||||||
const searchParams = new URLSearchParams()
|
const searchParams = new URLSearchParams()
|
||||||
|
|
@ -119,8 +118,10 @@ service.interceptors.request.use(
|
||||||
requestUrl += '?' + paramsString
|
requestUrl += '?' + paramsString
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//
|
||||||
const signature = generateRequestSignature(userId, timestamp, method, requestUrl, userSecret)
|
console.log("校验前数据");
|
||||||
|
console.log(userId, timestamp, method, requestUrl, userSecret);
|
||||||
|
const signature = generateRequestSignature(userId, timestamp, method, config.baseURL+requestUrl, userSecret)
|
||||||
console.log(signature);
|
console.log(signature);
|
||||||
console.log(requestUrl);
|
console.log(requestUrl);
|
||||||
config.headers['timestamp'] = timestamp
|
config.headers['timestamp'] = timestamp
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
|
||||||
const name = process.env.VUE_APP_TITLE || '图像评估与自动标注系统' // 网页标题
|
const name = process.env.VUE_APP_TITLE || '图像评估与自动标注系统' // 网页标题
|
||||||
|
|
||||||
// const baseUrl = 'http://localhost:8080' // 后端接口
|
// const baseUrl = 'http://localhost:8080' // 后端接口
|
||||||
const baseUrl = 'http://192.168.2.188:58080/caption' //本地
|
const baseUrl = 'http://127.0.0.1:58080/caption' //本地
|
||||||
// const baseUrl = 'http://192.168.0.14:6006' //测试环境
|
// const baseUrl = 'http://192.168.0.14:6006' //测试环境
|
||||||
|
|
||||||
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
const port = process.env.port || process.env.npm_config_port || 80 // 端口
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue