| | |
| | | let { code } = loginRes; |
| | | let res = await that.$u.api.wxLogin({ code }) |
| | | if (res && res.code === 200) { |
| | | console.log(res, '==================登录成功'); |
| | | // 判断有无openid |
| | | if (res.data.openid) { |
| | | await that.$store.commit('setOpenid', res.data.openid) |
| | |
| | | // 判断有无用户信息 |
| | | if (res.data.member) { |
| | | await that.$store.commit('setUserInfo', res.data.member) |
| | | await that.$store.commit('setOpenid', res.data.member.openId) |
| | | } |
| | | // 设置定位 |
| | | await that.checkLocationAuth() |
| | |
| | | let info = data[0]; |
| | | console.log(info, '==================获取地址'); |
| | | locParam.province = info.province; |
| | | locParam.city = info.regeocodeData.addressComponent.city; |
| | | locParam.adcode = info.regeocodeData.addressComponent.adcode; |
| | | var ta = info.desc || '地址获取失败'; |
| | | locParam.address = ta |
| | | const resCity = await that.$u.api.getCityByName({ cityName: locParam.city }) |
| | | const resCity = await that.$u.api.getCityByName({ code: locParam.adcode }) |
| | | if (resCity.code === 200 && resCity.data) { |
| | | locParam.cityId = resCity.data.id |
| | | that.$store.commit('setPosition', locParam) |