宅男在线永久免费观看网直播,亚洲欧洲日产国码无码久久99,野花社区在线观看视频,亚洲人交乣女bbw,一本一本久久a久久精品综合不卡

全部
常見(jiàn)問(wèn)題
產(chǎn)品動(dòng)態(tài)
精選推薦

CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序頭像和昵稱(chēng)授權(quán)獲取不到問(wèn)題(v4.6一下版本)

管理 管理 編輯 刪除

小程序文檔中提出的調(diào)整說(shuō)明

attachmentId-21541

attachmentId-21548

對(duì)于此次調(diào)整現(xiàn)將小程序授權(quán)方式做以調(diào)整

  1. 添加判斷當(dāng)前基礎(chǔ)庫(kù)是否支持頭像昵稱(chēng)填寫(xiě)能力

在根目錄App.vue中加入判斷基礎(chǔ)庫(kù)是否大于2.21.2版本(大于此版本支持頭像/昵稱(chēng)填寫(xiě)能力)

···
// #ifdef MP
  const version = uni.getSystemInfoSync().SDKVersion
  if (Routine.compareVersion(version, '2.21.3') >= 0) {
    console.log(version)
    that.$Cache.set('MP_VERSION_ISNEW', true)
  } else {
    that.$Cache.set('MP_VERSION_ISNEW', false)
  }
// #endif

2.修改/pages/users/wechat_login.vue文件

(1) 在data中加入基礎(chǔ)庫(kù)判斷,決定授權(quán)邏輯
mp_is_new: this.$Cache.get('MP_VERSION_ISNEW') || false

(2)dom中新增邏輯判斷


  {{$t(`微信登錄`)}}
  {{$t(`微信登錄`)}}
  {{$t(`微信登錄`)}}

(3)methods中加入方法userLogin

// 小程序 22.11.8日刪除getUserProfile 接口獲取用戶昵稱(chēng)頭像
userLogin() {
  Routine.getCode()
    .then(code => {
      uni.showLoading({
      title: this.$t(`正在登錄中`)
    });
  authLogin({
    code,
    spread_spid: app.globalData.spid,
    spread_code: app.globalData.code
    }).then(res => {
      if (res.data.key !== undefined && res.data.key) {
        uni.hideLoading();
        this.authKey = res.data.key;
        this.isPhoneBox = true;
      } else {
        uni.hideLoading();
        let time = res.data.expires_time - this.$Cache.time();
        this.$store.commit('LOGIN', {
        token: res.data.token,
        time: time
        });
        this.getUserInfo()
      }
    })
  })
  .catch(err => {
    console.log(err)
  });
},

3.新增用戶頭像/昵稱(chēng)獲取能力
(1)調(diào)整pages/users/user_info.vue文件
data中新增 mp_is_new: this.$Cache.get('MP_VERSION_ISNEW') || false

(2)調(diào)整dom中



  {{$t(`頭像`)}}
  
    
  
  
    
  


  {{$t(`昵稱(chēng)`)}}
  
  

(3)methods中加入方法

onChooseAvatar(e) {
  const {
    avatarUrl
  } = e.detail
  this.$util.uploadImgs('upload/image', avatarUrl, (res) => {
    this.userInfo.avatar = res.data.url
  }, (err) => {
    console.log(err)
  })
},

這里有一個(gè)公共方法uploadImgs需要在/utils/util.js中添加



uploadImgs(uploadUrl, filePath, successCallback, errorCallback) {
  let that = this;
  uni.uploadFile({
    url: HTTP_REQUEST_URL + '/api/' + uploadUrl,
    filePath: filePath,
    fileType: 'image',
    name: 'pics',
    formData: {
      'filename': 'pics'
    },
    header: {
    // #ifdef MP
    "Content-Type": "multipart/form-data",
    // #endif
    [TOKENNAME]: 'Bearer ' + store.state.app.token
  },
  success: (res) => {
  uni.hideLoading();
  if (res.statusCode == 403) {
    that.Tips({
      title: res.data
    });
  } else {
    let data = res.data ? JSON.parse(res.data) : {};
    if (data.status == 200) {
      successCallback && successCallback(data)
    } else {
      errorCallback && errorCallback(data);
        that.Tips({
          title: data.msg
        });
      }
    }
  },
  fail: (err) => {
    uni.hideLoading();
    that.Tips({
      title: i18n.t(`上傳圖片失敗`)
      });
    }
  })
},

以上就是本次調(diào)整的所有內(nèi)容了!

具體源碼可以查看 https://gitee.com/ZhongBangKeJi/CRMEB/tree/master/template/uni-app

同時(shí)希望大家給個(gè)免費(fèi)的 star 喔~ 比心



請(qǐng)登錄后查看

liusll 最后編輯于2022-12-15 15:15:00

快捷回復(fù)
回復(fù)
回復(fù)
回復(fù)({{post_count}}) {{!is_user ? '我的回復(fù)' :'全部回復(fù)'}}
排序 默認(rèn)正序 回復(fù)倒序 點(diǎn)贊倒序

{{item.user_info.nickname ? item.user_info.nickname : item.user_name}} LV.{{ item.user_info.bbs_level }}

作者 管理員 企業(yè)

{{item.floor}}# 同步到gitee 已同步到gitee {{item.is_suggest == 1? '取消推薦': '推薦'}}
{{item.is_suggest == 1? '取消推薦': '推薦'}}
沙發(fā) 板凳 地板 {{item.floor}}#
{{item.user_info.title || '暫無(wú)簡(jiǎn)介'}}
附件

{{itemf.name}}

{{item.created_at}}  {{item.ip_address}}
打賞
已打賞¥{{item.reward_price}}
{{item.like_count}}
{{item.showReply ? '取消回復(fù)' : '回復(fù)'}}
刪除
回復(fù)
回復(fù)

{{itemc.user_info.nickname}}

{{itemc.user_name}}

回復(fù) {{itemc.comment_user_info.nickname}}

附件

{{itemf.name}}

{{itemc.created_at}}
打賞
已打賞¥{{itemc.reward_price}}
{{itemc.like_count}}
{{itemc.showReply ? '取消回復(fù)' : '回復(fù)'}}
刪除
回復(fù)
回復(fù)
查看更多
打賞
已打賞¥{{reward_price}}
5237
{{like_count}}
{{collect_count}}
添加回復(fù) ({{post_count}})

相關(guān)推薦

CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序發(fā)行提示插件未授權(quán),uniapp小程序直播引入的時(shí)候報(bào)錯(cuò)
10.7K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序充值在哪里關(guān)閉
3.1K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序上傳后打開(kāi)空白
3.9K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序端(由于清除用戶數(shù)據(jù))導(dǎo)致掃碼綁定分銷(xiāo)關(guān)系錯(cuò)亂或者綁定失敗
4K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序端輪播圖不顯示,h5端顯示
3K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)小程序發(fā)布之后無(wú)法生成海報(bào)問(wèn)題
5.3K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)配置了小程序訂閱消息不生效、小程序訂閱消息收不到、同步小程序訂閱消息報(bào)錯(cuò)
4K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)Mac node.js如何切換版本
3.9K
2022/11/26
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)查看授權(quán)碼
2.9K
2022/11/25
CRMEB開(kāi)源打通版/標(biāo)準(zhǔn)版v4電商商城系統(tǒng)用戶默認(rèn)頭像修改
3.4K
2022/11/25

快速安全登錄

使用微信掃碼登錄
{{item.label}} 加精
{{item.label}} {{item.label}} 板塊推薦 常見(jiàn)問(wèn)題 產(chǎn)品動(dòng)態(tài) 精選推薦 首頁(yè)頭條 首頁(yè)動(dòng)態(tài) 首頁(yè)推薦
取 消 確 定
回復(fù)
回復(fù)
問(wèn)題:
問(wèn)題自動(dòng)獲取的帖子內(nèi)容,不準(zhǔn)確時(shí)需要手動(dòng)修改. [獲取答案]
答案:
提交
bug 需求 取 消 確 定
打賞金額
當(dāng)前余額:¥{{rewardUserInfo.reward_price}}
{{item.price}}元
請(qǐng)輸入 0.1-{{reward_max_price}} 范圍內(nèi)的數(shù)值
打賞成功
¥{{price}}
完成 確認(rèn)打賞

微信登錄/注冊(cè)

切換手機(jī)號(hào)登錄

{{ bind_phone ? '綁定手機(jī)' : '手機(jī)登錄'}}

{{codeText}}
切換微信登錄/注冊(cè)
暫不綁定
CRMEB客服

CRMEB咨詢(xún)熱線 咨詢(xún)熱線

400-8888-794

微信掃碼咨詢(xún)

CRMEB開(kāi)源商城下載 源碼下載 CRMEB幫助文檔 幫助文檔
返回頂部 返回頂部
CRMEB客服