fix:提交修复6个问题

This commit is contained in:
ljy
2026-07-08 23:01:18 +08:00
parent 99be8e0237
commit ab9654564e
43 changed files with 3671 additions and 277 deletions
+3 -3
View File
@@ -1,5 +1,5 @@
import { getRuntimePlatform } from './env';
import { ensureJssdkReady } from './jssdk';
import { ensureJssdkReady, normalizeJssdkPageUrl } from './jssdk';
import type { WeixinSdkConfig } from './types';
export type ChooseWechatImageOptions = {
@@ -32,7 +32,7 @@ async function reportChooseImageEvent(
errMsg: payload.errMsg,
sourceType: payload.sourceType,
stage: payload.stage,
pageUrl: typeof window !== 'undefined' ? window.location.href.split('#')[0] : undefined,
pageUrl: typeof window !== 'undefined' ? normalizeJssdkPageUrl(window.location.href) : undefined,
}),
});
} catch {
@@ -84,7 +84,7 @@ export async function chooseWechatImages(
const sourceType = options.sourceType ?? ['album', 'camera'];
if (platform === 'wechat-h5') {
const pageUrl = typeof window !== 'undefined' ? window.location.href.split('#')[0] : '';
const pageUrl = typeof window !== 'undefined' ? normalizeJssdkPageUrl(window.location.href) : '';
const sourceTypeKey = sourceType.join(',');
try {
await ensureJssdkReady({