Git Product home page Git Product logo

Comments (7)

binarywang avatar binarywang commented on August 16, 2024

首先,扫码后直接跳转链接,微信没有提供这种场景,所以你可以放弃这种想法了。
其次,关注和非关注的问题,你可以写个公用的方法处理,分别在关注和扫码事件里处理,你只需要分别在对应的handler里调用共用方法就可以,根据具体的scene_id去做判断,相信你本地应该做相应的存储了吧?
再者,永久二维码,每个公众号就是只有那10万个,是没办法的,微信规定的。

from wxjava.

lqm627 avatar lqm627 commented on August 16, 2024

那个消息路由的拦截是根据 eventKey去拦截的,未关注的情况: .rule()
.async(false)
.msgType(WxConsts.XML_MSG_EVENT).event(WxConsts.EVT_SUBSCRIBE).eventKey("qrscene_car")
.handler(demo2)
.end()
已关注的情况: .rule()
.async(false)
.msgType(WxConsts.XML_MSG_EVENT).event(WxConsts.EVT_SCAN).eventKey("car")
.handler(demo3)
.end()
这样我不还是要写好多个handler去拦截吗?还有我提到的那个二维码扫码一次就失效的效果如何去实现?@binarywang

from wxjava.

binarywang avatar binarywang commented on August 16, 2024

你不会把eventKey的判断放到handler里进行吗?

from wxjava.

binarywang avatar binarywang commented on August 16, 2024

扫码一次就失效,你可以在你的程序里控制吧?

from wxjava.

lqm627 avatar lqm627 commented on August 16, 2024

那就是我在用户第一次扫描后插一条记录到数据库,再扫的时候判断是否有这一条记录,没有就推链接消息,有就推文本信息告诉它二维码失效吧?其实二维码一直都可以扫,只是判断后不给他链接消息推送而已吧?

from wxjava.

lqm627 avatar lqm627 commented on August 16, 2024

好吧,我写习惯了,没认真去看源码,好像是可以把eventKey值放到hander拦截器里面再去取出来判断,再根据取出来的eventKey去数据库查询是否有这个eventKey值

from wxjava.

binarywang avatar binarywang commented on August 16, 2024

没错,如果问题解决了,就关掉吧

from wxjava.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.