From a665afac52b5251e27ce368d1e88e5d6278d8e53 Mon Sep 17 00:00:00 2001 From: "aoli.qu" <408346101@qq.com> Date: Wed, 1 Sep 2021 10:28:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A8=E6=80=81=E8=B7=AF=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 7 -- src/api/login.js | 64 +++----------- src/config/defaultSettings.js | 7 +- src/layouts/BasicLayout.vue | 53 +++-------- src/permission.js | 31 ++++--- src/router/generator-routers.js | 78 +++++----------- src/router/index.js | 11 ++- src/store/modules/async-router.js | 7 +- src/store/modules/permission.js | 22 ++--- src/store/modules/user.js | 56 ++++++------ src/views/security/menu/MenuList.vue | 11 +-- src/views/user/Login.vue | 128 +++++++++------------------ 12 files changed, 167 insertions(+), 308 deletions(-) diff --git a/src/App.vue b/src/App.vue index 96dfa59..1a4c900 100644 --- a/src/App.vue +++ b/src/App.vue @@ -9,7 +9,6 @@ diff --git a/src/api/login.js b/src/api/login.js index ea04781..f2cff67 100644 --- a/src/api/login.js +++ b/src/api/login.js @@ -1,80 +1,40 @@ import request from '@/utils/request' const userApi = { - Login: '/auth/login', - Logout: '/auth/logout', - ForgePassword: '/auth/forge-password', - Register: '/auth/register', - twoStepCode: '/auth/2step-code', - SendSms: '/account/sms', - SendSmsErr: '/account/sms_err', - // get my info - UserInfo: '/user/info', - UserMenu: '/user/nav' + login: '/login', + logout: '/logout', + getLoginUser: '/getLoginUser' } -/** - * login func - * parameter: { - * username: '', - * password: '', - * remember_me: true, - * captcha: '12345' - * } - * @param parameter - * @returns {*} - */ export function login (parameter) { return request({ - url: userApi.Login, + url: userApi.login, method: 'post', data: parameter }) } -export function getSmsCaptcha (parameter) { +export function getLoginUser () { return request({ - url: userApi.SendSms, + url: userApi.getLoginUser, method: 'post', data: parameter }) } -export function getInfo () { - return request({ - url: userApi.UserInfo, - method: 'get', - headers: { - 'Content-Type': 'application/json;charset=UTF-8' - } - }) -} - -export function getCurrentUserNav () { - return request({ - url: userApi.UserMenu, - method: 'get' - }) -} - export function logout () { return request({ - url: userApi.Logout, + url: userApi.logout, method: 'post', headers: { 'Content-Type': 'application/json;charset=UTF-8' } }) } - -/** - * get user 2step code open? - * @param parameter {*} - */ -export function get2step (parameter) { - return request({ - url: userApi.twoStepCode, - method: 'post', - data: parameter +export function getSmsCaptcha (parameter) { + return axios({ + url: '/getSmsCaptcha', + method: 'get', + params: parameter }) } diff --git a/src/config/defaultSettings.js b/src/config/defaultSettings.js index 6801019..c06d675 100644 --- a/src/config/defaultSettings.js +++ b/src/config/defaultSettings.js @@ -11,11 +11,10 @@ * storageOptions: {} - Vue-ls 插件配置项 (localStorage/sessionStorage) * */ - export default { - navTheme: 'dark', // theme for nav menu + navTheme: 'light', // theme for nav menu primaryColor: '#1890ff', // primary color of ant design - layout: 'topmenu', // nav menu position: `sidemenu` or `topmenu` + layout: 'sidemenu', // nav menu position: `sidemenu` or `topmenu` contentWidth: 'Fluid', // layout of content: `Fluid` or `Fixed`, only works when layout is topmenu fixedHeader: false, // sticky header fixSiderbar: false, // sticky siderbar @@ -23,7 +22,7 @@ export default { menu: { locale: true }, - title: '系统后台', + title: '安全培训平台', pwa: false, iconfontUrl: '', production: process.env.NODE_ENV === 'production' && process.env.VUE_APP_PREVIEW !== 'true' diff --git a/src/layouts/BasicLayout.vue b/src/layouts/BasicLayout.vue index 99d09f6..67679aa 100644 --- a/src/layouts/BasicLayout.vue +++ b/src/layouts/BasicLayout.vue @@ -11,11 +11,9 @@ :i18nRender="i18nRender" v-bind="settings" > - - @@ -24,25 +22,20 @@