perf: fixed lint

This commit is contained in:
花裤衩
2020-06-10 19:03:48 +08:00
parent 41e48cf374
commit f4f125d06c
4 changed files with 28 additions and 31 deletions

View File

@@ -248,6 +248,7 @@ export default {
// 浏览器是否支持该控件 // 浏览器是否支持该控件
isSupported, isSupported,
// 浏览器是否支持触屏事件 // 浏览器是否支持触屏事件
// eslint-disable-next-line no-prototype-builtins
isSupportTouch: document.hasOwnProperty('ontouchstart'), isSupportTouch: document.hasOwnProperty('ontouchstart'),
// 步骤 // 步骤
step: 1, // 1选择文件 2剪裁 3上传 step: 1, // 1选择文件 2剪裁 3上传

View File

@@ -13,6 +13,7 @@ const state = {
const mutations = { const mutations = {
CHANGE_SETTING: (state, { key, value }) => { CHANGE_SETTING: (state, { key, value }) => {
// eslint-disable-next-line no-prototype-builtins
if (state.hasOwnProperty(key)) { if (state.hasOwnProperty(key)) {
state[key] = value state[key] = value
} }

View File

@@ -103,8 +103,7 @@ const actions = {
}, },
// dynamically modify permissions // dynamically modify permissions
changeRoles({ commit, dispatch }, role) { async changeRoles({ commit, dispatch }, role) {
return new Promise(async resolve => {
const token = role + '-token' const token = role + '-token'
commit('SET_TOKEN', token) commit('SET_TOKEN', token)
@@ -116,15 +115,11 @@ const actions = {
// generate accessible routes map based on roles // generate accessible routes map based on roles
const accessRoutes = await dispatch('permission/generateRoutes', roles, { root: true }) const accessRoutes = await dispatch('permission/generateRoutes', roles, { root: true })
// dynamically add accessible routes // dynamically add accessible routes
router.addRoutes(accessRoutes) router.addRoutes(accessRoutes)
// reset visited views and cached views // reset visited views and cached views
dispatch('tagsView/delAllViews', null, { root: true }) dispatch('tagsView/delAllViews', null, { root: true })
resolve()
})
} }
} }