|
|
@@ -147,6 +147,7 @@
|
|
|
import { mapGetters } from "vuex";
|
|
|
import bindEmail from "@/views/userInfo/components/userSetting/bindEmail.vue";
|
|
|
import { encrypt } from "@/utils/jsencrypt";
|
|
|
+import {removeToken} from '@/utils/auth'
|
|
|
import teachHomework from '@/assets/tabbar/teach_homework.png';
|
|
|
import teachHomeworkCur from '@/assets/tabbar/teach_homework_cur.png';
|
|
|
import report from '@/assets/tabbar/report.png';
|
|
|
@@ -341,13 +342,17 @@ export default {
|
|
|
|
|
|
// 退出登录
|
|
|
Logout() {
|
|
|
- this.$store.dispatch("user/logout");
|
|
|
- localStorage.clear();
|
|
|
if(!this.padApp){
|
|
|
+ this.$store.dispatch("user/logout");
|
|
|
+ localStorage.clear();
|
|
|
let url=process.env.VUE_APP_BASE+'/marking/#/login';//退出到考阅登录页
|
|
|
window.location.replace(url)
|
|
|
window.parent.location.href = `${process.env.VUE_APP_BASE}/marking/#/login`;//兼容父级iframe
|
|
|
}else{
|
|
|
+ this.$store.commit('SET_TOKEN', '');
|
|
|
+ removeToken();
|
|
|
+ localStorage.clear();//清楚本地所有缓存
|
|
|
+ sessionStorage.clear();
|
|
|
// 通知App壳端退出登录(仅APP环境生效)
|
|
|
this.notifyPadAppLogout('logout');
|
|
|
}
|
|
|
@@ -366,7 +371,7 @@ export default {
|
|
|
} else {
|
|
|
// H5:通知父级iframe页面(markPaper-pad H5)退出登录
|
|
|
// const baseUrl = process.env.NODE_ENV === 'development' ? '*' : process.env.VUE_APP_BASE;
|
|
|
- window.parent.postMessage({ type: type}, '*');
|
|
|
+ window.parent.postMessage({ type: type,isOutInterface: true}, '*');
|
|
|
}
|
|
|
} catch (e) {
|
|
|
console.error('通知App端退出登录失败', e);
|
|
|
@@ -375,7 +380,7 @@ export default {
|
|
|
//通知App端退出登录
|
|
|
PadLogoutSendMsg(type) {
|
|
|
uni.postMessage({
|
|
|
- data: {type: type}
|
|
|
+ data: {type: type,isOutInterface: true}
|
|
|
})
|
|
|
},
|
|
|
//打开修改密码弹窗
|