소스 검색

修改保存安卓cid

shish 4 년 전
부모
커밋
d93f83e15f
3개의 변경된 파일40개의 추가작업 그리고 1개의 파일을 삭제
  1. 29 0
      hdApp/src/admin/home/me.vue
  2. 5 0
      hdApp/src/api/admin/index.js
  3. 6 1
      hdApp/src/pagesClient/official/apply.vue

+ 29 - 0
hdApp/src/admin/home/me.vue

@@ -82,6 +82,15 @@
               <div class="tui-title">帐号绑定</div>
               <div class="tui-title">帐号绑定</div>
             </tui-list-cell>
             </tui-list-cell>
 
 
+            <!-- #ifdef APP-PLUS -->
+            <tui-list-cell @click="closeApp()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
+              <div class="tui-title">关闭APP</div>
+            </tui-list-cell>
+            <tui-list-cell @click="loginOut()" class="line-cell" :hover="false" :arrow="true" v-if="!$util.isEmpty(getLoginInfo.admin) && getLoginInfo.admin.currentShopId > 0">
+              <div class="tui-title">退出登陆</div>
+            </tui-list-cell>
+            <!-- #endif -->
+
           </view>
           </view>
         </view>
         </view>
       </view>
       </view>
@@ -126,6 +135,26 @@ export default {
     this.getMyInfo()
     this.getMyInfo()
   },
   },
   methods: {
   methods: {
+    // #ifdef APP-PLUS
+    loginOut(){
+        let that = this
+        uni.clearStorage()
+        that.$store.commit("setLoginInfo", {})
+        plus.runtime.restart()        
+    },
+    closeApp(){
+      let type = uni.getSystemInfoSync().platform
+      switch(type){
+        case 'android':
+          plus.runtime.quit()
+          break;
+        case 'ios':
+          plus.ios.import("UIApplication").sharedApplication().performSelector("exit")
+          break;
+        default:
+      }   
+    },
+    // #endif
 		getCustomService(){
 		getCustomService(){
 			let that = this;
 			let that = this;
 			uni.showModal({
 			uni.showModal({

+ 5 - 0
hdApp/src/api/admin/index.js

@@ -6,3 +6,8 @@ import https from '@/plugins/luch-request_0.0.7/request'
 export const adminSetPayPassword = data => {
 export const adminSetPayPassword = data => {
 	return https.get('/admin/set-pay-password', data)
 	return https.get('/admin/set-pay-password', data)
 }
 }
+
+//添加修改安卓clientId
+export const replaceClientId = data => {
+	return https.get("/admin/replace-client-id", data);
+}

+ 6 - 1
hdApp/src/pagesClient/official/apply.vue

@@ -301,7 +301,9 @@ export default {
             that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
             that.$store.commit('setMyShopInfo', { ...res.data.shop, ...res.data })
           })
           })
           that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
           that.$store.commit('setLoginInfo', { ...subRes.data.admin, ...subRes.data })
-          getUser(true).then(res => { uni.setNavigationBarTitle({ title: res.name }) })
+          getUser(true).then(res => { 
+            uni.setNavigationBarTitle({ title: res.name }) 
+          })
           that.setUserShopAll()
           that.setUserShopAll()
           // #ifdef APP-PLUS
           // #ifdef APP-PLUS
           //保存安卓的clientId
           //保存安卓的clientId
@@ -312,8 +314,11 @@ export default {
             replaceClientId({id:currentClientId})
             replaceClientId({id:currentClientId})
           }
           }
           // #endif
           // #endif
+
         }
         }
+
         this.$util.pageTo({url: "/pagesClient/official/result", type:2})
         this.$util.pageTo({url: "/pagesClient/official/result", type:2})
+
       });
       });
     }
     }
   },
   },