This commit is contained in:
张成
2025-12-16 10:55:59 +08:00
parent 3f1739e221
commit 4d712f8332
4 changed files with 15 additions and 15 deletions

View File

@@ -99,7 +99,7 @@ module.exports = {
- **请求头**:
```
Content-Type: application/json
Authorization: Bearer ${token}
Authorization: ${token}
```
- **请求参数**:
```json
@@ -157,7 +157,7 @@ module.exports = {
- **请求头**:
```
Content-Type: multipart/form-data
Authorization: Bearer ${token}
Authorization: ${token}
```
- **请求参数**Form Data:
| 参数名 | 类型 | 必填 | 说明 |
@@ -187,7 +187,7 @@ module.exports = {
// 发送请求
form.submit('http://api.example.com/api/file/upload_version', {
headers: {
'Authorization': `Bearer ${token}`
'Authorization': `${token}`
}
}, callback);
```
@@ -224,7 +224,7 @@ module.exports = {
- **请求头**:
```
Content-Type: application/json
Authorization: Bearer ${token}
Authorization: ${token}
```
- **请求参数**:
```json
@@ -290,8 +290,8 @@ module.exports = {
1. **Token 配置**
- 确保 `config/appConfig.js` 中有有效的 `token`
- Token 用于 API 认证,格式为 `Bearer ${token}`
- 所有接口请求都需要在请求头中包含 `Authorization: Bearer ${token}`
- Token 用于 API 认证,格式为 `${token}`
- 所有接口请求都需要在请求头中包含 `Authorization: ${token}`
2. **接口路径**
- 所有接口路径前缀为 `/api`
@@ -432,7 +432,7 @@ async function createVersion() {
status: 1
}, {
headers: {
'Authorization': `Bearer ${token}`,
'Authorization': `${token}`,
'Content-Type': 'application/json'
}
});
@@ -472,7 +472,7 @@ async function uploadVersionFile(versionId) {
const response = await axios.post('http://api.example.com/api/file/upload_version', form, {
headers: {
'Authorization': `Bearer ${token}`,
'Authorization': `${token}`,
...form.getHeaders()
},
maxContentLength: Infinity,
@@ -494,7 +494,7 @@ async function updateVersionDownloadUrl(versionId, downloadUrl, fileHash) {
file_hash: fileHash
}, {
headers: {
'Authorization': `Bearer ${token}`,
'Authorization': `${token}`,
'Content-Type': 'application/json'
}
});
@@ -536,7 +536,7 @@ async function publishVersion() {
```bash
curl -X POST http://api.example.com/api/version/create \
-H "Authorization: Bearer your-token-here" \
-H "Authorization: your-token-here" \
-H "Content-Type: application/json" \
-d '{
"version": "1.0.0",
@@ -556,7 +556,7 @@ curl -X POST http://api.example.com/api/version/create \
```bash
curl -X POST http://api.example.com/api/file/upload_version \
-H "Authorization: Bearer your-token-here" \
-H "Authorization: your-token-here" \
-F "file=@./dist/app-1.0.0.exe" \
-F "version=1.0.0" \
-F "platform=win32" \