feat: 首页获取登录态
This commit is contained in:
2
dist/pages/home/index.js
vendored
2
dist/pages/home/index.js
vendored
File diff suppressed because one or more lines are too long
@@ -50,8 +50,21 @@ const Home = () => {
|
||||
const [openid, setopenid] = useState();
|
||||
const [isIn, setisIn] = useState(false);
|
||||
|
||||
|
||||
|
||||
const onChange = (e) => {};
|
||||
|
||||
useEffect(() => {
|
||||
getLogin();
|
||||
}, []);
|
||||
|
||||
const getLogin = async () => {
|
||||
let isLogin: any = await phoneLogin();
|
||||
console.log('isLogin',isLogin)
|
||||
setisIn(isLogin);
|
||||
};
|
||||
|
||||
|
||||
Taro.useShareAppMessage((res) => {
|
||||
if (res.from === "button") {
|
||||
// 来自页面内转发按钮
|
||||
@@ -374,10 +387,7 @@ const Home = () => {
|
||||
className="iconStyle"
|
||||
onClick={async () => {
|
||||
// getLocation();
|
||||
let isin: any = await phoneLogin();
|
||||
setisIn(true);
|
||||
console.log("isin", isin);
|
||||
if (isin) {
|
||||
if (isIn) {
|
||||
// 获取定位信息
|
||||
Taro.getLocation({
|
||||
type: "gcj02", //返回可以用于 Taro.openLocation的经纬度
|
||||
|
||||
Reference in New Issue
Block a user