✨ add qq oauth2 support / start landing page
This commit is contained in:
@@ -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
18
src/api/oauth/qq.ts
Normal 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
|
||||
}
|
||||
}
|
||||
);
|
||||
};
|
@@ -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
|
||||
|
Reference in New Issue
Block a user