mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-mobile.git
synced 2025-12-11 03:46:47 +08:00
提交退出登录接口
This commit is contained in:
@@ -95,7 +95,7 @@ const updateUser = function(data) {
|
|||||||
const logout = function() {
|
const logout = function() {
|
||||||
let plat='h5';
|
let plat='h5';
|
||||||
var ua = navigator.userAgent.toLowerCase();
|
var ua = navigator.userAgent.toLowerCase();
|
||||||
if (ua.match(/MicroMessenger/i) == "micromessenger") {
|
if(ua.match(/MicroMessenger/i) == "micromessenger") {
|
||||||
plat='wechat';
|
plat='wechat';
|
||||||
}
|
}
|
||||||
return ajax.postJson('/logout',{"from":plat});
|
return ajax.postJson('/logout',{"from":plat});
|
||||||
|
|||||||
@@ -48,9 +48,7 @@
|
|||||||
<view class="u-demo-block__content">
|
<view class="u-demo-block__content">
|
||||||
<u-cell-group>
|
<u-cell-group>
|
||||||
<!-- <u-cell title="语言设置" v-model="userInfoObj.name"></u-cell>
|
<!-- <u-cell title="语言设置" v-model="userInfoObj.name"></u-cell>
|
||||||
|
|
||||||
<u-cell title="位置" v-model="userInfoObj.name"></u-cell> -->
|
<u-cell title="位置" v-model="userInfoObj.name"></u-cell> -->
|
||||||
|
|
||||||
<u-cell @click="toRouter('next')" title="修改密码" :isLink="true" arrow-direction="left" v-model="userInfoObj.account.passValue"></u-cell>
|
<u-cell @click="toRouter('next')" title="修改密码" :isLink="true" arrow-direction="left" v-model="userInfoObj.account.passValue"></u-cell>
|
||||||
</u-cell-group>
|
</u-cell-group>
|
||||||
</view>
|
</view>
|
||||||
@@ -93,8 +91,6 @@
|
|||||||
this.imgurl = rs.avatar;
|
this.imgurl = rs.avatar;
|
||||||
this.load();
|
this.load();
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
onLoad(){
|
onLoad(){
|
||||||
//this.load()
|
//this.load()
|
||||||
@@ -102,10 +98,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
logout() {
|
logout() {
|
||||||
this.clearShow=true;
|
this.clearShow=true;
|
||||||
apiUserbasic.logout();
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
updateHeadImg() {
|
updateHeadImg() {
|
||||||
let self=this;
|
let self=this;
|
||||||
if (this.fSelecting) return;
|
if (this.fSelecting) return;
|
||||||
@@ -159,11 +152,9 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
confirmClear(){
|
confirmClear(){
|
||||||
let that = this;
|
let that = this;
|
||||||
that.$store.dispatch("LogOut").then(rs => {
|
that.$store.dispatch("LogOut").then(rs =>{
|
||||||
that.clearShow=false;
|
that.clearShow=false;
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
let loginPath=this.$config.loginPath;
|
let loginPath=this.$config.loginPath;
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import apiLogin from '@/api/login.js'
|
|||||||
import apiBoeLogin from '@/api/boe/login.js'
|
import apiBoeLogin from '@/api/boe/login.js'
|
||||||
import apiMessage from '@/api/system/message.js'
|
import apiMessage from '@/api/system/message.js'
|
||||||
import config from '@/config/index.js'
|
import config from '@/config/index.js'
|
||||||
|
import apiUserbasic from '@/api/boe/userbasic.js'
|
||||||
|
|
||||||
const user = {
|
const user = {
|
||||||
state: {
|
state: {
|
||||||
@@ -132,11 +133,12 @@ const user = {
|
|||||||
// 退出系统
|
// 退出系统
|
||||||
LogOut({ commit, state }) {
|
LogOut({ commit, state }) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
apiBoeLogin.logout();
|
//apiBoeLogin.logout();
|
||||||
commit('SET_PERMISSIONS', [])
|
commit('SET_PERMISSIONS', [])
|
||||||
removeToken()
|
removeToken()
|
||||||
//resolve()
|
//resolve()
|
||||||
apiLogin.logout().then((res) => {
|
//apiLogin.logout()
|
||||||
|
apiUserbasic.logout().then((res) => {
|
||||||
resolve(res)
|
resolve(res)
|
||||||
}).catch(error => {
|
}).catch(error => {
|
||||||
reject(error)
|
reject(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user