feat: support login by following wechat official account (#1284)

* show QRcode when click WeChat Icon

* update how to show qrcode

* handle wechat scan qrcode

* fix api problems

* fix url problems

* fix problems

* modify get frequency

* remove useless print

* fix:fix PR problems

* fix: fix PR problems

* fix:fix PR problem

* fix IMG load delay problems

* fix:fix provider problems

* fix test problems

* use gofumpt to fmt code

* fix:delete useless variables

* feat:add button for follow official account

* fix:fix review problems

* use gofumpt to fmt code

* fix:fix scantype problems

* fix Response problem

* use gofumpt to format code
This commit is contained in:
Mr Forest
2022-11-13 15:05:15 +08:00
committed by GitHub
parent 462a82a3d5
commit aa6a4dc74f
19 changed files with 313 additions and 11 deletions

View File

@ -14,6 +14,9 @@
import React from "react";
import {Alert, Button, Result, message} from "antd";
import {getWechatMessageEvent} from "./AuthBackend";
import * as Setting from "../Setting";
import * as Provider from "./Provider";
export function showMessage(type, text) {
if (type === "success") {
@ -150,3 +153,12 @@ export function getQueryParamsFromState(state) {
return query;
}
}
export function getEvent(application, provider) {
getWechatMessageEvent()
.then(res => {
if (res.data === "SCAN" || res.data === "subscribe") {
Setting.goToLink(Provider.getAuthUrl(application, provider, "signup"));
}
});
}