Commit e3323af173db76e74297ec802b8a1aef1995e832

Authored by 肖超群
1 parent 7d702d36

禁止缩放

ant-design-vue-jeecg/src/components/layouts/UserLayoutLogin.vue
@@ -111,8 +111,12 @@ export default { @@ -111,8 +111,12 @@ export default {
111 created() { 111 created() {
112 this.handleChangeCheckCode(); 112 this.handleChangeCheckCode();
113 this.getWarehouse(); 113 this.getWarehouse();
  114 + window.addEventListener("mousewheel",function (event) {
  115 + if (event.ctrlKey === true || event.metaKey) {event.preventDefault();}},{ passive: false })
  116 + this.disableZoom();
114 }, 117 },
115 118
  119 +
116 methods: { 120 methods: {
117 stepCaptchaCancel() { 121 stepCaptchaCancel() {
118 this.Logout().then(() => { 122 this.Logout().then(() => {
@@ -120,6 +124,13 @@ export default { @@ -120,6 +124,13 @@ export default {
120 this.stepCaptchaVisible = false 124 this.stepCaptchaVisible = false
121 }) 125 })
122 }, 126 },
  127 +
  128 + disableZoom() {
  129 + const metaViewport = document.createElement('meta');
  130 + metaViewport.setAttribute('name', 'viewport');
  131 + metaViewport.setAttribute('content', 'width=device-width, initial-scale=1.0, user-scalable=no');
  132 + document.getElementsByTagName('head')[0].appendChild(metaViewport);
  133 + },
123 stepCaptchaSuccess() { 134 stepCaptchaSuccess() {
124 this.loginSuccess() 135 this.loginSuccess()
125 }, 136 },