示例#1
0
文件: views.py 项目: z991/drf-eshop
 def get(self, request, format=None):
     user = self.request.user
     serializer = UserInfoSerializer(user)
     return Response(serializer.data)
示例#2
0
 def get(self, request, format=None):
     # user會被設定為當前用戶,因為只能看自己的用戶信息(不這樣設置的話,就能通過id看別人的信息)
     user = self.request.user
     serializer = UserInfoSerializer(user)
     return Response(serializer.data)