feat: 完成全部接口替换为新后端接口
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { getCachedUser } from './auth';
|
||||
/**
|
||||
* 下载打印通用工具
|
||||
* 支持下载次数限制和激励广告
|
||||
@@ -67,7 +68,9 @@ function showVideoAd(): Promise<boolean> {
|
||||
mask: true,
|
||||
});
|
||||
|
||||
const onClose: WechatMiniprogram.RewardedVideoAdOnCloseCallback = (res) => {
|
||||
const onClose: WechatMiniprogram.RewardedVideoAdOnCloseCallback = (
|
||||
res,
|
||||
) => {
|
||||
videoAd.offClose(onClose);
|
||||
wx.hideLoading();
|
||||
resolve(!!(res && res.isEnded));
|
||||
@@ -137,6 +140,7 @@ function doDownload(
|
||||
},
|
||||
): Promise<boolean> {
|
||||
const exportId = generateUUID();
|
||||
const expectedUserId = getCachedUser()?.id;
|
||||
const trackerPage = options.trackerPage || options.trackerName || '';
|
||||
const trackerParams = {
|
||||
export_id: exportId,
|
||||
@@ -154,7 +158,11 @@ function doDownload(
|
||||
recordDownloadSuccess();
|
||||
tracker.reportExportResult(trackerPage, true, trackerParams);
|
||||
if (options.worksheetId) {
|
||||
await addDownloadLog(options.worksheetId, exportId);
|
||||
await addDownloadLog(
|
||||
options.worksheetId,
|
||||
exportId,
|
||||
expectedUserId,
|
||||
);
|
||||
}
|
||||
} else {
|
||||
tracker.reportExportResult(trackerPage, false, trackerParams);
|
||||
|
||||
Reference in New Issue
Block a user