From 46580cbc7bbd82e06b439d0dadc0c3daf920fca9 Mon Sep 17 00:00:00 2001 From: jmal Date: Thu, 19 Mar 2020 18:05:33 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=B8=AA=E4=BA=BA=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/upload-api.js | 2 + src/layout/components/Navbar.vue | 22 ++--- src/router/index.js | 14 ++- src/views/form/index.vue | 75 +++++++++++++++- src/views/login/index.vue | 4 +- src/views/userInfo/index.vue | 141 +++++++++++++++++++++++++++++++ 6 files changed, 241 insertions(+), 17 deletions(-) create mode 100644 src/views/userInfo/index.vue diff --git a/src/api/upload-api.js b/src/api/upload-api.js index 2971c5b..7f7ebd0 100644 --- a/src/api/upload-api.js +++ b/src/api/upload-api.js @@ -4,6 +4,8 @@ const qs = require('qs') export default { // 上传 simpleUploadURL: process.env.VUE_APP_BASE_API + '/upload', + // 上传头像 + simpleUploadAvatarURL: process.env.VUE_APP_BASE_API + '/upload', // 合并 mergeSimpleUpload: function(params) { return request({ diff --git a/src/layout/components/Navbar.vue b/src/layout/components/Navbar.vue index a69b077..6cbf83f 100644 --- a/src/layout/components/Navbar.vue +++ b/src/layout/components/Navbar.vue @@ -7,23 +7,25 @@
- +
- + - Home + 个人信息 - - Github - - - Docs - + + + + + + + + - Log Out + 退出登录
diff --git a/src/router/index.js b/src/router/index.js index d4f2a7e..7e31dfc 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -86,6 +86,18 @@ export const constantRoutes = [ ] }, + { + path: '/userinfo', + component: Layout, + children: [ + { + path: '', + name: 'userInfo', + component: () => import('@/views/userInfo/index'), + } + ] + }, + { path: '/share', component: Layout, @@ -156,7 +168,7 @@ export const constantRoutes = [ children: [ { path: '', - name: 'share', + name: 's', component: () => import('@/views/public/share/shareList'), } ] diff --git a/src/views/form/index.vue b/src/views/form/index.vue index 5028bd8..e68301f 100644 --- a/src/views/form/index.vue +++ b/src/views/form/index.vue @@ -1,17 +1,84 @@ + + diff --git a/src/views/login/index.vue b/src/views/login/index.vue index 25b163d..e0cf275 100644 --- a/src/views/login/index.vue +++ b/src/views/login/index.vue @@ -60,14 +60,14 @@ export default { data() { const validateUsername = (rule, value, callback) => { if (!this.validUsername(value)) { - callback(new Error('Please enter the correct user name')) + callback(new Error('请输入正确的用户名')) } else { callback() } } const validatePassword = (rule, value, callback) => { if (value.length < 6) { - callback(new Error('The password can not be less than 6 digits')) + callback(new Error('密码不能少于6位数字')) } else { callback() } diff --git a/src/views/userInfo/index.vue b/src/views/userInfo/index.vue new file mode 100644 index 0000000..1e059ee --- /dev/null +++ b/src/views/userInfo/index.vue @@ -0,0 +1,141 @@ + + + + +