This commit is contained in:
fanxb 2023-10-21 11:31:29 +08:00
parent cabe83d07d
commit 164553abf0
3 changed files with 8 additions and 6 deletions

View File

@ -14,14 +14,14 @@ router["POST /qb/saveQbInfo"] = async function (ctx: Context) {
* qb配置
*/
router["GET /qb/config"] = async function (ctx: Context) {
ctx.body = await service.getAddress();
ctx.body = await service.getConfig();
};
/**
* qb配置
*/
router["GET /qb/bt/list"] = async function (ctx: Context) {
ctx.body = await service.getAddress();
ctx.body = await service.getBtList();
};

View File

@ -20,17 +20,19 @@ class QbService {
body.version = body ? (await get("/app/version", null)) : null;
return body;
}
a
/**
*
*/
static async getAddress(): Promise<QbConfigDto> {
static async getConfig(): Promise<QbConfigDto> {
return getQbInfo();
}
/**
* get torrents list from qb
*/
static async getBtList(): Promise<Array<BtListItemDto>> {
let res = await get("/api/v2/torrents/info?category=&sort=added_on", null);
return res;
}

View File

@ -5,7 +5,7 @@
{{ data.qbConfig.version ? data.qbConfig.version : "配置错误,无法访问" }}
</el-form-item>
<el-form-item label="访问地址">
<el-input type="text" v-model="data.qbConfig.address" placeholder="qb访问地址"/>
<el-input type="text" v-model="data.qbConfig.address" placeholder="例如:http://localhost:8080(仅支持v4.1及以上)"/>
</el-form-item>
<el-form-item label="用户名">
<el-input type="text" v-model="data.qbConfig.username" placeholder="qb访问用户名"/>