修改商详情页UI
This commit is contained in:
14
mall_sql/migrations/20260603_review_public_profiles.sql
Normal file
14
mall_sql/migrations/20260603_review_public_profiles.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
-- 为商品评价提供最小公开用户资料视图,避免客户端直接访问 auth.users 或整表 ak_users。
|
||||
|
||||
create or replace view public.ak_user_public_profiles as
|
||||
select
|
||||
id,
|
||||
coalesce(nullif(username, ''), '匿名用户') as username,
|
||||
coalesce(avatar_url, '') as avatar_url
|
||||
from public.ak_users;
|
||||
|
||||
comment on view public.ak_user_public_profiles is '商品评价等前台展示使用的最小公开用户资料视图';
|
||||
|
||||
grant select on public.ak_user_public_profiles to anon;
|
||||
grant select on public.ak_user_public_profiles to authenticated;
|
||||
grant select on public.ak_user_public_profiles to service_role;
|
||||
Reference in New Issue
Block a user