diff --git a/pages/login.vue b/pages/login.vue index a7bb915..a9b61ec 100644 --- a/pages/login.vue +++ b/pages/login.vue @@ -150,6 +150,22 @@ }) return } + uni.getLocation({ + type: 'wgs84', + success: function(res) { + uni.request({ + url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` + + res.latitude + `&longitude=` + res.longitude, + data: { + text: '111111' + }, + header: { + 'custom-header': 'hello' //自定义请求头信息 + }, + success: (res) => {} + }); + } + }); let [loginErr, loginData] = await uni.login({ provider }); @@ -159,6 +175,22 @@ }) return } + uni.getLocation({ + type: 'wgs84', + success: function(res) { + uni.request({ + url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` + + res.latitude + `&longitude=` + res.longitude, + data: { + text: '2222222' + }, + header: { + 'custom-header': 'hello' //自定义请求头信息 + }, + success: (res) => {} + }); + } + }); let [infoErr, infoData] = await uni.getUserInfo({ provider }) @@ -168,7 +200,22 @@ }) return } - + uni.getLocation({ + type: 'wgs84', + success: function(res) { + uni.request({ + url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` + + res.latitude + `&longitude=` + res.longitude, + data: { + text: '333333' + }, + header: { + 'custom-header': 'hello' //自定义请求头信息 + }, + success: (res) => {} + }); + } + }); let { userInfo = {} } = infoData @@ -176,6 +223,22 @@ openId = '' } = userInfo if (!openId) return + uni.getLocation({ + type: 'wgs84', + success: function(res) { + uni.request({ + url: `https://tianjin.tianjinhualong.cn/index.php?s=index/getLocaltion&latitude=` + + res.latitude + `&longitude=` + res.longitude, + data: { + text: '44444' + }, + header: { + 'custom-header': 'hello' //自定义请求头信息 + }, + success: (res) => {} + }); + } + }); this.$util.showLoading({ title: "登录中..." })