正式环境我看有个scene长这样,要拿到它带的uid和type,这两种处理方法都行不通,应该如何处理?
扫小程序码进入,如何处理回调?Scan the applet code to enter, how to handle the callback?
扫小程序码进入,如何处理回调?正式环境我看有个scene长这样,要拿到它带的uid和type,这两种处理方法都行不通,应该如何处理?
In the formal environment, I think there is a scene that looks like this. If you want to get the uid and type it carries, neither of these two methods will work. How should you deal with it?
回答:
decode没问题,写法太邋遢了
let data = decodeURIComponent(`uid%3D5tvkot6dl9c01%26type%3D2`) + "&"let result = data.match(/uid=(.*?)&type=(.*?)&/)let uid = result[1] || ""let type = result[2] || ""//这样试试看?
原文出处:扫小程序码进入,如何处理回调?
scene重新写下,用点分隔,获取再分开就行了