q-koa 12.3.2 → 12.3.3

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.
@@ -295,10 +295,10 @@ exports.swagger = async (ctx) => {
295
295
  ctx.SUCCESS(apis)
296
296
  }
297
297
 
298
- exports.getLocation = async (ctx) => {
298
+ exports.getLocation = async (ctx, _data) => {
299
299
  const { app } = getAppByCtx(ctx)
300
300
 
301
- const { provinceName, cityName, address } = ctx.request.body
301
+ const { provinceName, cityName, address } = _data || ctx.request.body
302
302
  if (!provinceName || !cityName || !address) {
303
303
  return ctx.SUCCESS({
304
304
  longitude: null,
@@ -320,16 +320,21 @@ exports.getLocation = async (ctx) => {
320
320
 
321
321
  const { lng: longitude, lat: latitude } = result.location
322
322
 
323
- return ctx.SUCCESS({
323
+ ctx.SUCCESS({
324
324
  longitude,
325
325
  latitude,
326
326
  })
327
+
328
+ return {
329
+ longitude,
330
+ latitude,
331
+ }
327
332
  }
328
333
 
329
- exports.getLngAndLat = async (ctx) => {
334
+ exports.getLngAndLat = async (ctx, _data) => {
330
335
  const { app } = getAppByCtx(ctx)
331
336
 
332
- const { longitude, latitude } = ctx.request.body
337
+ const { longitude, latitude } = _data || ctx.request.body
333
338
 
334
339
  const appConfig = getConfig(app)
335
340
  const { tencent_key } = await appConfig.getObject('map')
@@ -346,7 +351,8 @@ exports.getLngAndLat = async (ctx) => {
346
351
  latitude,
347
352
  })
348
353
 
349
- return ctx.SUCCESS(res)
354
+ ctx.SUCCESS(res)
355
+ return res
350
356
  }
351
357
 
352
358
  exports.syncModel = async (ctx) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "12.3.2",
3
+ "version": "12.3.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {