From e5627f9b1c4f083cba83dfa035003c89fd52a7c6 Mon Sep 17 00:00:00 2001 From: "Stormeye.Wu" Date: Sun, 2 Sep 2018 23:13:25 +0800 Subject: [PATCH] fix crash issue --- pages/index/index.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/pages/index/index.js b/pages/index/index.js index f082ae4..db85539 100644 --- a/pages/index/index.js +++ b/pages/index/index.js @@ -45,15 +45,23 @@ Page({ success: ({ code }) => { + var usrdata = { + appId: config.weapp.AppId, + code: code, + sceneAddress: app.globalData.sceneAddress, + } + if (app.globalData.locationInfo) { + usrdata = { + appId: config.weapp.AppId, + code: code, + sceneAddress: app.globalData.sceneAddress, + latitude: '' + app.globalData.locationInfo.latitude, + longitude: '' + app.globalData.locationInfo.longitude, + } + } Http.post({ url: config.api.login, - data: { - appId: config.weapp.AppId, - code: code, - sceneAddress: app.globalData.sceneAddress, - latitude: '' + app.globalData.locationInfo.latitude, - longitude: '' + app.globalData.locationInfo.longitude, - } + data: usrdata }) .then(res => { console.log("userlogin:app", res);