AI助手支持GPT4.0
小程序启动状态下,再扫码进入,不会走onLaunch?When the applet is activated, scan the code to enter, will it not go to onLaunch?
小程序启动状态下,再扫码进入,不会走onLaunch?
之前把处理扫码的业务逻辑放在onLaunch里处理的,结果发现,小程序启动状态下,扫码进来,不走该生命周期。
那换成onShow来处理扫码业务逻辑,就可能触发多次重复处理多次。
怎么处理好一些,其实我就想扫码进来把业务逻辑处理了,然后后面不管怎么样都不再重复处理了。
之前着急还专门有个扫码解析页,扫码进来统一跳转解析参数,解析redirct目标页,特别不好的地方因为参数长度32位的限制, 所以生成小程序码前把参数存在后端返回token,解析页再请求后端拿到对应的参数,参数里有目标页,再redirct。
有更好的处理办法吗,你们是怎么处理的。
Previously, the business logic for code scanning was processed in onlaunch. It was found that when the applet was started, the code scanning came in and did not go through the life cycle. If Onshow is used to process the code scanning business logic, it may trigger repeated processing for many times. How to handle it better? In fact, I want to scan the code to deal with the business logic, and then I won't repeat it anyway. In the past, there was a code scanning analysis page. The code scanning came in to uniformly jump the analysis parameters and analyze the redirct target page. It is particularly bad because the parameter length is limited by 32 bits, so before generating the applet code, the parameters are stored in the back end and returned to the token. The analysis page then requests the back end to get the corresponding parameters. There is a target page in the parameters and redirct. Is there a better way to deal with it? How did you deal with it.
1、热启动不走。