refactor: 优化bgm授权

This commit is contained in:
wushuo
2025-11-30 16:25:12 +08:00
parent 5f2f7ad492
commit fad1cecd13
2 changed files with 7 additions and 2 deletions

View File

@@ -139,7 +139,7 @@
},
load(code, authorization) {
this.loading = true
fetch(`/api/bgm/oauth/callback?code=${code}&s=${authorization}`)
fetch(`api/bgm/oauth/callback?code=${code}&s=${authorization}`)
.then(res => res.json())
.then(async res => {
let {code, message} = res

View File

@@ -100,13 +100,18 @@
import {ElText} from "element-plus";
import api from "@/js/api.js";
import BangumiMe from "@/config/basic/BangumiMe.vue";
import {onMounted} from "vue";
let bangumiMe = ref()
let props = defineProps(['config'])
let setRedirectUri = () => {
props.config['bgmRedirectUri'] = `${location.href}bgm/oauth/callback.html`
let redirectUri = location.href
if (!redirectUri.endsWith("/")) {
redirectUri += '/';
}
props.config['bgmRedirectUri'] = redirectUri + 'BgmOauthCallback.html'
}
onMounted(() => {