在uni_modules/uni-id-pages/pages/register/register.vue页面中:
data() {
return {
formData: {
username: "",
nickname: "",
worknum: "",
mobile: "",
password: "",
password2: "",
captcha: ""
},
rules,
focusUsername: false,
focusNickname: false,
focusWorknum: false,
focusMobile: false,
focusPassword: false,
focusPassword2: false,
logo: "/static/logo.png"
}
},
submitForm(params) {
uniIdCo.registerUser(this.formData).then(e => {
this.loginSuccess(e)
})
.catch(e => {
console.log(e.message);
//更好的体验:登录错误,直接刷新验证码
this.$refs.captcha.getImageCaptcha()
})
},
注册时,新增了手机号、工号,但是数据库uni-id-users中并不会保存mobile和worknum的数据。看官网(https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#register-user)的说明中接口只有username, password, captcha,
nickname, inviteCode这几个。所以想问问是否能够请自定义其他参数?如果可以,该如何做?【新手一个,还在学习中,找了两天资料还是没有解决这个问题,特来提问,望回复~】
1***@qq.com (作者)
谢谢您【抱拳】
2023-02-13 15:49