|
|
- var that = this;
- that.tui.uploadFile('common/upload', e.avatarUrl).then((e) => {
- console.log(e)
- that.avatar = e.url;
- that.avatarUrl = e.fullurl;
- that.tui.request('user/avatar', {
- avatar: e.url
- }).then((res) => {
- console.log(res)
- if (res.code == 1) {
- uni.setStorageSync('userinfo', res.data.userinfo);
- uni.showToast({
- title: res.msg,
- icon: 'none'
- })
- } else {
- uni.showModal({
- title: '提示',
- content: res.msg,
- showCancel: false
- })
- }
- })
- })
复制代码
|
|