diff --git a/src/components/ImageCropper/index.vue b/src/components/ImageCropper/index.vue index 13ae9a11..7bb33685 100644 --- a/src/components/ImageCropper/index.vue +++ b/src/components/ImageCropper/index.vue @@ -248,7 +248,8 @@ export default { // 浏览器是否支持该控件 isSupported, // 浏览器是否支持触屏事件 - isSupportTouch: document.hasOwnProperty('ontouchstart'), + + isSupportTouch: Object.prototype.hasOwnProperty.call(document, 'ontouchstart'), // 步骤 step: 1, // 1选择文件 2剪裁 3上传 // 上传状态及进度 diff --git a/src/store/modules/settings.js b/src/store/modules/settings.js index e389af79..67bd4160 100644 --- a/src/store/modules/settings.js +++ b/src/store/modules/settings.js @@ -13,7 +13,8 @@ const state = { const mutations = { CHANGE_SETTING: (state, { key, value }) => { - if (state.hasOwnProperty(key)) { + // https://eslint.org/docs/rules/no-prototype-builtins + if (Object.prototype.hasOwnProperty.call(state, key)) { state[key] = value } } diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 1391fa4a..f9d725b8 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -104,6 +104,7 @@ const actions = { // dynamically modify permissions changeRoles({ commit, dispatch }, role) { + // eslint-disable-next-line return new Promise(async resolve => { const token = role + '-token'