mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
Added redirection to previous page after logout
This commit is contained in:
parent
195effd177
commit
8a896f196c
2 changed files with 7 additions and 2 deletions
|
@ -17,7 +17,7 @@ func (a *BaseController) checkLogin(c *gin.Context) {
|
|||
if isAjax(c) {
|
||||
pureJsonMsg(c, http.StatusUnauthorized, false, I18nWeb(c, "pages.login.loginAgain"))
|
||||
} else {
|
||||
c.Redirect(http.StatusTemporaryRedirect, c.GetString("base_path"))
|
||||
c.Redirect(http.StatusTemporaryRedirect, c.GetString("base_path") + "?redirect=" + c.FullPath())
|
||||
}
|
||||
c.Abort()
|
||||
} else {
|
||||
|
|
|
@ -502,7 +502,12 @@
|
|||
const msg = await HttpUtil.post('/login', this.user);
|
||||
this.loading = false;
|
||||
if (msg.success) {
|
||||
location.href = basePath + 'panel/';
|
||||
const redirect = new URLSearchParams(location.search).get('redirect');
|
||||
if (redirect && redirect.startsWith('/')) {
|
||||
location.href = redirect;
|
||||
} else {
|
||||
location.href = basePath + 'panel/';
|
||||
}
|
||||
}
|
||||
},
|
||||
async getSecretStatus() {
|
||||
|
|
Loading…
Reference in a new issue