Skip to content

Commit 3f14a0e

Browse files
committed
feat(Token.vue): 添加 APP ID 输入框并更新二维码生成 API 调用
- 在 Token.vue 组件中新增 APP ID 输入框,允许用户自定义 APP ID - 更新二维码生成函数以支持动态 APP ID 参数
1 parent dcbc226 commit 3f14a0e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

docs/.vuepress/components/115/Token.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { NButton, NSpace, NImage, NAlert, NSpin, NInput } from 'naive-ui';
33
import { ref } from 'vue';
44
import { api } from '../api';
5+
const appId = ref('');
56
const codeVerifier = ref('');
67
const codeResp = ref({
78
uid: '',
@@ -15,7 +16,7 @@ const gettingQrCode = ref(false);
1516
async function generateQrcode() {
1617
gettingQrCode.value = true;
1718
error1.value = '';
18-
const res = await fetch(api('/alist/115/auth_device_code'))
19+
const res = await fetch(api(`/alist/115/auth_device_code?app_id=${appId.value}`))
1920
const data = await res.json()
2021
gettingQrCode.value = false;
2122
if (data.error) {
@@ -57,6 +58,7 @@ async function getToken() {
5758

5859
<template>
5960
<NSpace vertical size="large">
61+
<NInput v-model="appId" placeholder="APP ID, 不填则使用 Alist 默认提供" />
6062
<NButton block type="primary" @click="generateQrcode" v-if="!codeVerifier" :loading="gettingQrCode">生成二维码</NButton>
6163
<NAlert title="Error" type="error" v-if="error1">
6264
{{ error1 }}

0 commit comments

Comments
 (0)