mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-09-05 23:56:42 +08:00
fix
This commit is contained in:
@@ -67,8 +67,8 @@ const refreshPending = ref(false)
|
|||||||
const sort = ref('name')
|
const sort = ref('name')
|
||||||
// 阿里云盘认证对话框
|
// 阿里云盘认证对话框
|
||||||
const aliyunAuthDialog = ref(false)
|
const aliyunAuthDialog = ref(false)
|
||||||
// 阿里云盘认证参数
|
// 阿里云盘用户信息
|
||||||
const aliyunParams = ref<{ [key: string]: any }>({})
|
const aliyunUserInfo = ref<{ [key: string]: any }>({})
|
||||||
|
|
||||||
// 计算属性
|
// 计算属性
|
||||||
const storagesArray = computed(() => {
|
const storagesArray = computed(() => {
|
||||||
@@ -83,11 +83,11 @@ function loadingChanged(loading: number) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询阿里云token
|
// 查询阿里云token
|
||||||
async function loadAliyunParams() {
|
async function loadAliyunUserInfo() {
|
||||||
try {
|
try {
|
||||||
const result: { [key: string]: any } = await api.get('system/setting/UserAliyunParams')
|
const result: { [key: string]: any } = await api.get('aliyun/userinfo')
|
||||||
if (result.success) {
|
if (result.success) {
|
||||||
aliyunParams.value = result.data?.value
|
aliyunUserInfo.value = result
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
@@ -97,8 +97,8 @@ async function loadAliyunParams() {
|
|||||||
// 存储切换
|
// 存储切换
|
||||||
async function storageChanged(storage: string) {
|
async function storageChanged(storage: string) {
|
||||||
if (storage == 'aliyun') {
|
if (storage == 'aliyun') {
|
||||||
await loadAliyunParams()
|
await loadAliyunUserInfo()
|
||||||
if (isNullOrEmptyObject(aliyunParams.value)) {
|
if (isNullOrEmptyObject(aliyunUserInfo.value)) {
|
||||||
aliyunAuthDialog.value = true
|
aliyunAuthDialog.value = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,20 +27,8 @@ const UserAliyunParams = ref({})
|
|||||||
// timeout定时器
|
// timeout定时器
|
||||||
let timeoutTimer: NodeJS.Timeout | undefined = undefined
|
let timeoutTimer: NodeJS.Timeout | undefined = undefined
|
||||||
|
|
||||||
// 存储认证数据
|
|
||||||
async function saveAliyunParams() {
|
|
||||||
if (isNullOrEmptyObject(UserAliyunParams.value)) return
|
|
||||||
try {
|
|
||||||
await api.post('system/setting/UserAliyunParams', UserAliyunParams.value)
|
|
||||||
} catch (error) {
|
|
||||||
console.log(error)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 完成
|
// 完成
|
||||||
async function handleDone() {
|
async function handleDone() {
|
||||||
// 存储认证数据
|
|
||||||
await saveAliyunParams()
|
|
||||||
emit('done')
|
emit('done')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -78,7 +66,7 @@ async function checkQrcode() {
|
|||||||
UserAliyunParams.value = result.data
|
UserAliyunParams.value = result.data
|
||||||
handleDone()
|
handleDone()
|
||||||
} else if (qrCodeStatus == 'NEW' || qrCodeStatus == 'SCANED') {
|
} else if (qrCodeStatus == 'NEW' || qrCodeStatus == 'SCANED') {
|
||||||
alertType.value = 'warning'
|
alertType.value = 'info'
|
||||||
// 新建、待扫码
|
// 新建、待扫码
|
||||||
clearTimeout(timeoutTimer)
|
clearTimeout(timeoutTimer)
|
||||||
timeoutTimer = setTimeout(checkQrcode, 3000)
|
timeoutTimer = setTimeout(checkQrcode, 3000)
|
||||||
|
|||||||
Reference in New Issue
Block a user