|
@@ -43,6 +43,8 @@
|
|
|
</template>
|
|
|
</van-cell>
|
|
|
<van-button class="logout" @click="logout" block round type="danger" v-if="!isCorpWX">退出登录</van-button>
|
|
|
+
|
|
|
+ <van-button class="logout" @click="unbindCorpWX" block round type="danger" v-if="isCorpWX && userInfo.corpwxUserid != null && userInfo.userNameNeedTranslate != '1'">解除绑定</van-button>
|
|
|
<!-- <van-button class="logout" @click="logout" block round type="danger" >退出登录</van-button> -->
|
|
|
</main>
|
|
|
|
|
@@ -81,6 +83,25 @@
|
|
|
localStorage.removeItem("userInfo");
|
|
|
this.$router.push("/login");
|
|
|
},
|
|
|
+ unbindCorpWX() {
|
|
|
+ this.$dialog.confirm({
|
|
|
+ title: '',
|
|
|
+ message: '解除绑定后只能通过账号密码登录,您确定吗?'
|
|
|
+ }).then(() => {
|
|
|
+ this.$axios.post("/user/unbindCorpWX", {userId: this.userInfo.id})
|
|
|
+ .then(res => {
|
|
|
+ if(res.code == "ok") {
|
|
|
+ this.$store.commit("updateLogin", false);
|
|
|
+ localStorage.removeItem("userInfo");
|
|
|
+ this.$router.push("/login");
|
|
|
+ } else {
|
|
|
+ this.$toast.clear();
|
|
|
+ this.$toast.fail(res.msg);
|
|
|
+ }
|
|
|
+ }).catch(err=> {this.$toast.clear();});
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
bindWeiXin(){
|
|
|
//企业微信
|
|
|
if (this.isCorpWX && this.userInfo.corpwxUserid != null) {
|