老师好,店铺授权二维码的问题

来源:14-14 店铺授权之部署以及远程调试

慕雪9541260

2020-01-02

老师,我跟着做到了14-14章,项目打包部署好之后,不管是本地还是服务器上都是可以显示二维码的,但是当我第一次用另一个微信(已经关注测试号)扫码授权之后,成功跳转操作成功界面,然后刷新店家授权管理界面也成功显示多了一条员工信息,应该算是成功了。但是当我重新再进店铺授权管理页的时候,二维码就再也不出现了(之前还没有授权员工前一直都有的,不管刷新多少次,但是授权一次之后就不出现了),然后我删掉那条员工记录或者重新打包项目都是已经不能再出现二维码了。老师可以帮我排查一下原因吗?万分感谢!具体截图如下。
图片描述
图片描述
图片描述
图片描述
图片描述
代码报错为:
user dose not have resource to register long term short url
2020-01-02 15:24:33.708 [http-nio-8080-exec-3] ERROR o.a.c.c.C.[.[localhost].[/o2o].[dispatcherServlet] - Servlet.service() for servlet [dispatcherServlet] in context with path [/o2o] threw exception [Request processing failed; nested exception is java.lang.IllegalArgumentException: Found empty contents] with root cause
java.lang.IllegalArgumentException: Found empty contents
at com.google.zxing.qrcode.QRCodeWriter.encode(QRCodeWriter.java:55)
at com.google.zxing.MultiFormatWriter.encode(MultiFormatWriter.java:102)
at com.wzxy.o2o.util.CodeUtil.generateQRCodeStream(CodeUtil.java:51)
at com.wzxy.o2o.web.shopadmin.ShopAuthManagementController.generateQRCode4ShopAuth(ShopAuthManagementController.java:207)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:104)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:892)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:797)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1039)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:897)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:645)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:750)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:109)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66)
at org.apache.coyote.AbstractProtocolConnectionHandler.process(AbstractProtocol.java:853)atorg.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:853) at org.apache.tomcat.util.net.NioEndpointConnectionHandler.process(AbstractProtocol.java:853)atorg.apache.tomcat.util.net.NioEndpointSocketProcessor.doRun(NioEndpoint.java:1587)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutorWorker.run(UnknownSource)atorg.apache.tomcat.util.threads.TaskThreadWorker.run(Unknown Source) at org.apache.tomcat.util.threads.TaskThreadWorker.run(UnknownSource)atorg.apache.tomcat.util.threads.TaskThreadWrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Unknown Source)

我百度了这个原因,说是短地址接口到期了,无法再生成短url了,可是我上一秒还是成功加载出来的啊,而且短地址免费点数还有80多点,而且我用的短地址ShortNetAddressUtil工具类是您最新改的这种
图片描述
麻烦老师了!

写回答

3回答

慕雪9541260

提问者

2020-01-03

//img.mukewang.com/szimg/5e0e178a0899085008790084.jpg

//img.mukewang.com/szimg/5e0e178a0811787c08780057.jpg

//img1.sycdn.imooc.com/szimg/5e0e178a08851fb409030275.jpg

通过大佬的帮助,暂时解决了,分享一下,修改这三处地方还可以继续用。

0
2
翔仔
已更新最终源码,确保可用:)
2020-01-04
共2条回复

慕雪9541260

提问者

2020-01-02

如果用这个的话,https://segmentfault.com/a/1190000021159027?utm_source=tag-newest

我应该怎么替换代码,老师可以教一下吗,谢谢!

0
1
翔仔
同学好,首先要明确好目的,目的就是生成短链接,所以非要替换的话,直接把ShortNetAddressUtil 里面的getShortURL 替换就可以了,最终就是传入一个url返回短链接,解析出来还是原来的这个url就可以了
2020-01-02
共1条回复

慕雪9541260

提问者

2020-01-02

我再去ShortNetAddressUtil工具类运行该类,昨天和今天都是直接输出一个短地址,授权了一次之后就输出这个了,是我的原因,还是百度接口又不能用了,有什么办法吗

(我用的这个类是您给的这个,已经换成我的token了:https://coding.imooc.com/learn/questiondetail/149313.html)

//img.mukewang.com/szimg/5e0da0fa08c26bb010080640.jpg

0
2
慕雪9541260
回复
翔仔
老师,已经暂时解决了,用您11月份新写的这个应该是不行了,因为我曾经成功生成过二维码,但是后来就不行了,代码没改过,单独运行该类也加载不出解析后的短地址。修改三处地方暂时就可以生成了。修改的地方如上
2020-01-03
共2条回复

Java双版本(SSM到SpringBoot)校园商铺全栈开发

SSM商铺V1.0,解决毕设痛点;SpringBoot商铺V2.0,满足工作刚需

5113 学习 · 8144 问题

查看课程