扫小程序码进入,如何处理回调?

小程序 文章 2022-02-17 10:40 315 0 全屏看文

AI助手支持GPT4.0

扫小程序码进入,如何处理回调?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?

回答:

八九:

scene重新写下,用点分隔,获取再分开就行了

杰:二维码链接什么后端弄的,我也不知道格式长啥样,昨天上体验版看了下格式,看上面说是对象类型
远杰:

decode没问题,写法太邋遢了

杰:我那样写好像不起作用,type都拿不到
brave:
let data = decodeURIComponent(`uid%3D5tvkot6dl9c01%26type%3D2`) + "&"let result = data.match(/uid=(.*?)&type=(.*?)&/)let uid = result[1] || ""let type = result[2] || ""//这样试试看?
江文静:

-EOF-

AI助手支持GPT4.0