@@ -7,7 +7,6 @@ sa.para = {
77 server_url : '' ,
88 send_timeout : 1000 ,
99 show_log : false ,
10- launched : false ,
1110 allow_amend_share_path : true ,
1211 max_string_length : 500 ,
1312 datasend_timeout : 3000 ,
@@ -43,6 +42,10 @@ sa.para = {
4342 storage_prepare_data_key : 'sensors_mp_prepare_data'
4443} ;
4544
45+ var deploy_para = {
46+ launched : false
47+ } ;
48+
4649var mpHook = {
4750 data : 1 ,
4851 onLoad : 1 ,
@@ -159,7 +162,7 @@ var ArrayProto = Array.prototype,
159162 slice = ArrayProto . slice ,
160163 toString = ObjProto . toString ,
161164 hasOwnProperty = ObjProto . hasOwnProperty ,
162- LIB_VERSION = '1.14.22 ' ,
165+ LIB_VERSION = '1.14.23 ' ,
163166 LIB_NAME = 'MiniProgram' ;
164167
165168var source_channel_standard = 'utm_source utm_medium utm_campaign utm_content utm_term' ;
@@ -700,7 +703,7 @@ _.getCurrentPath = function() {
700703 var url = '未取到' ;
701704 try {
702705 var currentPage = _ . getCurrentPage ( ) ;
703- url = currentPage . route ;
706+ url = currentPage ? currentPage . route : url ;
704707 } catch ( e ) {
705708 logger . info ( e ) ;
706709 }
@@ -1857,7 +1860,7 @@ sa.getLocation = function() {
18571860 } ) ;
18581861 } ,
18591862 fail : function ( err ) {
1860- console . log ( '获取位置失败' , err ) ;
1863+ logger . info ( '获取位置失败' , err ) ;
18611864 }
18621865 } ) ;
18631866 } else {
@@ -2186,6 +2189,7 @@ sa.setWebViewUrl = function(url, after_hash) {
21862189 search = arr [ 2 ] || '' ,
21872190 hash = arr [ 3 ] || '' ,
21882191 nurl = '' ;
2192+
21892193 var distinct_id = sa . store . getDistinctId ( ) || '' ,
21902194 first_id = sa . store . getFirstId ( ) || '' ,
21912195 idIndex ;
@@ -2215,7 +2219,8 @@ sa.setWebViewUrl = function(url, after_hash) {
22152219 var hasQuery = / ^ \? ( \w ) + / . test ( search ) ;
22162220 if ( hasQuery ) {
22172221 if ( idIndex > - 1 ) {
2218- nurl = host + '?' + search . substring ( 1 , idIndex ) + '_sasdk=' + value + hash ;
2222+ var newSearch = search . replace ( / ( _ s a s d k = ) ( [ ^ & ] * ) / gi, '_sasdk=' + value ) ;
2223+ nurl = host + newSearch + hash ;
22192224 } else {
22202225 nurl = host + '?' + search . substring ( 1 ) + '&_sasdk=' + value + hash ;
22212226 }
@@ -2830,10 +2835,10 @@ sa.pageShow = function(prop) {
28302835 } ;
28312836
28322837 wx . onAppShow ( function ( para ) {
2833- if ( ! sa . para . launched ) {
2838+ if ( ! deploy_para . launched ) {
28342839 var option = wx . getLaunchOptionsSync ( ) || { } ;
28352840 sa . autoTrackCustom . appLaunch ( option ) ;
2836- sa . para . launched = true ;
2841+ deploy_para . launched = true ;
28372842 }
28382843 sa . autoTrackCustom . appShow ( para ) ;
28392844 } ) ;
0 commit comments