微信公众号登录:登录逻辑的接入

This commit is contained in:
YunaiV
2023-12-23 10:01:58 +08:00
parent 2bfd7474cf
commit 1c218cd730
2 changed files with 42 additions and 35 deletions
+5 -2
View File
@@ -11,9 +11,12 @@
onLoad(async (options) => {
// #ifdef H5
let event = '';
if (options.login_code) {
new URLSearchParams(location.search).forEach((value, key) => {
options[key] = value;
});
if (options.code) {
event = 'login';
const { error } = await sheep.$platform.useProvider().login(options.login_code);
const { error } = await sheep.$platform.useProvider().login(options.code, options.state);
if (error === 0) {
sheep.$store('user').getInfo();
}