|
|
|
@ -425,7 +425,7 @@ class UserInfoView(APIView): |
|
|
|
|
res = BaseResponse() |
|
|
|
|
serializer = UserInfoSerializer(request.user) |
|
|
|
|
res.data = serializer.data |
|
|
|
|
|
|
|
|
|
res.data['login_type'] = get_login_type() |
|
|
|
|
return Response(res.dict) |
|
|
|
|
|
|
|
|
|
def put(self, request): |
|
|
|
@ -466,6 +466,7 @@ class UserInfoView(APIView): |
|
|
|
|
res.code = 1004 |
|
|
|
|
res.msg = "老密码校验失败" |
|
|
|
|
else: |
|
|
|
|
if get_login_type().get('up'): |
|
|
|
|
username = data.get("username", None) |
|
|
|
|
if username and username != request.user.username: |
|
|
|
|
if check_username_exists(username): |
|
|
|
@ -477,11 +478,10 @@ class UserInfoView(APIView): |
|
|
|
|
res.msg = "用户名至少6位" |
|
|
|
|
res.code = 1006 |
|
|
|
|
return Response(res.dict) |
|
|
|
|
request.user.username = data.get("username", request.user.username) |
|
|
|
|
|
|
|
|
|
request.user.job = data.get("job", request.user.job) |
|
|
|
|
request.user.first_name = data.get("first_name", request.user.first_name) |
|
|
|
|
request.user.username = data.get("username", request.user.username) |
|
|
|
|
|
|
|
|
|
sms_token = data.get("auth_token", None) |
|
|
|
|
if sms_token: |
|
|
|
|
act = data.get("act", None) |
|
|
|
|