From 418cab4d1d2a6ebe185b19195fdead5a5956ed18 Mon Sep 17 00:00:00 2001
From: loulijun2021 <1694218219@qq.com>
Date: 星期四, 08 十二月 2022 16:44:39 +0800
Subject: [PATCH] 1.修改刷新退出bug

---
 src/utils/request.js      |    1 -
 src/permission.js         |    2 +-
 src/store/modules/user.js |    2 --
 src/views/scgl/sckbg.vue  |    8 ++++----
 src/store/modules/app.js  |    4 +---
 5 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/src/permission.js b/src/permission.js
index df66abd..a5dd403 100644
--- a/src/permission.js
+++ b/src/permission.js
@@ -19,7 +19,7 @@
 
   // determine whether the user has logged in
   // const hasToken = getToken()
-  const hasToken = store.state.app.isGoToIndex
+  const hasToken = getCookie('admin')
   if (hasToken) {
     if (to.path === '/login') {
       // if is logged in, redirect to the home page
diff --git a/src/store/modules/app.js b/src/store/modules/app.js
index 19b8157..a868bf9 100644
--- a/src/store/modules/app.js
+++ b/src/store/modules/app.js
@@ -6,8 +6,7 @@
     withoutAnimation: false
   },
   device: 'desktop',
-  buttonIsDisabled: false, // 鑷畾涔夊叏灞�鍙橀噺鍙傛暟  鎺у埗鎸夐挳鎻愪氦鏃禿isabled
-  isGoToIndex: false // 鑷畾涔夊叏灞�鍙橀噺鍙傛暟  鏄惁杩涘叆鍒扮郴缁熼椤�
+  buttonIsDisabled: false // 鑷畾涔夊叏灞�鍙橀噺鍙傛暟  鎺у埗鎸夐挳鎻愪氦鏃禿isabled
 }
 
 const mutations = {
@@ -45,7 +44,6 @@
 export default {
   namespaced: true,
   buttonIsDisabled: false,
-  isGoToIndex: false,
   state,
   mutations,
   actions
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 18a51f2..33405b7 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -54,7 +54,6 @@
         // if (res.code === '302') {
         setCookie('code', res.code)
         // }
-        store.state.app.isGoToIndex = true
 
         // commit('SET_TOKEN', data.token)
         // setToken(res)
@@ -118,7 +117,6 @@
 
       logout(data).then(res => {
         if (res.code === '200') {
-          store.state.app.isGoToIndex = false
           removeToken() // must remove  token  first
           resetRouter()
 
diff --git a/src/utils/request.js b/src/utils/request.js
index 5f7ded7..e95e5b7 100644
--- a/src/utils/request.js
+++ b/src/utils/request.js
@@ -68,7 +68,6 @@
         removeCookie('rediskey')
         removeCookie('guid')
         removeCookie('code')
-        store.state.app.isGoToIndex = false
         setTimeout(() => {
           sessionStorage.removeItem('tabViews')
           window.location.reload()
diff --git a/src/views/scgl/sckbg.vue b/src/views/scgl/sckbg.vue
index e4fbd71..3d53498 100644
--- a/src/views/scgl/sckbg.vue
+++ b/src/views/scgl/sckbg.vue
@@ -1388,7 +1388,7 @@
     this.getHeight()
 
     this.$nextTick(() => {
-      $("input[name='produceCode']")[0].focus()
+      $('input[name=\'produceCode\']')[0].focus()
       // this.bindQRCode('10001;001')
     })
     // webapp_urlprotocol_startup()
@@ -1466,21 +1466,21 @@
       if (this.$refs.elTabs.currentName === '0') {
         this.$nextTick(() => {
           this.getMesOrderStepSearch()
-          $("input[name='produceCode']")[0].focus()
+          $('input[name=\'produceCode\']')[0].focus()
           this.WXform.orderstepqrcode = ''
         })
       }
       if (this.$refs.elTabs.currentName === '1') {
         this.$nextTick(() => {
           this.getMesOrderWxStepSearch()
-          $("input[name='WXproduceCode']")[0].focus()
+          $('input[name=\'WXproduceCode\']')[0].focus()
           this.form.orderstepqrcode = ''
         })
       }
       if (this.$refs.elTabs.currentName === '2') {
         this.$nextTick(() => {
           this.getBadList()
-          $("input[name='badProduceCode']")[0].focus()
+          $('input[name=\'badProduceCode\']')[0].focus()
           this.badForm.orderstepqrcode = ''
         })
       }

--
Gitblit v1.9.3