Commit 51608cb8 authored by linwenqing's avatar linwenqing

fix:授权手机号和上传弱网

parent 75016146
...@@ -31,9 +31,6 @@ function getPhoto(type, token) { ...@@ -31,9 +31,6 @@ function getPhoto(type, token) {
//上传七牛 //上传七牛
function upload(filePath, token) { function upload(filePath, token) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
uni.showLoading({
title: '上传中...',
})
let key = let key =
new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名 new Date().getTime() + Math.random(1000) + filePath.split('/').pop() //key为自定义文件名
uni.uploadFile({ uni.uploadFile({
......
...@@ -205,19 +205,8 @@ export default { ...@@ -205,19 +205,8 @@ export default {
}, },
}) })
}, },
inGetPhone() {
uni.showLoading({
title: '授权中...',
})
},
inUpload() {
uni.showLoading({
title: '上传中...',
})
},
refleshCode() { refleshCode() {
let that = this let that = this
this.inGetPhone()
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: (code_res) => { success: (code_res) => {
...@@ -233,7 +222,6 @@ export default { ...@@ -233,7 +222,6 @@ export default {
.loginWechatAuth(params) .loginWechatAuth(params)
.then((res) => { .then((res) => {
this.student.phoneNumber = res.phoneNumber this.student.phoneNumber = res.phoneNumber
this.inGetPhone()
this.$u.api this.$u.api
.updateUserInfo({ .updateUserInfo({
phoneNumber: res.phoneNumber, phoneNumber: res.phoneNumber,
...@@ -252,7 +240,6 @@ export default { ...@@ -252,7 +240,6 @@ export default {
}) })
}, },
changeHead() { changeHead() {
this.inUpload()
//更换头像 //更换头像
upload.getPhoto(2, this.qiToken).then((res) => { upload.getPhoto(2, this.qiToken).then((res) => {
this.student.avatarPath = process.uniEnv.qn_asset_url + res.key this.student.avatarPath = process.uniEnv.qn_asset_url + res.key
...@@ -265,14 +252,10 @@ export default { ...@@ -265,14 +252,10 @@ export default {
...params, ...params,
} }
getApp().track('changeAvatar', trackParams) getApp().track('changeAvatar', trackParams)
this.inUpload() this.$u.api.updateUserInfo(params)
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
}) })
}, },
changeCertPhoto() { changeCertPhoto() {
this.inUpload()
//更换证件头像 //更换证件头像
upload.getPhoto(2, this.qiToken).then((res) => { upload.getPhoto(2, this.qiToken).then((res) => {
this.student.certificatePhotoPath = this.student.certificatePhotoPath =
...@@ -286,10 +269,7 @@ export default { ...@@ -286,10 +269,7 @@ export default {
...params, ...params,
} }
getApp().track('changeCertPhoto', trackParams) getApp().track('changeCertPhoto', trackParams)
this.inUpload() this.$u.api.updateUserInfo(params)
this.$u.api.updateUserInfo(params).then(() => {
uni.hideLoading()
})
}) })
}, },
userRefuseTip() { userRefuseTip() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment