add qq oauth2 support / start landing page

This commit is contained in:
landaiqing
2024-08-19 23:11:22 +08:00
parent 8998259791
commit 498807ca66
28 changed files with 1123 additions and 129 deletions

View File

@@ -3,9 +3,12 @@ import {service} from "@/utils/alova/service.ts";
/**
* Get Github OAuth URL
*/
export const getGithubUrl = () => {
export const getGithubUrl = (state: string) => {
return service.Get('/api/oauth/github/get_url',
{
params: {
state: state
},
meta: {
ignoreToken: true,
},

18
src/api/oauth/qq.ts Normal file
View File

@@ -0,0 +1,18 @@
import {service} from "@/utils/alova/service.ts";
export const getQQUrl = (state: string) => {
return service.Get('/api/oauth/qq/get_url',
{
params: {
state: state
},
meta: {
ignoreToken: true,
},
cacheFor: {
mode: "restore",
expire: 1000 * 60 * 60 * 24 * 30 // 30 days
}
}
);
};

View File

@@ -4,7 +4,7 @@ import {service} from "@/utils/alova/service.ts";
* 生成客户端id
*/
export const generateClientId = () => {
return service.Get('/api/oauth/generate_client_id',
return service.Get('/api/oauth/wechat/generate_client_id',
{
meta: {
ignoreToken: true,
@@ -21,7 +21,7 @@ export const generateClientId = () => {
* @param clientId
*/
export const generateQrCode = (clientId: string) => {
return service.Get('/api/oauth/get_temp_qrcode',
return service.Get('/api/oauth/wechat/get_temp_qrcode',
{
params: {
client_id: clientId