diff --git a/frontend/src/api/login.js b/frontend/src/api/login.js index 0405b25f..a75d5924 100644 --- a/frontend/src/api/login.js +++ b/frontend/src/api/login.js @@ -39,15 +39,6 @@ export function getInfo() { }) } -// 解锁屏幕 -export function unlockScreen(password) { - return request({ - url: '/unlockscreen', - method: 'post', - data: { password } - }) -} - // 退出方法 export function logout() { return request({ diff --git a/frontend/src/assets/icons/svg/lock.svg b/frontend/src/assets/icons/svg/lock.svg deleted file mode 100644 index 74fee543..00000000 --- a/frontend/src/assets/icons/svg/lock.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/frontend/src/layout/components/Navbar.vue b/frontend/src/layout/components/Navbar.vue index 2bfd0034..02d2d472 100644 --- a/frontend/src/layout/components/Navbar.vue +++ b/frontend/src/layout/components/Navbar.vue @@ -33,9 +33,6 @@ 个人中心 - - 锁定屏幕 - 退出登录 @@ -104,12 +101,6 @@ export default { this.$refs.searchRef.click() } }, - lockScreen() { - const currentPath = this.$route.fullPath - this.$store.dispatch('lock/lockScreen', currentPath).then(() => { - this.$router.push('/lock') - }) - }, logout() { this.$confirm('确定注销并退出系统吗?', '提示', { confirmButtonText: '确定', diff --git a/frontend/src/permission.js b/frontend/src/permission.js index 1a621df0..b0b47cba 100644 --- a/frontend/src/permission.js +++ b/frontend/src/permission.js @@ -18,19 +18,12 @@ const isWhiteList = (path) => { router.beforeEach((to, from, next) => { NProgress.start() if (getToken()) { - const isLock = store.getters.isLock /* has token*/ if (to.path === '/login') { next({ path: '/' }) NProgress.done() } else if (isWhiteList(to.path)) { next() - } else if (isLock && to.path !== '/lock') { - next({ path: '/lock' }) - NProgress.done() - } else if (!isLock && to.path === '/lock') { - next({ path: '/' }) - NProgress.done() } else { if (store.getters.roles.length === 0) { isRelogin.show = true diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 2dd6e790..bbfd2374 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -74,12 +74,6 @@ export const constantRoutes = [ } ] }, - { - path: '/lock', - component: () => import('@/views/lock'), - hidden: true, - meta: { title: '锁定屏幕' } - }, { path: '/user', component: Layout, diff --git a/frontend/src/store/getters.js b/frontend/src/store/getters.js index 375a04be..a13240af 100644 --- a/frontend/src/store/getters.js +++ b/frontend/src/store/getters.js @@ -3,8 +3,6 @@ size: state => state.app.size, device: state => state.app.device, dict: state => state.dict.dict, - isLock: state => state.lock.isLock, - lockPath: state => state.lock.lockPath, visitedViews: state => state.tagsView.visitedViews, cachedViews: state => state.tagsView.cachedViews, token: state => state.user.token, diff --git a/frontend/src/store/index.js b/frontend/src/store/index.js index e6ae21ff..595fa58c 100644 --- a/frontend/src/store/index.js +++ b/frontend/src/store/index.js @@ -1,7 +1,6 @@ import Vue from 'vue' import Vuex from 'vuex' import app from './modules/app' -import lock from './modules/lock' import dict from './modules/dict' import user from './modules/user' import tagsView from './modules/tagsView' @@ -13,7 +12,6 @@ Vue.use(Vuex) const store = new Vuex.Store({ modules: { app, - lock, dict, user, tagsView, diff --git a/frontend/src/store/modules/lock.js b/frontend/src/store/modules/lock.js deleted file mode 100644 index bc496eba..00000000 --- a/frontend/src/store/modules/lock.js +++ /dev/null @@ -1,34 +0,0 @@ -const LOCK_KEY = 'screen-lock' -const LOCK_PATH_KEY = 'screen-lock-path' - -const lock = { - namespaced: true, - state: { - isLock: JSON.parse(localStorage.getItem(LOCK_KEY) || 'false'), - lockPath: localStorage.getItem(LOCK_PATH_KEY) || '/index' - }, - mutations: { - SET_LOCK(state, status) { - state.isLock = status - localStorage.setItem(LOCK_KEY, JSON.stringify(status)) - }, - SET_LOCK_PATH(state, path) { - state.lockPath = path - localStorage.setItem(LOCK_PATH_KEY, path) - } - }, - actions: { - // 锁定屏幕,同时记录当前路径 - lockScreen({ commit }, currentPath) { - commit('SET_LOCK_PATH', currentPath || '/index') - commit('SET_LOCK', true) - }, - // 解锁屏幕,清除路径 - unlockScreen({ commit }) { - commit('SET_LOCK', false) - commit('SET_LOCK_PATH', '/index') - } - } -} - -export default lock diff --git a/frontend/src/store/modules/user.js b/frontend/src/store/modules/user.js index 82d41884..dbf2b5cd 100644 --- a/frontend/src/store/modules/user.js +++ b/frontend/src/store/modules/user.js @@ -53,7 +53,6 @@ const user = { login(username, password, code, uuid).then(res => { setToken(res.token) commit('SET_TOKEN', res.token) - store.dispatch('lock/unlockScreen') resolve() }).catch(error => { reject(error) diff --git a/frontend/src/views/lock.vue b/frontend/src/views/lock.vue deleted file mode 100644 index 5fbc3326..00000000 --- a/frontend/src/views/lock.vue +++ /dev/null @@ -1,375 +0,0 @@ - - - - -