Skip to content

Commit

Permalink
fix front bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mtianyan committed Jul 29, 2020
1 parent 6791b77 commit 1cc81e7
Show file tree
Hide file tree
Showing 169 changed files with 876 additions and 50,058 deletions.
20 changes: 7 additions & 13 deletions Mxonline3/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
# 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
Expand Down Expand Up @@ -91,25 +91,19 @@
# https://docs.djangoproject.com/en/2.0/ref/settings/#databases

try:
var = os.environ["use_docker"]
print(var)
if var == "1":
UseDocker = True
else:
UseDocker = False
var = os.environ["not_use_docker"]
NotUseDocker = True
except KeyError:
UseDocker = False
NotUseDocker = False

print(UseDocker)

if UseDocker:
if NotUseDocker:
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'mxonline3',
'USER': 'root',
'PASSWORD': 'mtianyanroot',
'HOST': 'mysql',
'HOST': '127.0.0.1',
'PORT': '3306'
}
}
Expand All @@ -120,7 +114,7 @@
'NAME': 'mxonline3',
'USER': 'root',
'PASSWORD': 'mtianyanroot',
'HOST': '127.0.0.1',
'HOST': 'mysql',
'PORT': '3306'

}
Expand Down
4 changes: 2 additions & 2 deletions Mxonline3/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@
# 富文本相关url
path('ueditor/', include('DjangoUeditor.urls')),
path('api/v1/', include(router.urls)),
path('api/v1/user/currentUser', CurrentUserView.as_view(), name='user_current_user'),
path('api/v1/currentUser', CurrentUserView.as_view(), name='user_current_user'),
path('api/v1/captcha-generate/', CaptchaView.as_view(), name='captcha'),
path('api/v1/user/login', AdminLoginView.as_view(), name='admin_login'),
path('api/v1/login/account', AdminLoginView.as_view(), name='admin_login'),
path('api/v1/user/logout', AdminLogoutView.as_view(), name='admin_logout'),
path('api/v1/fake_chart_data', DashBoardView.as_view(), name='dashboard'),
re_path('xadmin/.*', AdminIndexView.as_view(), name="admin_index"),
Expand Down
3 changes: 2 additions & 1 deletion apps/users/api_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CurrentUserView(views.APIView):

def get(self, request, *args, **kwargs):
if request.user.is_superuser:
return JsonResponse({"id": 1, "name": request.user.username, "email": request.user.email,
return JsonResponse({"userid": 1, "name": request.user.username, "email": request.user.email,
"avatar": "https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png"})
else:
return JsonResponse({
Expand All @@ -42,6 +42,7 @@ def post(self, request, *args, **kwargs):
login(request, user)
return JsonResponse({
"status": 'ok',
"currentAuthority": 'admin'
})
else:
return JsonResponse({
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ mtianyan_nginx:
mtianyan_mxonline3:
restart: always
build: .
environment:
- use_docker=1
volumes:
- .:/ProjectPath
- ./conf/uwsgi.ini:/etc/uwsgi.ini
Expand Down
16 changes: 16 additions & 0 deletions front_end/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# http://editorconfig.org
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false

[Makefile]
indent_style = tab
4 changes: 4 additions & 0 deletions front_end/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/lambda/
/scripts
/config
.history
8 changes: 8 additions & 0 deletions front_end/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
extends: [require.resolve('@umijs/fabric/dist/eslint')],
globals: {
ANT_DESIGN_PRO_ONLY_DO_NOT_USE_IN_YOUR_PRODUCTION: true,
page: true,
REACT_APP_ENV: true,
},
};
40 changes: 40 additions & 0 deletions front_end/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc

# production
/dist
/.vscode

# misc
.DS_Store
npm-debug.log*
yarn-error.log

/coverage
.idea
yarn.lock
package-lock.json
*bak
.vscode

# visual studio code
.history
*.log
functions/*
.temp/**

# umi
.umi
.umi-production

# screenshot
screenshot
.firebase
.eslintcache

build
22 changes: 22 additions & 0 deletions front_end/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
**/*.svg
package.json
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
.history
CNAME
/build
5 changes: 5 additions & 0 deletions front_end/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.prettier,
};
5 changes: 5 additions & 0 deletions front_end/.stylelintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const fabric = require('@umijs/fabric');

module.exports = {
...fabric.stylelint,
};
6 changes: 0 additions & 6 deletions front_end/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,3 @@ npm test
## More

You can view full document on our [official website](https://pro.ant.design). And welcome any feedback in our [github](https://github.com/ant-design/ant-design-pro).

"husky": {
"hooks": {
"pre-commit": "npm run lint-staged"
}
},
Loading

0 comments on commit 1cc81e7

Please sign in to comment.