Skip to content

Commit 38617c0

Browse files
author
lijianguo
committed
chore(passport): add vue page
1 parent ac38136 commit 38617c0

40 files changed

Lines changed: 638 additions & 799 deletions

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@ venv/
2525

2626
.idea
2727
env/
28+
rootfs/web/yarn-error.log
29+
rootfs/node_modules/

rootfs/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
FROM node:16-alpine3.14 as build-app
2+
3+
ADD web /app
4+
WORKDIR /app
5+
6+
RUN echo 'http://mirrors.aliyun.com/alpine/v3.4/main' > /etc/apk/repositories \
7+
&& npm install \
8+
&& yarn build
9+
10+
111
FROM docker.io/library/python:3.9-alpine
212

313
COPY requirements.txt /app/requirements.txt
@@ -27,6 +37,7 @@ RUN apk add --update --virtual .build-deps \
2737
&& apk del .build-deps
2838

2939
COPY . /app
40+
COPY --from=build-app /app/dist /app/web/dist
3041

3142
WORKDIR /app
3243
CMD ["/app/bin/boot"]

rootfs/api/serializers.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,22 @@ class Meta(UserCreationForm.Meta):
2222

2323

2424
class UserSerializer(serializers.ModelSerializer):
25+
username = serializers.CharField(max_length=150, required=False)
26+
email = serializers.CharField(max_length=254, required=False)
27+
2528
class Meta:
2629
model = User
2730
fields = ('id', 'username', 'email', "first_name", "last_name",
2831
"is_staff", "is_active", "is_superuser")
2932

33+
def update(self, instance, validated_data):
34+
if validated_data.get('username'):
35+
instance.username = validated_data.get('username')
36+
if validated_data.get('email'):
37+
instance.email = validated_data.get('email')
38+
instance.save()
39+
return instance
40+
3041

3142
class UserEmailSerializer(serializers.ModelSerializer):
3243
class Meta:
@@ -60,6 +71,7 @@ class Meta:
6071

6172
class UserTokensSerializer(serializers.ModelSerializer):
6273
"""Serialize user status for a AccessToken model."""
74+
application = serializers.ReadOnlyField(source='application.name')
6375

6476
class Meta:
6577
model = AccessToken

rootfs/api/settings/production.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@
264264
SECRET_KEY = os.environ.get('DRYCC_SECRET_KEY', random_secret)
265265

266266
# database setting
267-
DRYCC_DATABASE_URL = os.environ.get('DRYCC_DATABASE_URL', 'postgres://postgres:123456@192.168.6.50:5432/drycc_passport')
267+
DRYCC_DATABASE_URL = os.environ.get('DRYCC_DATABASE_URL', 'postgres://:@:5432/passport') # noqa
268268
DATABASES = {
269269
'default': dj_database_url.config(default=DRYCC_DATABASE_URL,
270270
conn_max_age=600)
@@ -345,7 +345,6 @@
345345
# Static files (CSS, JavaScript, Images)
346346
# https://docs.djangoproject.com/en/2.2/howto/static-files/
347347
STATIC_URL = '/assets/'
348-
#STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, 'static'))
349348
STATIC_ROOT = os.path.abspath(os.path.join(BASE_DIR, '..', 'web', 'dist', 'assets'))
350349
STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'
351350

rootfs/api/static/css/bashboard.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7859,7 +7859,7 @@ progress::-moz-progress-bar {
78597859
padding: 12px 20px 10px;
78607860
min-height: 63px;
78617861
margin-top: 18px;
7862-
border-bottom: 1px solid #e7ebf3;
7862+
/*border-bottom: 1px solid #e7ebf3;*/
78637863
-webkit-flex-shrink: 0;
78647864
-moz-flex-shrink: 0;
78657865
flex-shrink: 0;

rootfs/api/static/css/index.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ form label {
103103

104104

105105
form .input-icon.icon-username {
106-
background: url("/static/images/icon-username.png");
106+
background: url("../images/icon-username.png");
107107
background-repeat: repeat
108108
}
109109

@@ -131,7 +131,7 @@ input:-webkit-autofill {
131131
}
132132

133133
form .input-icon.icon-password {
134-
background: url("/static/images/icon-password.png");
134+
background: url("../images/icon-password.png");
135135
background-repeat: repeat
136136
}
137137

rootfs/api/static/css/vendor.css

Lines changed: 0 additions & 132 deletions
This file was deleted.

rootfs/api/templates/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Title</title>
6+
</head>
7+
<body>
8+
9+
</body>
10+
</html>

0 commit comments

Comments
 (0)