This commit is contained in:
haozq 2025-10-24 19:10:00 +08:00
parent 5636d9f770
commit 535fea46d8
2 changed files with 6 additions and 5 deletions

View File

@ -90,9 +90,8 @@ service.interceptors.request.use(
const userSecret = getSecretKey()
const method = config.method.toUpperCase()
const timestamp = Date.now().toString()
let requestUrl = config.url
console.log(config);
if (config.params && typeof config.params === 'object') {
// 使用URLSearchParams自动处理嵌套对象
const searchParams = new URLSearchParams()
@ -119,8 +118,10 @@ service.interceptors.request.use(
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(requestUrl);
config.headers['timestamp'] = timestamp

View File

@ -10,7 +10,7 @@ const CompressionPlugin = require('compression-webpack-plugin')
const name = process.env.VUE_APP_TITLE || '图像评估与自动标注系统' // 网页标题
// 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 port = process.env.port || process.env.npm_config_port || 80 // 端口