overtrue / share.js

一键分享到微博、QQ空间、QQ好友、微信、腾讯微博、豆瓣、Facebook、Twitter、Linkedin、Google+、点点等
MIT License
3.69k stars 807 forks source link

代码长度益出 #127

Closed wuxiao1021 closed 5 years ago

wuxiao1021 commented 5 years ago

social-share.min.js:1 Uncaught Error: code length overflow. (1628>1056) at Function.e.createData (social-share.min.js:1) at e.makeImpl (social-share.min.js:1) at e.getBestMaskPattern (social-share.min.js:1) at e.make (social-share.min.js:1) at QRCode.makeCode (social-share.min.js:1) at new QRCode (social-share.min.js:1) at o (social-share.min.js:1) at i (social-share.min.js:1) at HTMLDivElement. (social-share.min.js:1) at v (social-share.min.js:1)

wuxiao1021 commented 5 years ago

标题长度为:15,16,17 个字符 会出现这种问题

overtrue commented 5 years ago

是你的 url 太长了,生成二维码内容太长。。。

wuxiao1021 commented 5 years ago

不是吧! 我有的 标题 有 40多个 中文汉字 都不会出现这种情况, 只有 15,16,17 个 汉字 会出现

wuxiao1021 commented 5 years ago

大哥 比较紧急 能给个解决方案吗 ?

overtrue commented 5 years ago

这是 QRCode 这个库报的错,我也修不了啊,不是我这个库。。。

wuxiao1021 commented 5 years ago

ok, 好吧 只能把url 简短啦!非常 谢谢

overtrue commented 5 years ago

@wuxiao1021 哈哈

CoreJa commented 5 years ago

QRCode有个维护者对这个bug做了修复。点我查看 直接更新qrcode库就好了。 谢谢作者更新。

CoreJa commented 5 years ago

因为不会gulp,刚刚简单自学了一下。压缩后的js可用,没有url长度限制。 我博客上自用的social-share 这是博客url: https://coreja.com/%E8%AF%BE%E4%B8%9A%E6%96%87%E6%A1%A3/2019/04/%E7%89%A9%E4%BD%93%E6%A3%80%E6%B5%8B%E7%AE%97%E6%B3%95YOLOv3%E7%9A%84%E6%94%B9%E8%BF%9B%E2%80%94%E2%80%94%E8%AE%BA%E6%96%87%E7%BF%BB%E8%AF%91/

CoreJa commented 5 years ago

135 已提交pr,麻烦merge一下,可以的话更新一下cdnjs。拜托了!

仅修复了无jquery依赖版本的,因为不太清楚含jquery依赖的qrcode中的问题。 感谢大佬为开源贡献。

CoreJa commented 5 years ago

@mdluo 大佬,可以麻烦你更新一下cdnjs嘛,修复了无依赖版code length overflow的问题