Commit de9d2234 authored by tao.huang's avatar tao.huang

fix: init后置

parent ad54cbc6
...@@ -22,7 +22,7 @@ const init = (SENSORS_URL) => { ...@@ -22,7 +22,7 @@ const init = (SENSORS_URL) => {
enableVue3MpClick(); enableVue3MpClick();
sensors.init(); // sensors.init();
}; };
const login = (ext) => { const login = (ext) => {
......
...@@ -10,6 +10,7 @@ import { ...@@ -10,6 +10,7 @@ import {
} from "../api/user.js"; } from "../api/user.js";
import { useGlobalStore } from "./global.js"; import { useGlobalStore } from "./global.js";
import { useHomeStore } from "./home.js"; import { useHomeStore } from "./home.js";
import md from "../md.js";
const globalStore = useGlobalStore(); const globalStore = useGlobalStore();
...@@ -158,16 +159,18 @@ export const useUserStore = defineStore("userInfo", { ...@@ -158,16 +159,18 @@ export const useUserStore = defineStore("userInfo", {
async wxAutoLogin() { async wxAutoLogin() {
uni.login({ uni.login({
provider: "weixin", provider: "weixin",
success: (res) => { success: async(res) => {
console.log("wxAutoLogin", res); console.log("wxAutoLogin", res);
if (res.errMsg === "login:ok") { if (res.errMsg === "login:ok") {
this.autoLoginByCode(res.code); await this.autoLoginByCode(res.code);
} else { } else {
uni.showToast({ uni.showToast({
title: res.errMsg, title: res.errMsg,
icon: "error", icon: "error",
}); });
} }
md.sensors.init();
}, },
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment