|
@@ -16,7 +16,7 @@ from django.views.generic import TemplateView, View
|
|
|
|
|
|
from Ansjer.config import BASE_DIR, SERVER_TYPE, ACCESS_KEY_ID, SECRET_ACCESS_KEY, REGION_NAME, AVATAR_BUCKET
|
|
|
from Ansjer.config import SERVER_DOMAIN
|
|
|
-from Model.models import Role, Device_User, UserOauth2Model, UserExModel
|
|
|
+from Model.models import Role, Device_User, UserOauth2Model, UserExModel, CountryLanguageModel
|
|
|
from Object.RedisObject import RedisObject
|
|
|
from Object.ResponseObject import ResponseObject
|
|
|
from Object.TokenObject import TokenObject
|
|
@@ -69,8 +69,16 @@ class showUserMoreView(TemplateView):
|
|
|
if len(v['fields']['role']):
|
|
|
roleName = ModelService.getRole(rid=v['fields']['role'][0])
|
|
|
sqlDict["datas"][k]['fields']['rolename'] = roleName
|
|
|
+ region_country = sqlDict["datas"][k]['fields']['region_country']
|
|
|
+ if not region_country == 0:
|
|
|
+ country_qs = CountryLanguageModel.objects.filter(country_id=region_country).values(
|
|
|
+ 'country__region__push_api')
|
|
|
+ sqlDict["datas"][k]['fields']['api'] = country_qs[0]['country__region__push_api']
|
|
|
+ else:
|
|
|
+ sqlDict["datas"][k]['fields']['api'] = ''
|
|
|
+
|
|
|
# 增加oauth2关联数据
|
|
|
- ua_qs = UserOauth2Model.objects.filter(userID_id=userID).values_list('authType',flat=True)
|
|
|
+ ua_qs = UserOauth2Model.objects.filter(userID_id=userID).values_list('authType', flat=True)
|
|
|
sqlDict["oauth2"] = list(ua_qs)
|
|
|
return response.json(0, sqlDict)
|
|
|
|
|
@@ -207,7 +215,7 @@ class getAvatarView(TemplateView):
|
|
|
except Exception as e:
|
|
|
print(e)
|
|
|
return response.json(500, repr(e))
|
|
|
-
|
|
|
+
|
|
|
fullPath = os.path.join(BASE_DIR, "static", filePath).replace('\\', '/')
|
|
|
if os.path.isfile(fullPath):
|
|
|
try:
|