fix: oauth aff

This commit is contained in:
CalciumIon
2024-11-18 18:52:14 +08:00
parent 6a42ccf00e
commit 7db703374c
5 changed files with 188 additions and 13 deletions

View File

@@ -1,7 +1,12 @@
import { API, showError } from '../helpers';
export async function getOAuthState() {
const res = await API.get('/api/oauth/state');
let path = '/api/oauth/state';
let affCode = new URLSearchParams(window.location.search).get('aff');
if (affCode) {
path += `?aff=${affCode}`;
}
const res = await API.get(path);
const { success, message, data } = res.data;
if (success) {
return data;