File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88import { timestamp , logError } from '../src/utils.js' ;
99import { ajax } from '../src/ajax.js'
1010import { submodule } from '../src/hook.js' ;
11- import { getStorageManager } from '../src/storageManager.js' ;
12- import { MODULE_TYPE_UID } from '../src/activities/modules.js' ;
11+ import { getStorageManager } from '../src/storageManager.js' ;
12+ import { MODULE_TYPE_UID } from '../src/activities/modules.js' ;
13+ import { getRefererInfo } from '../src/refererDetection.js' ;
1314
1415/**
1516 * @typedef {import('../modules/userId/index.js').Submodule } Submodule
@@ -57,10 +58,11 @@ export function getLocalData() {
5758}
5859
5960export function getApiUrl ( cid , url ) {
60- if ( url ) {
61- return `${ url } ?cid=${ cid } ` ;
62- }
63- return `https://${ apiDomain } /${ cid } /pid` ;
61+ const baseUrl = url ? `${ url } ?cid=${ cid } &` : `https://${ apiDomain } /${ cid } /pid?` ;
62+ const refererInfo = getRefererInfo ( ) ;
63+ return baseUrl +
64+ `page=${ encodeURIComponent ( refererInfo . page || '' ) } ` +
65+ `&ref=${ encodeURIComponent ( refererInfo . ref || '' ) } ` ;
6466}
6567
6668export function apiSuccessProcess ( jsonResponse ) {
You can’t perform that action at this time.
0 commit comments