mirror of
https://github.com/LLM-Red-Team/qwen-free-api.git
synced 2024-12-22 20:49:21 +08:00
login_tongyi_ticket已失效,改为使用tongyi_sso_ticket
This commit is contained in:
parent
f727286a33
commit
a9126f1d12
12
README.md
12
README.md
@ -100,9 +100,9 @@ https://udify.app/chat/qOXzVl5kkvhQXM8r
|
|||||||
|
|
||||||
从 [通义千问](https://tongyi.aliyun.com/qianwen) 登录
|
从 [通义千问](https://tongyi.aliyun.com/qianwen) 登录
|
||||||
|
|
||||||
进入通义千问随便发起一个对话,然后F12打开开发者工具,从Application > Cookies中找到`login_tongyi_ticket`的值,这将作为Authorization的Bearer Token值:`Authorization: Bearer TOKEN`
|
进入通义千问随便发起一个对话,然后F12打开开发者工具,从Application > Cookies中找到`tongyi_sso_ticket`的值,这将作为Authorization的Bearer Token值:`Authorization: Bearer TOKEN`
|
||||||
|
|
||||||
![获取login_tongyi_ticket](./doc/example-0.png)
|
![获取tongyi_sso_ticket](./doc/example-0.png)
|
||||||
|
|
||||||
### 方法2
|
### 方法2
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ https://udify.app/chat/qOXzVl5kkvhQXM8r
|
|||||||
|
|
||||||
### 多账号接入
|
### 多账号接入
|
||||||
|
|
||||||
你可以通过提供多个账号的login_tongyi_ticket或login_aliyunid_ticket,并使用,拼接提供:
|
你可以通过提供多个账号的tongyi_sso_ticket或login_aliyunid_ticket,并使用,拼接提供:
|
||||||
|
|
||||||
Authorization: Bearer TOKEN1,TOKEN2,TOKEN3
|
Authorization: Bearer TOKEN1,TOKEN2,TOKEN3
|
||||||
|
|
||||||
@ -260,7 +260,7 @@ pm2 stop qwen-free-api
|
|||||||
header 需要设置 Authorization 头部:
|
header 需要设置 Authorization 头部:
|
||||||
|
|
||||||
```
|
```
|
||||||
Authorization: Bearer [login_tongyi_ticket/login_aliyunid_ticket]
|
Authorization: Bearer [tongyi_sso_ticket/login_aliyunid_ticket]
|
||||||
```
|
```
|
||||||
|
|
||||||
请求数据:
|
请求数据:
|
||||||
@ -317,7 +317,7 @@ Authorization: Bearer [login_tongyi_ticket/login_aliyunid_ticket]
|
|||||||
header 需要设置 Authorization 头部:
|
header 需要设置 Authorization 头部:
|
||||||
|
|
||||||
```
|
```
|
||||||
Authorization: Bearer [login_tongyi_ticket/login_aliyunid_ticket]
|
Authorization: Bearer [tongyi_sso_ticket/login_aliyunid_ticket]
|
||||||
```
|
```
|
||||||
|
|
||||||
请求数据:
|
请求数据:
|
||||||
@ -467,7 +467,7 @@ Authorization: Bearer [refresh_token]
|
|||||||
|
|
||||||
### ticket存活检测
|
### ticket存活检测
|
||||||
|
|
||||||
检测login_tongyi_ticket或login_aliyunid_ticket是否存活,如果存活live未true,否则为false,请不要频繁(小于10分钟)调用此接口。
|
检测tongyi_sso_ticket或login_aliyunid_ticket是否存活,如果存活live未true,否则为false,请不要频繁(小于10分钟)调用此接口。
|
||||||
|
|
||||||
**POST /token/check**
|
**POST /token/check**
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ const FILE_MAX_SIZE = 100 * 1024 * 1024;
|
|||||||
*
|
*
|
||||||
* 在对话流传输完毕后移除会话,避免创建的会话出现在用户的对话列表中
|
* 在对话流传输完毕后移除会话,避免创建的会话出现在用户的对话列表中
|
||||||
*
|
*
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
*/
|
*/
|
||||||
async function removeConversation(convId: string, ticket: string) {
|
async function removeConversation(convId: string, ticket: string) {
|
||||||
const result = await axios.post(
|
const result = await axios.post(
|
||||||
@ -73,7 +73,7 @@ async function removeConversation(convId: string, ticket: string) {
|
|||||||
*
|
*
|
||||||
* @param model 模型名称
|
* @param model 模型名称
|
||||||
* @param messages 参考gpt系列消息格式,多轮对话请完整提供上下文
|
* @param messages 参考gpt系列消息格式,多轮对话请完整提供上下文
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
* @param refConvId 引用的会话ID
|
* @param refConvId 引用的会话ID
|
||||||
* @param retryCount 重试次数
|
* @param retryCount 重试次数
|
||||||
*/
|
*/
|
||||||
@ -166,7 +166,7 @@ async function createCompletion(
|
|||||||
*
|
*
|
||||||
* @param model 模型名称
|
* @param model 模型名称
|
||||||
* @param messages 参考gpt系列消息格式,多轮对话请完整提供上下文
|
* @param messages 参考gpt系列消息格式,多轮对话请完整提供上下文
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
* @param refConvId 引用的会话ID
|
* @param refConvId 引用的会话ID
|
||||||
* @param retryCount 重试次数
|
* @param retryCount 重试次数
|
||||||
*/
|
*/
|
||||||
@ -689,7 +689,7 @@ async function receiveImages(
|
|||||||
/**
|
/**
|
||||||
* 获取上传参数
|
* 获取上传参数
|
||||||
*
|
*
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
*/
|
*/
|
||||||
async function acquireUploadParams(ticket: string) {
|
async function acquireUploadParams(ticket: string) {
|
||||||
const result = await axios.post(
|
const result = await axios.post(
|
||||||
@ -739,7 +739,7 @@ async function checkFileUrl(fileUrl: string) {
|
|||||||
* 上传文件
|
* 上传文件
|
||||||
*
|
*
|
||||||
* @param fileUrl 文件URL
|
* @param fileUrl 文件URL
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
*/
|
*/
|
||||||
async function uploadFile(fileUrl: string, ticket: string) {
|
async function uploadFile(fileUrl: string, ticket: string) {
|
||||||
// 预检查远程文件URL可用性
|
// 预检查远程文件URL可用性
|
||||||
@ -909,19 +909,14 @@ function tokenSplit(authorization: string) {
|
|||||||
/**
|
/**
|
||||||
* 生成Cookies
|
* 生成Cookies
|
||||||
*
|
*
|
||||||
* @param ticket login_tongyi_ticket或login_aliyunid_ticket
|
* @param ticket tongyi_sso_ticket或login_aliyunid_ticket
|
||||||
*/
|
*/
|
||||||
function generateCookie(ticket: string) {
|
function generateCookie(ticket: string) {
|
||||||
return [
|
return [
|
||||||
`${ticket.length > 100 ? 'login_aliyunid_ticket' : 'login_tongyi_ticket'}=${ticket}`,
|
`${ticket.length > 100 ? 'login_aliyunid_ticket' : 'tongyi_sso_ticket'}=${ticket}`,
|
||||||
'aliyun_choice=intl',
|
'aliyun_choice=intl',
|
||||||
"_samesite_flag_=true",
|
"_samesite_flag_=true",
|
||||||
`t=${util.uuid(false)}`,
|
`t=${util.uuid(false)}`,
|
||||||
"channel=oug71n2fX3Jd5ualEfKACRvnsceUtpjUC5jHBpfWnSOXKhkvBNuSO8bG3v4HHjCgB722h7LqbHkB6sAxf3OvgA%3D%3D",
|
|
||||||
"currentRegionId=cn-shenzhen",
|
|
||||||
"aliyun_country=CN",
|
|
||||||
"aliyun_lang=zh",
|
|
||||||
"aliyun_site=CN",
|
|
||||||
// `login_aliyunid_csrf=_csrf_tk_${util.generateRandomString({ charset: 'numeric', length: 15 })}`,
|
// `login_aliyunid_csrf=_csrf_tk_${util.generateRandomString({ charset: 'numeric', length: 15 })}`,
|
||||||
// `cookie2=${util.uuid(false)}`,
|
// `cookie2=${util.uuid(false)}`,
|
||||||
// `munb=22${util.generateRandomString({ charset: 'numeric', length: 11 })}`,
|
// `munb=22${util.generateRandomString({ charset: 'numeric', length: 11 })}`,
|
||||||
|
Loading…
Reference in New Issue
Block a user