|
|
@@ -773,19 +773,21 @@ Page({
|
|
|
console.log('===========================================');
|
|
|
|
|
|
const currentUser = Parse.User.current();
|
|
|
- if (!currentUser) {
|
|
|
- console.error('❌ 用户未登录,无法跳转');
|
|
|
- return;
|
|
|
- }
|
|
|
+ const token = currentUser ? currentUser.getSessionToken() : null;
|
|
|
|
|
|
- const token = currentUser.getSessionToken();
|
|
|
- if (!token) {
|
|
|
- console.error('❌ 无法获取 Session Token');
|
|
|
- return;
|
|
|
+ // 构建产品详情的 H5 URL(不要在这里编码,后面统一编码)
|
|
|
+ let h5Url = `https://app.fmode.cn/dev/pobingfeng/owner/nav/products?storeId=${storeId}`;
|
|
|
+
|
|
|
+ // 如果有 token,添加到 URL
|
|
|
+ if (token) {
|
|
|
+ h5Url += `&token=${token}`;
|
|
|
+ } else {
|
|
|
+ // 如果没有 token,使用游客模式
|
|
|
+ h5Url += `&guestMode=true`;
|
|
|
}
|
|
|
|
|
|
- // 构建产品详情的 H5 URL
|
|
|
- let h5Url = `https://app.fmode.cn/dev/pobingfeng/owner/nav/products?storeId=${storeId}&token=${token}&productId=${encodeURIComponent(productId)}`;
|
|
|
+ // 添加产品ID(不要在这里编码,避免双重编码)
|
|
|
+ h5Url += `&productId=${productId}`;
|
|
|
|
|
|
// 如果有合作伙伴ID,也添加到URL中
|
|
|
if (partnerId) {
|
|
|
@@ -794,7 +796,7 @@ Page({
|
|
|
|
|
|
console.log('🌐 H5 URL:', h5Url);
|
|
|
|
|
|
- // 编码 URL
|
|
|
+ // 编码 URL(统一在这里编码一次)
|
|
|
const encodedUrl = encodeURIComponent(h5Url);
|
|
|
|
|
|
// 构建 web-view 页面路径
|
|
|
@@ -840,19 +842,21 @@ Page({
|
|
|
console.log('===========================================');
|
|
|
|
|
|
const currentUser = Parse.User.current();
|
|
|
- if (!currentUser) {
|
|
|
- console.error('❌ 用户未登录,无法跳转');
|
|
|
- return;
|
|
|
- }
|
|
|
+ const token = currentUser ? currentUser.getSessionToken() : null;
|
|
|
|
|
|
- const token = currentUser.getSessionToken();
|
|
|
- if (!token) {
|
|
|
- console.error('❌ 无法获取 Session Token');
|
|
|
- return;
|
|
|
+ // 构建案例详情的 H5 URL(不要在这里编码,后面统一编码)
|
|
|
+ let h5Url = `https://app.fmode.cn/dev/pobingfeng/owner/nav/cases?storeId=${storeId}`;
|
|
|
+
|
|
|
+ // 如果有 token,添加到 URL
|
|
|
+ if (token) {
|
|
|
+ h5Url += `&token=${token}`;
|
|
|
+ } else {
|
|
|
+ // 如果没有 token,使用游客模式
|
|
|
+ h5Url += `&guestMode=true`;
|
|
|
}
|
|
|
|
|
|
- // 构建案例详情的 H5 URL
|
|
|
- let h5Url = `https://app.fmode.cn/dev/pobingfeng/owner/nav/cases?storeId=${storeId}&token=${token}&caseId=${encodeURIComponent(caseId)}`;
|
|
|
+ // 添加案例ID(不要在这里编码,避免双重编码)
|
|
|
+ h5Url += `&caseId=${caseId}`;
|
|
|
|
|
|
// 如果有合作伙伴ID,也添加到URL中
|
|
|
if (partnerId) {
|
|
|
@@ -861,7 +865,7 @@ Page({
|
|
|
|
|
|
console.log('🌐 H5 URL:', h5Url);
|
|
|
|
|
|
- // 编码 URL
|
|
|
+ // 编码 URL(统一在这里编码一次)
|
|
|
const encodedUrl = encodeURIComponent(h5Url);
|
|
|
|
|
|
// 构建 web-view 页面路径
|