@qingfu/core-env 0.5.3 → 0.5.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.
- package/lib/helper.js +1 -1
- package/package.json +1 -1
package/lib/helper.js
CHANGED
|
@@ -98,7 +98,7 @@ helper.parseLike = ( ...fields ) => {
|
|
|
98
98
|
helper.ip2geo = async ( ctx, next ) => {
|
|
99
99
|
try {
|
|
100
100
|
let user = ctx.state.user, ip = ctx.ip, agent = ctx.get( 'User-Agent' );
|
|
101
|
-
let geo = ctx.state.geo = brokers( '
|
|
101
|
+
let geo = ctx.state.geo = brokers( 'core' ) && await brokers( 'core' ).call( 'detect.geo', { ip });
|
|
102
102
|
if ( brokers( 'qfu' ) && user && geo ) await brokers( 'qfu' ).call( 'user.refreshGEO', { user, ip, agent, ...geo });
|
|
103
103
|
} catch ( err ) {
|
|
104
104
|
( global.logger || global.console ).warn( err );
|