mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-27 11:10:12 +08:00
fix(U115AuthDialog): 添加配置支持和自定义Cookie输入
This commit is contained in:
@@ -147,7 +147,13 @@ onMounted(() => {
|
|||||||
@close="aliyunAuthDialog = false"
|
@close="aliyunAuthDialog = false"
|
||||||
@done="handleDone"
|
@done="handleDone"
|
||||||
/>
|
/>
|
||||||
<U115AuthDialog v-if="u115AuthDialog" v-model="u115AuthDialog" @close="u115AuthDialog = false" @done="handleDone" />
|
<U115AuthDialog
|
||||||
|
v-if="u115AuthDialog"
|
||||||
|
v-model="u115AuthDialog"
|
||||||
|
:conf="props.storage.config || {}"
|
||||||
|
@close="u115AuthDialog = false"
|
||||||
|
@done="handleDone"
|
||||||
|
/>
|
||||||
<RcloneConfigDialog
|
<RcloneConfigDialog
|
||||||
v-if="rcloneConfigDialog"
|
v-if="rcloneConfigDialog"
|
||||||
v-model="rcloneConfigDialog"
|
v-model="rcloneConfigDialog"
|
||||||
|
|||||||
@@ -1,6 +1,15 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import api from '@/api'
|
import api from '@/api'
|
||||||
import QrcodeVue from 'qrcode.vue'
|
import QrcodeVue from 'qrcode.vue'
|
||||||
|
import { VCardItem, VTextField } from 'vuetify/lib/components/index.mjs'
|
||||||
|
|
||||||
|
// 定义输入
|
||||||
|
const props = defineProps({
|
||||||
|
conf: {
|
||||||
|
type: Object as PropType<{ [key: string]: any }>,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
// 定义事件
|
// 定义事件
|
||||||
const emit = defineEmits(['done', 'close'])
|
const emit = defineEmits(['done', 'close'])
|
||||||
@@ -9,7 +18,7 @@ const emit = defineEmits(['done', 'close'])
|
|||||||
const qrCodeContent = ref('')
|
const qrCodeContent = ref('')
|
||||||
|
|
||||||
// 下方的提示信息
|
// 下方的提示信息
|
||||||
const text = ref('请使用微信或115客户端扫码')
|
const text = ref('请使用微信或115客户端扫码,或在下方输入Cookie')
|
||||||
|
|
||||||
// 提醒类型
|
// 提醒类型
|
||||||
const alertType = ref<'success' | 'info' | 'error' | 'warning' | undefined>('info')
|
const alertType = ref<'success' | 'info' | 'error' | 'warning' | undefined>('info')
|
||||||
@@ -19,6 +28,9 @@ let timeoutTimer: NodeJS.Timeout | undefined = undefined
|
|||||||
|
|
||||||
// 完成
|
// 完成
|
||||||
async function handleDone() {
|
async function handleDone() {
|
||||||
|
if (props.conf?.cookie) {
|
||||||
|
await savaAlistConfig()
|
||||||
|
}
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,6 +83,15 @@ async function checkQrcode() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 保存cookie设置
|
||||||
|
async function savaAlistConfig() {
|
||||||
|
try {
|
||||||
|
await api.post(`storage/save/u115`, props.conf)
|
||||||
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await getQrcode()
|
await getQrcode()
|
||||||
timeoutTimer = setTimeout(checkQrcode, 3000)
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
@@ -93,6 +114,13 @@ onUnmounted(() => {
|
|||||||
<template #prepend />
|
<template #prepend />
|
||||||
</VAlert>
|
</VAlert>
|
||||||
</VCardText>
|
</VCardText>
|
||||||
|
<VCardText>
|
||||||
|
<VRow>
|
||||||
|
<VCol class="mt-2">
|
||||||
|
<VTextField label="自定义Cookie" v-model="props.conf.cookie" outlined dense />
|
||||||
|
</VCol>
|
||||||
|
</VRow>
|
||||||
|
</VCardText>
|
||||||
<VCardActions>
|
<VCardActions>
|
||||||
<VSpacer />
|
<VSpacer />
|
||||||
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
<VBtn variant="elevated" @click="handleDone" prepend-icon="mdi-check" class="px-5 me-3"> 完成 </VBtn>
|
||||||
|
|||||||
Reference in New Issue
Block a user