@tmsfe/tms-core 0.0.108 → 0.0.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/cloudService.js +3 -4
- package/src/location/index.ts +12 -2
package/package.json
CHANGED
package/src/cloudService.js
CHANGED
|
@@ -37,11 +37,10 @@ export const callCloudFunc = async (name = '', data = {}, withAuth = true) => {
|
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
const res = await new Promise((resolve, reject) => {
|
|
40
|
-
const config = { env: cloudEnvId };
|
|
41
40
|
wx.cloud.callFunction({
|
|
42
41
|
name,
|
|
43
42
|
data: mergedData,
|
|
44
|
-
config,
|
|
43
|
+
config: { env: cloudEnvId },
|
|
45
44
|
success: (res) => {
|
|
46
45
|
let result = JSON.stringify(res);
|
|
47
46
|
if (result.length > 500) {
|
|
@@ -49,7 +48,7 @@ export const callCloudFunc = async (name = '', data = {}, withAuth = true) => {
|
|
|
49
48
|
}
|
|
50
49
|
const obj = {
|
|
51
50
|
name,
|
|
52
|
-
|
|
51
|
+
env: cloudEnvId,
|
|
53
52
|
params: JSON.stringify(mergedData),
|
|
54
53
|
res: result,
|
|
55
54
|
};
|
|
@@ -61,7 +60,7 @@ export const callCloudFunc = async (name = '', data = {}, withAuth = true) => {
|
|
|
61
60
|
fail: (err) => {
|
|
62
61
|
const obj = {
|
|
63
62
|
name,
|
|
64
|
-
|
|
63
|
+
env: cloudEnvId,
|
|
65
64
|
params: JSON.stringify(mergedData),
|
|
66
65
|
err: JSON.stringify(err),
|
|
67
66
|
};
|
package/src/location/index.ts
CHANGED
|
@@ -175,7 +175,12 @@ class Location extends LocationBase {
|
|
|
175
175
|
*/
|
|
176
176
|
getLocationDetail(showModalWhenCloseAuth = false, type = LocationType, content = '', getPoi = 0) {
|
|
177
177
|
return this.getLocation(showModalWhenCloseAuth, type, content)
|
|
178
|
-
.then((res: WxPostionType) =>
|
|
178
|
+
.then(async (res: WxPostionType) => {
|
|
179
|
+
const res2 = await this.getPoiInfo(res.latitude, res.longitude, getPoi);
|
|
180
|
+
// @ts-ignore
|
|
181
|
+
res2.accuracy = res.accuracy;
|
|
182
|
+
return res2;
|
|
183
|
+
})
|
|
179
184
|
.catch(err => Promise.reject(err));
|
|
180
185
|
}
|
|
181
186
|
|
|
@@ -211,7 +216,12 @@ class Location extends LocationBase {
|
|
|
211
216
|
*/
|
|
212
217
|
getLocationDetailSilent(getPoi = 0, type = 'gcj02') {
|
|
213
218
|
return this.getLocationSilent(type)
|
|
214
|
-
.then((res:
|
|
219
|
+
.then(async (res: WxPostionType) => {
|
|
220
|
+
const res2 = await this.getPoiInfo(res.latitude, res.longitude, getPoi);
|
|
221
|
+
// @ts-ignore
|
|
222
|
+
res2.accuracy = res.accuracy;
|
|
223
|
+
return res2;
|
|
224
|
+
})
|
|
215
225
|
.catch(err => Promise.reject(err));
|
|
216
226
|
}
|
|
217
227
|
|