提交 e62a9ae4 编写于 作者: study夏羽's avatar study夏羽

1.0.37

上级 0143adf2
<template>
<view class="content">
<button @click="toUserInfoPage">个人资料</button>
<uni-forms-item label="登录方式">
<uni-forms-item label="登录方式" labelWidth="70">
<uni-data-checkbox :multiple="false" v-model="loginType" :localdata="loginTypeOption"></uni-data-checkbox>
</uni-forms-item>
<button @click="toLogin">前往登录</button>
......@@ -26,12 +26,12 @@
"value": "smsCode",
"text": "手机验证码"
}, {
"value": "apple",
"text": "苹果登录"
}, {
"value": "weixinMobile",
"text": "微信手机号登录"
}]
"value": "apple",
"text": "苹果登录"
}, {
"value": "weixinMobile",
"text": "微信手机号登录"
}]
}
},
onLoad() {},
......
## 1.0.37(2022-12-09)
- 优化admin端样式
## 1.0.36(2022-12-08)
- uni-id-co 优化 手机号与邮箱验证规则为空字符串时不校验
- uni-id-co 修复 `updateUser` 接口部分参数为空时数据修改异常
......
......@@ -36,7 +36,7 @@ let mixin = {
})
}
this.$nextTick(n => {
console.log(this.$refs.uniFabLogin);
// console.log(this.$refs.uniFabLogin);
this.$refs.uniFabLogin.login({
code:e.code
}, 'weixin')
......
......@@ -115,9 +115,10 @@
text-align: center;
height: 40px;
line-height: 40px;
margin: 15px 0 0 0;
margin: 15px 0 10px 0;
color: #FFF !important;
border-radius: 5px;
font-size: 16px;
}
.uni-body.uni_modules-uni-id-pages-pages-login-login-withoutpwd{
......
......@@ -6,20 +6,20 @@ const db = uniCloud.database();
const usersTable = db.collection('uni-id-users')
let hostUserInfo = uni.getStorageSync('uni-id-pages-userInfo')||{}
console.log( hostUserInfo);
// console.log( hostUserInfo);
const data = {
userInfo: hostUserInfo,
hasLogin: Object.keys(hostUserInfo).length != 0
}
console.log('data', data);
// console.log('data', data);
// 定义 mutations, 修改属性
export const mutations = {
// data不为空,表示传递要更新的值(注意不是覆盖是合并),什么也不传时,直接查库获取更新
async updateUserInfo(data = false) {
if (data) {
usersTable.where('_id==$env.uid').update(data).then(e => {
console.log(e);
// console.log(e);
if (e.result.updated) {
uni.showToast({
title: "更新成功",
......@@ -41,7 +41,7 @@ export const mutations = {
let res = await usersTable.where("'_id' == $cloudEnv_uid")
.field('mobile,nickname,username,email,avatar_file')
.get()
console.log('fromDbData',res.result.data);
// console.log('fromDbData',res.result.data);
this.setUserInfo(res.result.data[0])
} catch (e) {
this.setUserInfo({},{cover:true})
......@@ -50,11 +50,11 @@ export const mutations = {
}
},
async setUserInfo(data, {cover}={cover:false}) {
console.log('set-userInfo', data);
// console.log('set-userInfo', data);
let userInfo = cover?data:Object.assign(store.userInfo,data)
store.userInfo = Object.assign({},userInfo)
store.hasLogin = Object.keys(store.userInfo).length != 0
console.log('store.userInfo', store.userInfo);
// console.log('store.userInfo', store.userInfo);
uni.setStorage({
key: "uni-id-pages-userInfo",
data:store.userInfo
......@@ -90,7 +90,7 @@ export const mutations = {
}
// #ifdef H5
if (e.loginType == 'weixin') {
console.log('window.history', window.history);
// console.log('window.history', window.history);
return window.history.go(-3)
}
// #endif
......@@ -110,10 +110,7 @@ export const mutations = {
const {
showToast = true, toastText = '登录成功', autoBack = true, uniIdRedirectUrl = '', passwordConfirmed
} = e
console.log({
toastText,
autoBack
});
// console.log({toastText,autoBack});
if (showToast) {
uni.showToast({
title: toastText,
......
......@@ -48,7 +48,7 @@
async mounted() {
// #ifdef H5
this.isPC = !['ios', 'android'].includes(uni.getSystemInfoSync().platform);
console.log(' this.isPC', this.isPC, uni.getSystemInfoSync().platform);
// console.log(' this.isPC', this.isPC, uni.getSystemInfoSync().platform);
// #endif
},
computed: {
......@@ -68,7 +68,7 @@
mutations.updateUserInfo({avatar_file})
},
uploadAvatarImg(res) {
console.log(this.hasLogin);
// console.log(this.hasLogin);
if(!this.hasLogin){
return uni.navigateTo({
url:'/uni_modules/uni-id-pages/pages/login/login-withoutpwd'
......@@ -84,7 +84,7 @@
count: 1,
crop,
success: async (res) => {
console.log(res);
// console.log(res);
let tempFile = res.tempFiles[0],
avatar_file = {
// #ifdef H5
......@@ -109,13 +109,13 @@
}
},
complete(e) {
console.log(e);
// console.log(e);
}
});
})
}
// #endif
console.log(this.userInfo);
// console.log(this.userInfo);
let cloudPath = this.userInfo._id + '' + Date.now()
avatar_file.name = cloudPath
uni.showLoading({
......@@ -131,9 +131,7 @@
});
// console.log(result)
avatar_file.url = fileID
console.log({
avatar_file
});
// console.log({avatar_file});
uni.hideLoading()
this.setAvatarFile(avatar_file)
}
......
......@@ -28,12 +28,12 @@
uni.showLoading({ mask: true })
wx.checkSession({
success() {
console.log('session_key 未过期');
// console.log('session_key 未过期');
resolve()
uni.hideLoading()
},
fail() {
console.log('session_key 已经失效,正在执行更新');
// console.log('session_key 已经失效,正在执行更新');
wx.login({
success({
code
......@@ -41,13 +41,13 @@
uniCloud.importObject("uni-id-co",{
customUI:true
}).loginByWeixin({code}).then(e=>{
console.log(e);
// console.log(e);
resolve()
}).catch(e=>{
console.log(e);
reject()
}).finally(e=>{
console.log(e);
// console.log(e);
uni.hideLoading()
})
},
......@@ -61,13 +61,13 @@
})
},
async bindMobileByMpWeixin(e) {
console.log(e);
// console.log(e);
if (e.detail.errMsg == "getPhoneNumber:ok") {
console.log(e.detail);
// console.log(e.detail);
//检查登录信息是否过期,否则通过重新登录刷新session_key
await this.beforeGetphonenumber()
uniIdCo.bindMobileByMpWeixin(e.detail).then(e => {
console.log(e);
// console.log(e);
this.$emit('success')
}).finally(e => {
this.closeMe()
......
......@@ -141,7 +141,7 @@
const uniIdCo = uniCloud.importObject("uni-id-co", {
customUI: true
})
console.log('uniIdCo', uniIdCo)
// console.log('uniIdCo', uniIdCo)
console.log('sendEmailCode',{
"email": this.email,
"scene": this.type,
......@@ -152,7 +152,7 @@
"scene": this.type,
"captcha": this.captcha
}).then(result => {
console.log(result.code);
// console.log(result.code);
uni.showToast({
title: "邮箱验证码发送成功",
icon: 'none',
......@@ -161,7 +161,7 @@
this.reverseNumber = Number(this.count);
this.getCode();
}).catch(e => {
console.log(JSON.stringify(e));
// console.log(JSON.stringify(e));
if (e.code == "uni-id-invalid-mail-template") {
this.modelValue = "123456"
uni.showToast({
......
......@@ -49,7 +49,7 @@
return this.getParentComponent().agree
},
set(agree) {
console.log('setAgree', agree);
// console.log('setAgree', agree);
return this.getParentComponent().agree = agree
}
}
......@@ -294,15 +294,13 @@
}
//判断是否需要弹出隐私协议授权框
console.log(type, this.agree);
// console.log(type, this.agree);
let needAgreements = (config?.agreements?.scope || []).includes('register')
console.log({
needAgreements
});
// console.log({needAgreements});
if (type != 'univerify' && needAgreements && !this.agree) {
let agreementsRef = this.getParentComponent().$refs.agreements
return agreementsRef.popup(() => {
console.log(type, navigateBack);
// console.log(type, navigateBack);
this.login_before(type, navigateBack, options)
})
}
......@@ -314,7 +312,7 @@
document.domain +
(window.location.href.includes('#')?'/#':'') +
'/uni_modules/uni-id-pages/pages/login/login-withoutpwd?is_weixin_redirect=true&type=weixin'
console.log('redirectUrl----',redirectUrl);
// console.log('redirectUrl----',redirectUrl);
let ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/MicroMessenger/i) == 'micromessenger'){
// console.log('在微信公众号内');
......@@ -340,7 +338,7 @@
if (type == 'univerify') {
let univerifyManager = uni.getUniverifyManager()
let onButtonsClickFn = async res => {
console.log('点击了第三方登录,provider:', res, res.provider, this.univerifyStyle.buttons.list);
// console.log('点击了第三方登录,provider:', res, res.provider, this.univerifyStyle.buttons.list);
//同步一键登录弹出层隐私协议框是否打勾
let agree = (await uni.getCheckBoxState())[1].state
//console.log('agree',agree);
......@@ -381,7 +379,7 @@
return univerifyManager.login({
"univerifyStyle": this.univerifyStyle,
success: res => {
console.log('login success', res)
// console.log('login success', res)
this.login(res.authResult, 'univerify')
},
fail(err) {
......@@ -392,7 +390,7 @@
});
},
complete: async e => {
console.log(e);
// console.log(e);
uni.hideLoading()
//同步一键登录弹出层隐私协议框是否打勾
this.agree = (await uni.getCheckBoxState())[1].state
......@@ -415,7 +413,7 @@
"univerifyStyle": this.univerifyStyle,
// #endif
success: async e => {
console.log(e);
// console.log(e);
if (type == 'apple') {
let res = await this.getUserInfo({
provider: "apple"
......@@ -434,18 +432,15 @@
})
},
login(params, type) { //联网验证登录
console.log('执行登录开始----');
console.log({
params,
type
});
// console.log('执行登录开始----');
console.log({params,type});
//toLowerCase
let action = 'loginBy' + type.trim().replace(type[0], type[0].toUpperCase())
const uniIdCo = uniCloud.importObject("uni-id-co",{
customUI:true
})
uniIdCo[action](params).then(result => {
console.log("login-result", result);
// console.log("login-result", result);
uni.showToast({
title: '登录成功',
icon: 'none',
......@@ -468,7 +463,7 @@
mutations.loginSuccess(result)
})
.catch(e=>{
console.log(e);
// console.log(e);
uni.showModal({
content: e.message,
confirmText:"知道了",
......
......@@ -146,7 +146,7 @@
"scene": this.type,
"captcha": this.captcha
}).then(result => {
console.log(result.code);
// console.log(result.code);
uni.showToast({
title: "短信验证码发送成功",
icon: 'none',
......@@ -155,7 +155,7 @@
this.reverseNumber = Number(this.count);
this.getCode();
}).catch(e => {
console.log(JSON.stringify(e));
// console.log(JSON.stringify(e));
if (e.code == "uni-id-invalid-sms-template-id") {
this.modelValue = "123456"
uni.showToast({
......
......@@ -31,7 +31,7 @@
uni.getUserProfile({
desc: "用于设置账户昵称和头像",
complete: (e) => {
console.log("getUserProfile:", e);
// console.log("getUserProfile:", e);
callBack(e)
}
})
......
......@@ -5,7 +5,7 @@ export default {
登录类型 未列举到的或运行环境不支持的,将被自动隐藏。
如果需要在不同平台有不同的配置,直接用条件编译即可
*/
"isAdmin": false, // 区分管理端与用户端
"isAdmin": true, // 区分管理端与用户端
"loginTypes": [
// "qq",
// "xiaomi",
......
......@@ -50,7 +50,7 @@ export default async function() {
uni.preLogin({
provider: 'univerify',
complete: e => {
console.log(e);
// console.log(e);
}
})
}
......@@ -65,10 +65,7 @@ export default async function() {
code, // 错误码详见https://uniapp.dcloud.net.cn/uniCloud/clientdb?id=returnvalue
message
}) {
console.error('onDBError', {
code,
message
});
// console.error('onDBError', {code,message});
}
// 解绑clientDB错误事件
//db.off('error', onDBError)
......@@ -77,17 +74,17 @@ export default async function() {
//4. 同步客户端push_clientid至device表
if (uniCloud.onRefreshToken) {
uniCloud.onRefreshToken(() => {
console.log('onRefreshToken');
// console.log('onRefreshToken');
if (uni.getPushClientId) {
uni.getPushClientId({
success: async function(e) {
console.log(e)
// console.log(e)
let pushClientId = e.cid
console.log(pushClientId);
// console.log(pushClientId);
let res = await uniIdCo.setPushCid({
pushClientId
})
console.log('getPushClientId', res);
// console.log('getPushClientId', res);
},
fail(e) {
console.log(e)
......
{
"id": "uni-id-pages",
"displayName": "uni-id-pages",
"version": "1.0.36",
"version": "1.0.37",
"description": "云端一体简单、统一、可扩展的用户中心页面模版",
"keywords": [
"用户管理",
......
......@@ -20,7 +20,7 @@
});
title = "页面路径错误"
}else{
console.log(url,title);
// console.log(url,title);
this.url = url;
}
if(title){
......
......@@ -38,7 +38,7 @@
this.phone = phoneNumber;
},
onShow() {
console.log('onShow');
// console.log('onShow');
// #ifdef H5
document.onkeydown = event => {
var e = event || window.event;
......@@ -68,14 +68,14 @@
"code": this.code,
"captcha": this.captcha
}).then(e => {
console.log(e);
// console.log(e);
this.loginSuccess(e)
}).catch(e => {
if (e.errCode == 'uni-id-captcha-required') {
this.$refs.popup.open()
} else {
console.log(e.errMsg);
console.log(e.errCode);
// console.log(e.errCode);
}
}).finally(e => {
this.captcha = ''
......
......@@ -11,8 +11,8 @@
<text class="tip">将根据第三方账号服务平台的授权范围获取你的信息</text>
<view class="quickLogin">
<image v-if="type !== 'weixinMobile'" @click="quickLogin" :src="imgSrc" mode="widthFix" class="quickLoginBtn"></image>
<button v-else type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin">微信授权手机号登录</button>
<uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements>
<button v-else type="primary" open-type="getPhoneNumber" @getphonenumber="quickLogin" class="uni-btn">微信授权手机号登录</button>
<uni-id-pages-agreements scope="register" ref="agreements"></uni-id-pages-agreements>
</view>
</template>
<template v-else>
......@@ -56,7 +56,7 @@
}
},
async onLoad(e) {
console.log(e);
// console.log(e);
//获取通过url传递的参数type设置当前登录方式,如果没传递直接默认以配置的登录
let type = e.type || config.loginTypes[0]
this.type = type
......@@ -111,7 +111,7 @@
this.$refs.uniFabLogin.login_before(this.type, true, options)
},
toSmsPage() {
console.log('toSmsPage',this.agree);
// console.log('toSmsPage',this.agree);
if (!this.isPhone) {
this.focusPhone = true
return uni.showToast({
......@@ -147,7 +147,13 @@
<style lang="scss" scoped>
@import "@/uni_modules/uni-id-pages/common/login-page.scss";
@media screen and (min-width: 690px) {
.uni-content{
height: 350px;
}
}
.uni-content,
.quickLogin {
/* #ifndef APP-NVUE */
......
......@@ -152,7 +152,7 @@
@media screen and (min-width: 690px) {
.uni-content {
max-height: 650px;
height: 600px;
}
}
......
......@@ -102,18 +102,18 @@
}).catch((errors) => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
console.log(key);
// console.log(key);
this['focus'+key] = true
})
},
submitForm(params) {
uniIdCo.registerAdmin(this.formData).then(e => {
console.log(e);
// console.log(e);
uni.navigateBack()
})
.catch(e => {
console.log(e);
console.log(e.message);
// console.log(e);
// console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this.$refs.captcha.getImageCaptcha()
uni.showModal({
......@@ -153,6 +153,7 @@
@media screen and (min-width: 690px) {
.uni-content{
padding: 30px 40px 60px;
max-height: 520px;
}
.link-box {
......
......@@ -144,22 +144,22 @@
}).catch((errors) => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
console.log(key);
// console.log(key);
this['focus'+key] = true
})
},
submitForm(params) {
uniIdCo.registerUserByEmail(this.formData).then(e => {
console.log(e);
// console.log(e);
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd',
complete: (e) => {
console.log(e);
// console.log(e);
}
})
})
.catch(e => {
console.log(e);
// console.log(e);
console.log(e.message);
})
},
......
......@@ -109,17 +109,17 @@
}).catch((errors) => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
console.log(key);
// console.log(key);
this['focus' + key] = true
})
},
submitForm(params) {
uniIdCo.registerUser(this.formData).then(e => {
console.log(e);
// console.log(e);
this.loginSuccess(e)
})
.catch(e => {
console.log(e);
// console.log(e);
console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this.$refs.captcha.getImageCaptcha()
......
......@@ -137,8 +137,8 @@
* 完成并提交
*/
submit() {
console.log("formData", this.formData);
console.log('rules', this.rules);
// console.log("formData", this.formData);
// console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
......@@ -153,11 +153,11 @@
password,
captcha
}).then(e => {
console.log(e);
// console.log(e);
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd',
complete: (e) => {
console.log(e);
// console.log(e);
}
})
})
......@@ -171,11 +171,11 @@
}).catch(errors=>{
let key = errors[0].key
if(key == 'code'){
console.log(this.$refs.shortCode);
// console.log(this.$refs.shortCode);
return this.$refs.shortCode.focusSmsCodeInput = true
}
key = key.replace(key[0], key[0].toUpperCase())
console.log(key,'focus'+key);
// console.log(key,'focus'+key);
this['focus'+key] = true
})
},
......@@ -184,11 +184,11 @@
url: '/uni_modules/uni-id-pages/pages/retrieve/retrieve'
})
},
backLogin () {
uni.redirectTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
}
backLogin () {
uni.redirectTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withpwd'
})
}
}
}
</script>
......
......@@ -166,8 +166,8 @@
* 完成并提交
*/
submit() {
console.log("formData", this.formData);
console.log('rules', this.rules);
// console.log("formData", this.formData);
// console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
......@@ -182,7 +182,7 @@
password,
captcha
}).then(e => {
console.log(e);
// console.log(e);
uni.navigateBack()
})
.catch(e => {
......@@ -195,11 +195,11 @@
}).catch(errors=>{
let key = errors[0].key
if(key == 'code'){
console.log(this.$refs.shortCode);
// console.log(this.$refs.shortCode);
return this.$refs.shortCode.focusSmsCodeInput = true
}
key = key.replace(key[0], key[0].toUpperCase())
console.log(key,'focus'+key);
// console.log(key,'focus'+key);
this['focus'+key] = true
})
},
......
......@@ -65,10 +65,10 @@
});
}
console.log(this.formData);
// console.log(this.formData);
const uniIdCo = uniCloud.importObject("uni-id-co")
uniIdCo.bindMobileBySms(this.formData).then(e => {
console.log(e);
// console.log(e);
uni.showToast({
title: e.errMsg,
icon: 'none',
......
......@@ -82,8 +82,8 @@
* 完成并提交
*/
submit() {
console.log("formData", this.formData);
console.log('rules', this.rules);
// console.log("formData", this.formData);
// console.log('rules', this.rules);
this.$refs.form.validate()
.then(res => {
let {
......@@ -94,7 +94,7 @@
oldPassword,
newPassword
}).then(e => {
console.log(e);
// console.log(e);
uni.removeStorageSync('uni_id_token');
uni.setStorageSync('uni_id_token_expired', 0)
uni.redirectTo({
......@@ -109,7 +109,7 @@
}).catch(errors => {
let key = errors[0].key
key = key.replace(key[0], key[0].toUpperCase())
console.log(key, 'focus' + key);
// console.log(key, 'focus' + key);
this['focus' + key] = true
})
}
......
......@@ -12,7 +12,7 @@ export default {
data() {return {path: '',options:{"width":600,"height":600}}},
onLoad({path,options}) {
this.path = path
console.log('path-path-path-path',path);
// console.log('path-path-path-path',path);
if(options){
this.options = JSON.parse(options)
}
......
......@@ -43,7 +43,7 @@
const uniIdco = uniCloud.importObject("uni-id-co");
uniIdco.closeAccount().then((e) => {
console.log(e);
// console.log(e);
uni.showToast({
title: '注销成功',
duration: 3000
......
......@@ -115,7 +115,7 @@ export default {
this.$refs.popup.open()
} else {
console.log(e.errMsg);
console.log(e.errCode);
// console.log(e.errCode);
}
}).finally(e => {
this.formData.captcha = ''
......
......@@ -78,7 +78,7 @@
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/login/login-withoutpwd',
complete: (e) => {
console.log(e);
// console.log(e);
}
})
},
......@@ -92,7 +92,7 @@
uni.navigateTo({
url: '/uni_modules/uni-id-pages/pages/userinfo/change_pwd/change_pwd',
complete: (e) => {
console.log(e);
// console.log(e);
}
})
},
......@@ -123,14 +123,14 @@
"provider": 'univerify',
"univerifyStyle": this.univerifyStyle,
success: async e => {
console.log(e.authResult);
// console.log(e.authResult);
uniIdCo.bindMobileByUniverify(e.authResult).then(res => {
console.log(res);
mutations.updateUserInfo()
// console.log(res);
mutations.updateUserInfo()
}).catch(e => {
console.log(e);
}).finally(e=>{
console.log(e);
// console.log(e);
uni.closeAuthView()
})
},
......@@ -143,60 +143,57 @@
})
},
bindMobileBySmsCode() {
uni.navigateTo({
url: './bind-mobile/bind-mobile'
})
uni.navigateTo({
url: './bind-mobile/bind-mobile'
})
},
setNickname(nickname) {
console.log(nickname);
if (nickname) {
mutations.updateUserInfo({nickname})
this.$refs.dialog.close()
} else {
this.$refs.dialog.open()
}
// console.log(nickname);
if (nickname) {
mutations.updateUserInfo({nickname})
this.$refs.dialog.close()
} else {
this.$refs.dialog.open()
}
},
deactivate(){
uni.navigateTo({
url:"/uni_modules/uni-id-pages/pages/userinfo/deactivate/deactivate"
})
},
async bindThirdAccount(provider) {
const uniIdCo = uniCloud.importObject("uni-id-co")
const bindField = {
weixin: 'wx_openid',
alipay: 'ali_openid',
apple: 'apple_openid',
qq: 'qq_openid'
}[provider.toLowerCase()]
if (this.userInfo[bindField]) {
await uniIdCo['unbind' + provider]()
await mutations.updateUserInfo()
} else {
uni.login({
provider: provider.toLowerCase(),
onlyAuthorize: true,
success: async e => {
const res = await uniIdCo['bind' + provider]({
code: e.code
})
if (res.errCode) {
uni.showToast({
title: res.errMsg || '绑定失败',
duration: 3000
})
}
await mutations.updateUserInfo()
},
fail: async (err) => {
console.log(err);
uni.hideLoading()
}
})
}
async bindThirdAccount(provider) {
const uniIdCo = uniCloud.importObject("uni-id-co")
const bindField = {
weixin: 'wx_openid',
alipay: 'ali_openid',
apple: 'apple_openid',
qq: 'qq_openid'
}[provider.toLowerCase()]
}
if (this.userInfo[bindField]) {
await uniIdCo['unbind' + provider]()
await mutations.updateUserInfo()
} else {
uni.login({
provider: provider.toLowerCase(),
onlyAuthorize: true,
success: async e => {
const res = await uniIdCo['bind' + provider]({code: e.code})
if (res.errCode) {
uni.showToast({
title: res.errMsg || '绑定失败',
duration: 3000
})
}
await mutations.updateUserInfo()
},
fail: async (err) => {
console.log(err);
uni.hideLoading()
}
})
}
}
}
}
</script>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册