From e85bfe3f089f17dc6cb437adcc5f9ac7b4e14a22 Mon Sep 17 00:00:00 2001 From: caoqianming Date: Wed, 27 May 2020 18:28:10 +0800 Subject: [PATCH] fileView --- client/src/api/file.js | 8 +++- client/src/router/index.js | 2 +- client/src/utils/request.js | 2 +- client/src/views/system/user.vue | 33 ++++++--------- server/apps/system/admin.py | 5 ++- .../migrations/0006_auto_20200527_1147.py | 35 ++++++++++++++++ .../migrations/0007_auto_20200527_1508.py | 30 ++++++++++++++ .../migrations/0008_auto_20200527_1641.py | 27 +++++++++++++ .../apps/system/migrations/0009_file_mime.py | 18 +++++++++ .../apps/system/migrations/0010_file_path.py | 18 +++++++++ server/apps/system/mixins.py | 31 ++++++++++++++ server/apps/system/models.py | 37 +++++++++++++++-- server/apps/system/serializers.py | 8 +++- server/apps/system/views.py | 40 +++++++++++++++++-- server/server/urls.py | 9 +++++ server/utils/queryset.py | 36 ++++++++--------- 16 files changed, 288 insertions(+), 51 deletions(-) create mode 100644 server/apps/system/migrations/0006_auto_20200527_1147.py create mode 100644 server/apps/system/migrations/0007_auto_20200527_1508.py create mode 100644 server/apps/system/migrations/0008_auto_20200527_1641.py create mode 100644 server/apps/system/migrations/0009_file_mime.py create mode 100644 server/apps/system/migrations/0010_file_path.py create mode 100644 server/apps/system/mixins.py diff --git a/client/src/api/file.js b/client/src/api/file.js index dd9e644..207720e 100644 --- a/client/src/api/file.js +++ b/client/src/api/file.js @@ -1,3 +1,9 @@ +import { getToken } from "@/utils/auth"; + export function uploadUrl() { - return process.env.VUE_APP_BASE_API + '/upload/' + return process.env.VUE_APP_BASE_API + '/file/' } + +export function upHeaders() { + return { Authorization: "Bearer " + getToken() } +} \ No newline at end of file diff --git a/client/src/router/index.js b/client/src/router/index.js index 690af7b..eb9e8bc 100644 --- a/client/src/router/index.js +++ b/client/src/router/index.js @@ -124,7 +124,7 @@ export const asyncRoutes = [ ] }, { - path: 'external-link', + path: 'external-link2', component: Layout, children: [ { diff --git a/client/src/utils/request.js b/client/src/utils/request.js index ba24b52..a8533cb 100644 --- a/client/src/utils/request.js +++ b/client/src/utils/request.js @@ -45,7 +45,7 @@ service.interceptors.response.use( const res = response.data // 50008: Illegal token; 50012: Other clients logged in; 50014: Token expired; if (res.code === 401) { - MessageBox.confirm('您已退出,您可以停留在本页或者重新登陆.', '确认退出', { + MessageBox.confirm('认证失败,请重新登陆.', '确认退出', { confirmButtonText: '重新登陆', cancelButtonText: '取消', type: 'warning' diff --git a/client/src/views/system/user.vue b/client/src/views/system/user.vue index e0526b3..83a936e 100644 --- a/client/src/views/system/user.vue +++ b/client/src/views/system/user.vue @@ -18,7 +18,7 @@ @node-click="handleOrgClick" /> - +
@@ -199,13 +199,12 @@