consumer模块完成度95%,实现数据库多端注册登录,优化安卓端小程序bug
This commit is contained in:
@@ -325,8 +325,10 @@ const handleLogin = async () => {
|
||||
errorMsg.includes('邮箱') && errorMsg.includes('确认')) {
|
||||
throw new Error('邮箱未确认,请先检查邮箱并点击确认链接')
|
||||
} else if (errorMsg.includes('Invalid login credentials') ||
|
||||
errorCode === 'invalid_credentials') {
|
||||
throw new Error('邮箱或密码错误')
|
||||
errorCode === 'invalid_credentials' ||
|
||||
errorMsg.includes('credentials') ||
|
||||
errorMsg.includes('invalid')) {
|
||||
throw new Error('用户名或密码错误')
|
||||
} else {
|
||||
throw new Error(errorMsg != '' ? errorMsg : '登录失败,请重试')
|
||||
}
|
||||
|
||||
@@ -183,7 +183,13 @@
|
||||
isLoading.value = true
|
||||
|
||||
try {
|
||||
const result = await supa.signUp(email.value.trim(), password.value)
|
||||
// 在注册时传递 user_role 元数据,以便数据库触发器识别
|
||||
const options = new UTSJSONObject()
|
||||
const metaData = new UTSJSONObject()
|
||||
metaData.set('user_role', 'consumer')
|
||||
options.set('data', metaData)
|
||||
|
||||
const result = await supa.signUp(email.value.trim(), password.value, options)
|
||||
|
||||
console.log('注册返回结果:', result)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user