Commit 0c30393d authored by spc's avatar spc

user

parent 51d27199
This diff is collapsed.
......@@ -306,6 +306,35 @@ export const useUserStore = defineStore("userInfo", {
});
},
/**
*
* @param {sy使用}
* @returns
*/
async normalAutoLogin(cb = null) {
uni.login({
provider: "weixin",
success: async (res) => {
if (res.errMsg === "login:ok") {
const { data } = await autoLoginByCode(res.code);
// 如果登录成功,获取用户信息和宝宝信息,更新到state中,方便全局使用
if (data && data.cuk) {
globalStore.setCuk(data.cuk, data.openId, data.unionId);
cb && cb();
}
} else {
uni.showToast({
title: res.errMsg,
icon: "error",
});
}
md.sensors.init();
},
});
},
async createBabyInfo(babyInfo) {
console.log("createBabyInfo:", babyInfo);
const res = await updateBabyInfo(babyInfo);
......
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