@tmsfe/tms-core 0.0.111 → 0.0.112

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tmsfe/tms-core",
3
- "version": "0.0.111",
3
+ "version": "0.0.112",
4
4
  "description": "tms运行时框架",
5
5
  "repository": {
6
6
  "type": "git",
@@ -55,19 +55,19 @@ let ipLocationPromise: null | Promise<IpLocationType> = null; // ip定位请求
55
55
  */
56
56
  class Location extends LocationBase {
57
57
  /**
58
- * @desc 默认位置信息
59
- * @property {object} locForNoAuth 默认的位置信息
60
- * @property {string} locForNoAuth.privince 省份信息
61
- * @property {string} locForNoAuth.cityCode 城市编码
62
- * @property {string} locForNoAuth.cityName 城市名称
63
- * @property {string} locForNoAuth.district 地区名称
64
- * @property {string} locForNoAuth.latitude 维度
65
- * @property {string} locForNoAuth.longitude 经度
66
- * @example
67
- * const app = getApp({ allowDefault: true });
68
- * const locationManager = app.tms.getLocationManager(); // 获取位置管理器
69
- * console.log(locationManager.locForNoAuth) // 获取默认位置
70
- */
58
+ * @desc 默认位置信息
59
+ * @property {object} locForNoAuth 默认的位置信息
60
+ * @property {string} locForNoAuth.privince 省份信息
61
+ * @property {string} locForNoAuth.cityCode 城市编码
62
+ * @property {string} locForNoAuth.cityName 城市名称
63
+ * @property {string} locForNoAuth.district 地区名称
64
+ * @property {string} locForNoAuth.latitude 维度
65
+ * @property {string} locForNoAuth.longitude 经度
66
+ * @example
67
+ * const app = getApp({ allowDefault: true });
68
+ * const locationManager = app.tms.getLocationManager(); // 获取位置管理器
69
+ * console.log(locationManager.locForNoAuth) // 获取默认位置
70
+ */
71
71
  public locForNoAuth = {
72
72
  province: '广东省',
73
73
  cityCode: '440300',
@@ -133,7 +133,7 @@ class Location extends LocationBase {
133
133
 
134
134
  return Promise.reject(res);
135
135
  })
136
- .catch(err => Promise.reject(err));
136
+ .catch(err => Promise.reject(err));
137
137
 
138
138
  return userLocationCache[cacheName];
139
139
  }
@@ -175,13 +175,13 @@ 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(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
- })
184
- .catch(err => Promise.reject(err));
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
+ })
184
+ .catch(err => Promise.reject(err));
185
185
  }
186
186
 
187
187
  /**
@@ -216,13 +216,13 @@ class Location extends LocationBase {
216
216
  */
217
217
  getLocationDetailSilent(getPoi = 0, type = 'gcj02') {
218
218
  return this.getLocationSilent(type)
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
- })
225
- .catch(err => Promise.reject(err));
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
+ })
225
+ .catch(err => Promise.reject(err));
226
226
  }
227
227
 
228
228
  /**
@@ -239,7 +239,7 @@ class Location extends LocationBase {
239
239
  * longitude: 116.2545454,
240
240
  * adCode: 1212144,
241
241
  * }
242
- */
242
+ */
243
243
  getUserLocation(): PostionType | undefined {
244
244
  return userLocation;
245
245
  }
@@ -337,18 +337,18 @@ class Location extends LocationBase {
337
337
  if (ipLocationPromise === null || force) {
338
338
  ipLocationPromise = new Promise((resolve, reject) => {
339
339
  request.post('basic/lbs/decodeip')
340
- .then((res) => {
341
- if (res.errCode === 0) {
342
- resolve(res.resData as IpLocationType);
343
- return;
344
- }
345
- reject({ erMsg: res.errMsg });
346
- ipLocationPromise = null;
347
- })
348
- .catch((e) => {
349
- reject(e);
350
- ipLocationPromise = null;
351
- });
340
+ .then((res) => {
341
+ if (res.errCode === 0) {
342
+ resolve(res.resData as IpLocationType);
343
+ return;
344
+ }
345
+ reject({ erMsg: res.errMsg });
346
+ ipLocationPromise = null;
347
+ })
348
+ .catch((e) => {
349
+ reject(e);
350
+ ipLocationPromise = null;
351
+ });
352
352
  });
353
353
  }
354
354
  return ipLocationPromise;
package/src/request.js CHANGED
@@ -321,7 +321,8 @@ export default class Request {
321
321
  // 埋点已经单独打日志了,接口请求数据日志太长影响分析
322
322
  if (path.indexOf('basic/event/upload') === -1) {
323
323
  let result = JSON.stringify(res?.data);
324
- if (result.length > 500) {
324
+ // 打车日志不截断,方便用于回放
325
+ if (path.indexOf('/takecar/') === -1 && result.length > 500) {
325
326
  result = `${result.substring(0, 500)} 内容太长被截断`;
326
327
  }
327
328
  const obj = {