完善登录逻辑和个人资料完善
This commit is contained in:
@@ -237,7 +237,7 @@ onLoad((opts) => {
|
||||
uni.setNavigationBarTitle({ title: '服务人员登录' })
|
||||
} else {
|
||||
loginMode.value = 'consumer'
|
||||
uni.setNavigationBarTitle({ title: '用户登录' })
|
||||
uni.setNavigationBarTitle({ title: '登录' })
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -499,6 +499,7 @@ const handleLogin = async () => {
|
||||
clearDeliveryAuth()
|
||||
throw new Error(authResult.message != '' ? authResult.message : '服务人员登录失败')
|
||||
}
|
||||
uni.$emit('authChanged', { loggedIn: true })
|
||||
uni.showToast({ title: '登录成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
const redirect = redirectPath.value
|
||||
@@ -543,6 +544,7 @@ const handleLogin = async () => {
|
||||
setUserProfile(adminProfile)
|
||||
// uni.setStorageSync('merchant_id', 'admin') // mock removed
|
||||
|
||||
uni.$emit('authChanged', { loggedIn: true })
|
||||
uni.showToast({ title: '管理员登录成功', icon: 'success' })
|
||||
setTimeout(() => {
|
||||
goTargetHome()
|
||||
@@ -649,6 +651,7 @@ const handleLogin = async () => {
|
||||
// 已移除对 shared storage user_id 的依赖
|
||||
const currentSession = supa.getSession()
|
||||
|
||||
uni.$emit('authChanged', { loggedIn: true })
|
||||
uni.showToast({ title: '登录成功', icon: 'success' })
|
||||
|
||||
// 获取并上报推送 CID(若可用)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -24,6 +24,11 @@ CREATE TABLE IF NOT EXISTS public.ak_users (
|
||||
bio text,
|
||||
avatar_url text,
|
||||
preferred_language text,
|
||||
health_goal text,
|
||||
service_address text,
|
||||
emergency_contact text,
|
||||
chronic_notes text,
|
||||
care_preference text,
|
||||
role text,
|
||||
school_id text,
|
||||
grade_id text,
|
||||
@@ -44,6 +49,11 @@ COMMENT ON COLUMN public.ak_users.weight_kg IS '体重(公斤)';
|
||||
COMMENT ON COLUMN public.ak_users.bio IS '个人简介';
|
||||
COMMENT ON COLUMN public.ak_users.avatar_url IS '头像地址';
|
||||
COMMENT ON COLUMN public.ak_users.preferred_language IS '偏好语言';
|
||||
COMMENT ON COLUMN public.ak_users.health_goal IS '健康目标';
|
||||
COMMENT ON COLUMN public.ak_users.service_address IS '常住服务地址';
|
||||
COMMENT ON COLUMN public.ak_users.emergency_contact IS '紧急联系人';
|
||||
COMMENT ON COLUMN public.ak_users.chronic_notes IS '慢病或过敏备注';
|
||||
COMMENT ON COLUMN public.ak_users.care_preference IS '护理偏好';
|
||||
COMMENT ON COLUMN public.ak_users.role IS '角色(如 customer/merchant/admin 等)';
|
||||
COMMENT ON COLUMN public.ak_users.school_id IS '学校ID(可选)';
|
||||
COMMENT ON COLUMN public.ak_users.grade_id IS '年级ID(可选)';
|
||||
|
||||
@@ -10,10 +10,17 @@ export type UserProfile ={
|
||||
bio?: string;
|
||||
avatar_url?: string;
|
||||
preferred_language?: string;
|
||||
health_goal?: string;
|
||||
service_address?: string;
|
||||
emergency_contact?: string;
|
||||
chronic_notes?: string;
|
||||
care_preference?: string;
|
||||
role?:string;
|
||||
school_id?: string; // 所属学校ID
|
||||
grade_id?: string; // 所属年级ID
|
||||
class_id?: string; // 所属班级ID
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
}
|
||||
|
||||
// 语言选项类型 - 对应 ak_languages 表
|
||||
|
||||
Reference in New Issue
Block a user