github oauth2 login / gitee oauth2 login

This commit is contained in:
landaiqing
2024-08-19 00:14:37 +08:00
parent 0c3edc360c
commit 8998259791
8 changed files with 231 additions and 31 deletions

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

@@ -0,0 +1,18 @@
import {service} from "@/utils/alova/service.ts";
/**
* 获取Gitee登录链接
*/
export const getGiteeUrl = () => {
return service.Get('/api/oauth/gitee/get_url',
{
meta: {
ignoreToken: true,
},
cacheFor: {
mode: "restore",
expire: 1000 * 60 * 60 * 24 * 30 // 30 days
}
}
);
};

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

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

View File

@@ -48,15 +48,3 @@ export const closeWebsocket = (clientId: string) => {
}
);
};
export const sendSocketMessage = (clientId: string) => {
return service.Get('/api/ws/send',
{
params: {
client_id: clientId
},
meta: {
ignoreToken: true,
},
}
);
};