Skip to content

生成路径凭证

URL 路径凭证参数是完整的 API Headers 信息,其中 Headers 的 X-Fresns-Signature 参数同 API 的生成规则一致。

URL 凭证数据

json
{
    "X-Fresns-App-Id": "yh1OJ7WL",
    "X-Fresns-Client-Platform-Id": 2,
    "X-Fresns-Client-Version": "2.0.0",
    "X-Fresns-Client-Device-Info": "", // 先压缩 Object 信息并转换为字符串,再将字符串以 Base64 编码
    "X-Fresns-Client-Lang-Tag": "zh-Hans", // 可留空或不传
    "X-Fresns-Client-Timezone": "+8", // 可留空或不传
    "X-Fresns-Client-Content-Format": null, // 可留空或不传
    "X-Fresns-Aid": "wIfu6jaF",
    "X-Fresns-Aid-Token": "uoX1hk6SHUgB2MFGJwNx38dem9DA7Vsz",
    "X-Fresns-Uid": 782622,
    "X-Fresns-Uid-Token": "PqBpwPLJgfd1sH0X5JffYFGxTSc8RW7c",
    "X-Fresns-Signature": "a2bda6bb6f21a3d41c78630401de2c17", // 签名生成规则与 headers 一致
    "X-Fresns-Signature-Timestamp": 1674161913192
}

URL 凭证值

1、将凭证数据压缩并转为字符串

json
{"X-Fresns-App-Id":"yh1OJ7WL","X-Fresns-Client-Platform-Id":2,"X-Fresns-Client-Version":"2.0.0","X-Fresns-Client-Device-Info":"","X-Fresns-Client-Lang-Tag":"zh-Hans","X-Fresns-Client-Timezone":"+8","X-Fresns-Client-Content-Format":null,"X-Fresns-Aid":"wIfu6jaF","X-Fresns-Aid-Token":"uoX1hk6SHUgB2MFGJwNx38dem9DA7Vsz","X-Fresns-Uid":782622,"X-Fresns-Uid-Token":"PqBpwPLJgfd1sH0X5JffYFGxTSc8RW7c","X-Fresns-Signature":"a2bda6bb6f21a3d41c78630401de2c17","X-Fresns-Signature-Timestamp":1674161913192}

2、将字符串数据以 Base64 编码

eyJYLUZyZXNucy1BcHAtSWQiOiJ5aDFPSjdXTCIsIlgtRnJlc25zLUNsaWVudC1QbGF0Zm9ybS1JZCI6MiwiWC1GcmVzbnMtQ2xpZW50LVZlcnNpb24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iJQcUJwd1BMSmdmZDFzSDBYNUpmZllGR3hUU2M4Ulc3YyIsIlgtRnJlc25zLVNpZ25hdHVyZSI6ImEyYmRhNmJiNmYyMWEzZDQxYzc4NjMwNDAxZGUyYzE3IiwiWC1GcmVzbnMtU2lnbmF0dXJlLVRpbWVzdGFtcCI6MTY3NDE2MTkxMzE5Mn0%3D

经过 Base64 和 URL 编码后的值,便是插件 URL 凭证值。

Released under the Apache-2.0 License