fix: 修复前端 TypeScript 类型错误并移除 docker-compose.yml 中的 version 属性
- 移除 docker-compose.yml 中的 version 属性(已过时) - 修复 RouteLocationNormalized 类型导入错误 - 修复 AxiosRequestConfig 类型错误,使用 InternalAxiosRequestConfig - 添加 Vite 环境变量类型定义 - 扩展 axios 类型定义,正确处理响应拦截器返回的 data - 修复 signature.ts 中未使用的 body 参数 bug - 移除 UserManagement.vue 中未使用的 StatusHelper 导入
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import axios, { AxiosRequestConfig } from 'axios'
|
||||
import axios, { InternalAxiosRequestConfig } from 'axios'
|
||||
import { generateSignatureHeaders } from './signature'
|
||||
import { checkApiPermission } from './permission'
|
||||
|
||||
@@ -8,7 +8,7 @@ const request = axios.create({
|
||||
})
|
||||
|
||||
request.interceptors.request.use(
|
||||
(config: AxiosRequestConfig) => {
|
||||
(config: InternalAxiosRequestConfig) => {
|
||||
const token = localStorage.getItem('token')
|
||||
if (token) {
|
||||
config.headers = config.headers || {}
|
||||
|
||||
@@ -16,7 +16,7 @@ export function generateSignature(
|
||||
timestamp: number,
|
||||
nonce: string
|
||||
): string {
|
||||
const stringToSign = buildStringToSign(method, path, query, '', timestamp, nonce)
|
||||
const stringToSign = buildStringToSign(method, path, query, body, timestamp, nonce)
|
||||
|
||||
const signature = CryptoJS.HmacSHA256(stringToSign, SIGNATURE_SECRET)
|
||||
const signatureBase64 = CryptoJS.enc.Base64.stringify(signature)
|
||||
|
||||
Reference in New Issue
Block a user