Commit 59ce3e4e authored by spc's avatar spc

syWebview

parent a5a00f55
......@@ -107,17 +107,16 @@ onLoad(async (options) => {
return
}
// 固定写死的 URL(不从 options 读取 baseUrl)
const baseUrl = res.data.url
let baseUrl = res.data.url
const cuk = globalStore.cuk
const openId = globalStore.openId
const unionId = globalStore.unionId
// scene 需要使用 decodeURIComponent 才能获取到生成二维码时传入的 scene
// const scene = decodeURIComponent(options.scene)
// options.scene = null
const scene = decodeURIComponent(decodeURIComponent(options.scene))
options.scene = null
// console.warn("scene", scene)
console.warn("scene", scene)
// 将 options 的所有参数原样作为查询参数传给 H5,并补齐 cuk
const params = { ...(options || {}) }
......@@ -141,6 +140,16 @@ onLoad(async (options) => {
// 示例:
// https://25niansuyuan.feihe.com/projects/Firmus/dev/index?p=xmh&openId=用户openid&unionId=用户unionid&&pt=yzhd123&shareToken=yzhd123&cuk=12121
if (scene) {
if (scene[0] === '?') {
baseUrl += scene
} else {
baseUrl += `?${scene}`
}
}
webviewUrl.value = paramStr
? baseUrl + (baseUrl.includes('?') ? '&' : '?') + paramStr
: baseUrl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment