diff --git a/src/components/cards/StorageCard.vue b/src/components/cards/StorageCard.vue
index a672582b..004d5c4a 100644
--- a/src/components/cards/StorageCard.vue
+++ b/src/components/cards/StorageCard.vue
@@ -144,6 +144,7 @@ onMounted(() => {
diff --git a/src/components/dialog/AliyunAuthDialog.vue b/src/components/dialog/AliyunAuthDialog.vue
index 36a8bc9a..4b1013bd 100644
--- a/src/components/dialog/AliyunAuthDialog.vue
+++ b/src/components/dialog/AliyunAuthDialog.vue
@@ -2,6 +2,14 @@
import QrcodeVue from 'qrcode.vue'
import api from '@/api'
+// 定义输入
+const props = defineProps({
+ conf: {
+ type: Object as PropType<{ [key: string]: any }>,
+ required: true,
+ },
+})
+
// 定义事件
const emit = defineEmits(['done', 'close'])
@@ -25,6 +33,10 @@ let timeoutTimer: NodeJS.Timeout | undefined = undefined
// 完成
async function handleDone() {
+ clearTimeout(timeoutTimer)
+ if (props.conf?.refreshToken) {
+ await savaAliPanConfig()
+ }
emit('done')
}
@@ -75,6 +87,15 @@ async function checkQrcode() {
}
}
+// 保存cookie设置
+async function savaAliPanConfig() {
+ try {
+ await api.post(`storage/save/alipan`, props.conf)
+ } catch (e) {
+ console.error(e)
+ }
+}
+
onMounted(async () => {
await getQrcode()
timeoutTimer = setTimeout(checkQrcode, 3000)
@@ -97,6 +118,13 @@ onUnmounted(() => {
+
+
+
+
+
+
+
完成
diff --git a/src/components/dialog/U115AuthDialog.vue b/src/components/dialog/U115AuthDialog.vue
index a699ea6f..361bc505 100644
--- a/src/components/dialog/U115AuthDialog.vue
+++ b/src/components/dialog/U115AuthDialog.vue
@@ -28,8 +28,9 @@ let timeoutTimer: NodeJS.Timeout | undefined = undefined
// 完成
async function handleDone() {
+ clearTimeout(timeoutTimer)
if (props.conf?.cookie) {
- await savaAlistConfig()
+ await savaU115Config()
}
emit('done')
}
@@ -84,7 +85,7 @@ async function checkQrcode() {
}
// 保存cookie设置
-async function savaAlistConfig() {
+async function savaU115Config() {
try {
await api.post(`storage/save/u115`, props.conf)
} catch (e) {
diff --git a/src/components/dialog/UserAuthDialog.vue b/src/components/dialog/UserAuthDialog.vue
index b2d4ffa9..200260bd 100644
--- a/src/components/dialog/UserAuthDialog.vue
+++ b/src/components/dialog/UserAuthDialog.vue
@@ -1,4 +1,5 @@