@qingfu/core-env 0.4.3 → 0.4.4

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.
Files changed (2) hide show
  1. package/lib/helper.js +2 -2
  2. package/package.json +1 -1
package/lib/helper.js CHANGED
@@ -100,8 +100,8 @@ helper.ip2geo = async ( ctx, next ) => {
100
100
  try {
101
101
  let userID = ctx.state.user && ctx.state.user.id;
102
102
  let ip = ctx.ip, agent = ctx.get( 'User-Agent' );
103
- let geo = ctx.state.geo = await brokers( 'core' ).call( 'chunzhen.geo', { ip });
104
- if ( userID && brokers( 'qfu' )) await brokers( 'qfu' ).call( 'user.refreshGEO', { userID, ip, agent, ...geo });
103
+ let geo = ctx.state.geo = brokers( 'sign' ) && await brokers( 'sign' ).call( 'detect.geo', { ip });
104
+ if ( brokers( 'qfu' ) && userID && geo ) await brokers( 'qfu' ).call( 'user.refreshGEO', { userID, ip, agent, ...geo });
105
105
  } catch ( err ) {
106
106
  ( global.logger || global.console ).warn( err );
107
107
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qingfu/core-env",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "readmeFilename": "README.md",
5
5
  "dependencies": {
6
6
  "@koa/cors": "5.0.0",