公共マイクロチャンネル番号の離脱
1、マイクロチャネルのログかどうかを決定します
main.js
Vue.prototype.isWx =()=> {
せUA = navigator.userAgent.toLowerCase()
リターン(/micromessenger/.test(ua))
}
2、終了ボタン
ログアウト(){
ましょうVM =この
本。$ http.get(this.base + 'ログアウト?トークン=' +これ。$ store.getters.get_token).then(RES => {
(res.data.code =の場合== 200){
IF(vm.isWx()){
この$ store.commit( 'set_token'、 '')
location.assign( 'https://で')//微信登录地址
this.showOut =偽
}他の{
この。$のstore.commit( 'set_token'、 '')
これ。$ router.push( '/')
this.showOut =偽
}
}他{
}
})。キャッチ(ERR => {
はconsole.log( ERR)
})
}