传入的url确认是有值的,在编辑器里工作正常,但是在真机上报 parameter.url should be string instead of undefined
T(res){
engine.loader.loadFile(res.userInfo.avatarUrl.toString(), {
filetype: "image",
}).then(result => {
Tipper.instance.Show(result.toString())
const tex = new engine.Texture2D({
filterMode: engine.TextureFilterMode.BILINEAR,
wrapU: engine.TextureWrapMode.CLAMP_TO_EDGE,
wrapV: engine.TextureWrapMode.CLAMP_TO_EDGE,
anisoLevel: 1
});
tex.initWithRGBABuffer(result.data, result.width, result.height);
this.avatar.spriteFrame = engine.SpriteFrame.createFromTexture(tex);
this.avatar.entity.transform2D.sizeX = tex.width;
this.avatar.entity.transform2D.sizeY = tex.height;
}, error => {
Tipper.instance.Show(error.toString() + ":" + res.userInfo.avatarUrl.toString());
console.log(error);
});
}
请具体描述问题出现的流程,并提供能复现问题的简单代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html)。