This commit is contained in:
udf_admin@163.com
2020-05-01 22:56:29 +08:00
parent 5ffa9e247f
commit f1198c433a
3 changed files with 10 additions and 13 deletions
+7 -1
View File
@@ -55,7 +55,8 @@
<el-col :span="24">
<span><el-button type="text" :style="userDtoBtnStyle">基本资料</el-button></span>
<el-divider direction="vertical"></el-divider>
<span><el-button type="text" :style="logoutBtnStyle">退出登录</el-button></span>
<span><el-button type="text" :style="logoutBtnStyle"
@click="logoutBtnClick">退出登录</el-button></span>
</el-col>
</el-row>
</div>
@@ -192,6 +193,11 @@
//搜索输入框显示和隐藏
searchInputDivShowHidden() {
this.showSearchInput = !this.showSearchInput;
},
//退出登录按钮事件
logoutBtnClick() {
const loading = this.$loading({lock: true, text: '操作中'});
api_user.logout().then(response => window.location.href = '/').finally(() => loading.close());
}
}
}
+2 -12
View File
@@ -26,18 +26,8 @@ const glob = {
},
//跳转到登陆页
jumpLoginPage() {
//弹出提示
Message({
dangerouslyUseHTMLString: false,
showClose: true,
duration: 2000,
type: 'info',
message: '认证过期,请重新登陆,正在跳转',
onClose: () => {
const redirectUrl = escape(window.location.href);
window.location = process.env.VUE_APP_BASE_URL + 'login.html?redirectUrl=' + redirectUrl;
}
});
const redirectUrl = escape(window.location.href);
window.location = process.env.VUE_APP_BASE_URL + 'login.html?redirectUrl=' + redirectUrl;
},
//初始化NProgress
initNProgress() {
@@ -52,6 +52,7 @@ public class WebHandlerInterceptor implements HandlerInterceptor {
}
//放入请求作用域
request.setAttribute(CommonConstant.PARAMETER_NAME_TOKEN_INFO, userDto);
request.setAttribute(CommonConstant.PARAMETER_NAME_TOKEN, token);
//刷新token ttl
dbCacheService.setTtl(token, CommonConstant.TOKEN_CACHE_TTL);
}