shish 4 anni fa
parent
commit
1681ef2b1b

+ 20 - 1
ghsApp/src/admin/home/me.vue

@@ -85,13 +85,17 @@
             </tui-list-cell>
 
             <tui-list-cell @click="pageTo({ url: '/admin/shop/print' })" class="line-cell" :hover="false" :arrow="true">
-              <div class="tui-title">打印设置</div>
+              <div class="tui-title">打印设置</div>
             </tui-list-cell>
 
             <tui-list-cell @click="getCustomService()" class="line-cell" :hover="false" :arrow="true">
               <div class="tui-title">联系我们</div>
             </tui-list-cell>
 
+            <tui-list-cell @click="loginOut()" class="line-cell" :hover="false" :arrow="true">
+              <div class="tui-title">退出</div>
+            </tui-list-cell>
+
           </view>
         </view>
         <none-hd :show="no_shop_show_model" :title="MODEL_TITLE" :btnText="MODEL_BTN_TEXT" @bthClick="toFreeApply_HOME" :authShow="true" experienceFun></none-hd>
@@ -174,6 +178,21 @@ export default {
         }
       }
     },
+    loginOut(){
+        let that = this
+        uni.showModal({
+          title: "提示",
+          content: "确认退出?",
+          confirmText: "确认",
+          success: function (res) {
+            if (res.confirm) {
+              uni.removeStorageSync('token')
+              that.$store.commit("setLoginInfo", {})
+              that.$util.pageTo({url: "/admin/home/workbench",type: 3})              
+            }
+          }
+        })
+    },
     async selectSussess () {
       uni.showLoading({
         title: "加载中",

+ 8 - 27
ghsApp/src/plugins/luch-request_0.0.7/request.js

@@ -155,42 +155,23 @@ class Request {
 						// 返回错误信息
 						if (response.data.code == 0) {
 							if (!config.hideError) {
-								// this.$msg(response.data.msg)
-								uni.showToast({
-									title: response.data.msg,
-									icon: 'none',
-									mask: true
-								})
+								uni.showToast({ title: response.data.msg, icon: 'none', mask: true })
 							}
 							reject(response.data)
 						} else if (response.data.code && response.data.code == -1) {
 							// 无权限或者登录过期
-							uni.removeStorageSync('token')
-							uni.showToast({
-								title: '登录过期,正在重新登录...',
-								icon: 'none',
-								mask: true
-							})
-							setTimeout(() => {
-								getCheckLogin()
-								// uni.reLaunch({
-								// 	url: `/pages/page/login/index`
-								// })
-							}, 1000)
+							// uni.removeStorageSync('token')
+							// uni.showToast({ title: '登录已失效...', icon: 'none', mask: true })
+							// setTimeout(() => {
+							// 	getCheckLogin()
+							// }, 1000)
 						} else if (response.data.code == 2) {
 							uni.removeStorageSync('token')
 							uni.removeStorageSync('shopUser')
 							uni.removeStorageSync('account')
-							uni.showToast({
-								title: '登录失效,正在重新登录...',
-								icon: 'none',
-								mask: true
-							})
+							uni.showToast({ title: '登录已失效..', icon: 'none', mask: true })
 							setTimeout(() => {
-								getCheckLogin()
-								// uni.reLaunch({
-								// 	url: `/pages/page/login/index`
-								// })
+								//getCheckLogin()
 							}, 1000)
 						} else {
 							console.log('response.data', response.data)