Настройка редиректов на стр. обновления профиля, инфо-сообщение при смене пароля

parent 52152268
$(document).ready(function(){
$('.wrapp-button').on('click', function(){
var $this = $(this);
//var form = $(this).parent().parent()[0].querySelector('form');
var form = $(this).parent('form')[0];
var formData = new FormData(form);
var redirect;
var
$this = $(this),
form = $(this).parent('form')[0],
formData = new FormData(form),
redirectUrl = $(form).attr("data-url-success");
if ($this.eq(0).hasClass("reset")) {
var redirectUrl = $this.eq(0).data("url");
redirect = function () {
document.location.href = redirectUrl;
};
setTimeout(
function () {
$("main").animate({
opacity: 0
}, 500);
setTimeout(redirect, 500);
},
1000
);
document.location.href = redirectUrl;
} else {
$.ajax({
url: $(form).attr("data-url"),
......@@ -34,13 +22,14 @@ $(document).ready(function(){
success: function(data) {
if (data.result) {
console.log(data);
$.showMessage('info', $this.data('action'));
setTimeout(function(){
document.location.reload();
//document.location.reload();
document.location.href = redirectUrl;
}, 1000);
} else {
console.log(data);
$.showMessage('error', data.msg.text);
}
},
error: function (e) {
......
......@@ -58,7 +58,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
<body>
<?php
//$urlHome = $this->url(in_array($identityRole, [\App\Acl\Roles::ROLE_ADMIN,\App\Acl\Roles::ROLE_MANAGER]) ?'adm.index' :'home',['lang' => $lang]);
//$urlHome = $this->url('user.cabinet',['lang' => $lang]);
$urlHome = $this->url('user.cabinet',['lang' => $lang]);
?>
......@@ -96,7 +96,7 @@ $lang = $layoutInfo ? $layoutInfo->getLang() : 'en';
//$urlCabinet = $this->url('user.cabinet',['lang' => $lang]);
$urlCabinet = $this->url('user.cabinet.profile',['lang' => $lang]);
?>
<a href="<?= $urlCabinet ?>" class="annotation" title="<?= _t("Мой кабинет") ?>"><?= $identity->getEmail() ?></a>
<a href="<?= $urlCabinet ?>" class="annotation" title="<?= _t("Настройки профиля") ?>"><?= $identity->getEmail() ?></a>
</div>
<div class="header-logout col sm-2 order-xs-1">
<a href="<?= $this->url('logout', ['lang' => $lang]) ?>" title="<?= _t("Выход") ?>" class="annotation"><?= _t("Выход") ?></a>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment