feat: 彩虹登录支持选择多种登录方式

This commit is contained in:
xiaojunnuo
2026-05-14 01:39:22 +08:00
parent 45dedf5bc7
commit 7aa0c7e491
16 changed files with 371 additions and 88 deletions
@@ -114,7 +114,7 @@ export async function GetSmsTypeDefine(type: string) {
export async function GetOauthProviders() {
return await request({
url: "/oauth/providers",
url: apiPrefix + "/oauth/providers",
method: "post",
});
}
@@ -109,6 +109,7 @@ const formState = reactive<Partial<SysSettings>>({
const oauthProviders = ref([]);
async function loadOauthProviders() {
oauthProviders.value = await api.GetOauthProviders();
mergeOauthProviderSettings();
}
const bindDomain = computed(() => {
@@ -164,6 +165,16 @@ const onFinish = async (form: any) => {
function buildCallbackUrl(type: string) {
return `${window.location.origin}/api/oauth/callback/${type}`;
}
function mergeOauthProviderSettings() {
const savedProviders = formState.public?.oauthProviders || {};
for (const item of oauthProviders.value) {
const saved = savedProviders[item.name];
if (saved) {
item.addonId = saved.addonId;
}
}
}
</script>
<style lang="less">
.sys-settings-oauth {