fix: 修复明文 URL Scheme path 编码问题
- path 参数不再进行 URL encode,微信要求原始路径格式 - 修复跳转微信后提示"当前页面无法访问"的问题 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -28,16 +28,14 @@ const MINIPROGRAM_APPID = 'wx0edeaab76d4fa414';
|
||||
/**
|
||||
* 生成明文 URL Scheme
|
||||
* 格式:weixin://dl/business/?appid=APPID&path=PATH&query=QUERY
|
||||
* 注意:path 不需要 URL encode,否则微信无法识别
|
||||
*/
|
||||
const generatePlainUrlScheme = (path, query) => {
|
||||
const params = new URLSearchParams({
|
||||
appid: MINIPROGRAM_APPID,
|
||||
path: path || '',
|
||||
});
|
||||
let url = `weixin://dl/business/?appid=${MINIPROGRAM_APPID}&path=${path || ''}`;
|
||||
if (query) {
|
||||
params.set('query', query);
|
||||
url += `&query=${encodeURIComponent(query)}`;
|
||||
}
|
||||
return `weixin://dl/business/?${params.toString()}`;
|
||||
return url;
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user