feat: Oauth update
This commit is contained in:
@@ -20,6 +20,7 @@ import { observer } from "mobx-react";
|
||||
import FooterComponent from "@/components/Footer";
|
||||
import RotateCaptcha, { CaptchaInstance } from "react-rotate-captcha";
|
||||
import { get, load, verify } from "@/api/captcha/index.ts";
|
||||
import { oauthLogin } from "@/api/user";
|
||||
// import useStore from '@/utils/store/useStore.tsx'
|
||||
type LoginType = "account" | "phone";
|
||||
|
||||
@@ -53,6 +54,12 @@ export default observer(() => {
|
||||
key: "phone",
|
||||
},
|
||||
];
|
||||
|
||||
async function oAuthLogin(type: string) {
|
||||
const res: any = await oauthLogin(type);
|
||||
window.location.href = res.data;
|
||||
}
|
||||
|
||||
const [loginType, setLoginType] = useState<LoginType>("account");
|
||||
|
||||
const onSubmit = async (formData: object) => {
|
||||
@@ -359,6 +366,9 @@ export default observer(() => {
|
||||
borderRadius: "50%",
|
||||
}}>
|
||||
<GitlabOutlined
|
||||
onClick={() => {
|
||||
oAuthLogin("GITEE").then();
|
||||
}}
|
||||
style={{ ...iconStyles, color: "#FF6A10" }}
|
||||
/>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user