收藏
回答

editor组件和对应的EditorContext相关方法线上环境突然严重异常

框架类型 问题类型 API/组件名称 终端类型 微信版本 基础库版本
小程序 Bug editor,EditorContext.insertImage,EditorContext.getContents 微信iOS客户端 所有版本 最新微信加载的基础库

昨天,突然发现使用了editor组件的小程序出现严重异常,通过跟踪,发现问题如下:

1、EditorContext.insertImage插入图片的时候,带有自定义属性,但是EditorContext.getContents获取出来的delta对象,却没有了之前一直有的attributes字段!

正常是类似这样的:

{"attributes":{"alt":"[图片]","class":"note-image","data-custom":"path=https://xi.xurl.cn/pro/10001/note/202311/21/202311212240120edf7b5df7aaecf2.jpg?x-oss-process=style/content_pic\u0026size=11047957\u0026type=image\u0026attach=\u0026mid=54612","width":"100%"},"insert":{"image":"https://xi.xurl.cn/pro/10001/note/202311/21/202311212240120edf7b5df7aaecf2.jpg?x-oss-process=style/content_pic"}}

但现在异常变为:

{"insert":{"image":"https://xi.xurl.cn/pro/10046/note/202311/21/20231121231623967d925609b0efba.jpg?x-oss-process=style/content_pic"}}


按文档说明,应该是要有 attributes 字段的:

2、EditorContext.insertImage插入图片的时候,在iOS下,之前通过 EditorContext.getContents 获得的 delta.insert.image 的值,是类似 wxfile://tmp_7491ef66e0782c30437e176433ab9127.jpg 这样的本地文件格式,现在突然变成了 data:image 的格式了!安卓下还是保留原来的本地文件格式。

因为这些变动,让依赖 editor 组件的小程序完全无法使用,烦请尽快处理,谢谢!

PS:上述问题在开发工具上完全正常(按原来表现),但真机上,无论iOS和安卓,都表现异常。

回答关注问题邀请回答
收藏

3 个回答

  • Demons
    Demons
    2023-11-22

    问题已知,正在修复

    2023-11-22
    有用
    回复 2
    • Gavin
      Gavin
      2023-11-22
      谢谢,麻烦抓紧点修复,这个对我们影响比较大,产品基本没法用
      2023-11-22
      回复
    • Gavin
      Gavin
      2023-11-28
      这个问题当天好了,辛苦技术大大!另外,这个贴的问题可以优化一下不?特别是 iPhone下同时插入编辑器超过20个本地相册图片的时候,很容易出现崩溃的问题。https://developers.weixin.qq.com/community/develop/doc/000ca8ae6cc88060335fd7a1551800
      2023-11-28
      回复
  • 一笑皆春
    一笑皆春
    2023-11-22

    复议,之前insertImage插入图片宽度80%,现在不管用了,基础库3.2.2,已发帖反馈

     that.editorCtx.insertImage({

                      src: item.url,

                      width: '80%',

                      data: {},

                      success: function () {},

                      complete: function () {

                        wx.hideLoading()

                      }

                    })

    2023-11-22
    有用
    回复
  • cloud
    cloud
    2023-11-22

    不要期待官方处理,估计要很久,自己想办法应对一下

    2023-11-22
    有用
    回复 1
    • Gavin
      Gavin
      2023-11-22
      😭
      2023-11-22
      回复
登录 后发表内容