Coder Social home page Coder Social logo

Comments (2)

witthong avatar witthong commented on May 22, 2024

使用image.src也是要加白名单的

应该不用吧,文档上说明的是
request/downloadFile/socket/uploadFile 等需要配置域名白名单

cocos 提供的方案是支持两种方式选择的,仅供参考

from layaair.

layaxiaosong avatar layaxiaosong commented on May 22, 2024

目前的处理图片下载我们用了微信的 donwloadfile接口,使用这个接口的目的就是为了缓存下载的图片,重复下载使用缓存的文件,所以需要在微信白名单里设置downloadfile。而window.Image.src 这个是既不用downloadfile ,也不用request,所以你不用设置白名单即可。你说的有些场景不想增加白名单,这里说的场景图片是4M包还是外网加载?如果需求大的话,后面我们会扩充一个数组,让开发者手动添加需要特殊处理的加载地址,跳过downloadfile接口,直接使用window.src完成图片的加载。

from layaair.

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.