相关文章推荐
火爆的围巾  ·  第227期- ...·  11 月前    · 
忧郁的作业本  ·  为汽车照明应用选择HB LED驱动器| ...·  1 年前    · 
稳重的芹菜  ·  【光影流年】十二个想死的孩子- 哔哩哔哩·  2 年前    · 
逼格高的土豆  ·  总结教训从头再来——中国女排瞄准巴黎奥运会·  2 年前    · 
失眠的荒野  ·  超新星闪光人(1986年植村喜八郎等主演电视 ...·  2 年前    · 
小百科  ›  await 对此表达式类型没有影响? | 微信开放社区
从未表白的棒棒糖
3 年前

交流专区
服务市场
微信学堂
文档
小程序
  • 常用主页

    小程序

    小游戏

    企业微信

    微信支付

  • 服务市场
    微信学堂
    文档
登录
公告列表
公告列表
收藏
分享

扫描小程序码分享

回答

置顶 await 对此表达式类型没有影响? 精选 热门

Qiu (吉²) 2021-05-15 3863 浏览 问题模块: 其他开发相关的问题

await 对此表达式类型没有影响?

onChangeFlockData: function (e) {
    let tempArr = [];
    let imgUrls = e.detail.all;
    imgUrls.forEach(async(item) => {
      tempArr.push(item.url)
      if (item.imageSize >= 1048576) {
        this.imgInfoCheck(item.url)
      } else {
        await this.imgSecCheck(item.url)
    this.setData({
      tempArr: tempArr
    console.log("tempArr:::", this.data.tempArr)
imgSecCheck: function (tempUrl) {
    wx.showLoading({
      mask: true
    wx.getFileSystemManager().readFile({
      filePath: tempUrl,
      encoding: "base64",
      success: res => {
        console.log(res)
        let imgBuffer = res.data
        wx.cloud.callFunction({
          name: "msgSecCheck",
          data: {
            type: 'imgSecCheckBuffer', //以buffer方式上传送审
            value: imgBuffer,
        }).then(res =>




    
 {
          console.log("图片检测结果:", res)
          if (res.result.errCode === 87014) {
            wx.hideLoading()
            wx.showToast({
              title: '图片含有违法违规内容',
              icon: 'none'
        }).catch(err => {
          console.log(err)
          wx.hideLoading()
          wx.showModal({
            title: '提示',
            content: '图片尺寸过大,请调整图片尺寸',
            success(res) {
              if (res.confirm) {
                console.log('用户点击确定')
              } else if (res.cancel) {
                console.log('用户点击取消')
      fail: err => {
        console.error(err);
最后一次编辑于 2021-05-15
回答 关注问题 邀请回答
收藏

扫描小程序码分享

复制链接
关闭

请选择投诉理由

  • 广告内容
  • 违法违规
  • 恶意灌水内容
  • 其他

删除当前帖子

删除后帖子内容及评论将一并被删除,且不可恢复。

删除 取消
关闭

确定删除?

删除后不可恢复

取消 确定
关闭

关注“微信开放社区”公众号

关注后,可在微信内接收相应的重要提醒。

请使用微信扫描二维码关注 “微信开放社区” 公众号

关闭

反馈

 
推荐文章
火爆的围巾  ·  第227期- 華語基本句型是什麼?國小國語課本 ... - 國家教育研究院電子報
11 月前
忧郁的作业本  ·  为汽车照明应用选择HB LED驱动器| Analog Devices
1 年前
稳重的芹菜  ·  【光影流年】十二个想死的孩子- 哔哩哔哩
2 年前
逼格高的土豆  ·  总结教训从头再来——中国女排瞄准巴黎奥运会
2 年前
失眠的荒野  ·  超新星闪光人(1986年植村喜八郎等主演电视剧)_搜狗百科
2 年前
Link管理   ·   Sov5搜索   ·   小百科
小百科 - 百科知识指南