完善语言包

优化退出逻辑
1.x
Karson 2026-06-02 10:56:33 +08:00
parent c7582f7efe
commit a88f91046c
2 changed files with 20 additions and 0 deletions

View File

@ -66,6 +66,8 @@ return [
'Operation failed' => '操作失败',
'Invalid parameters' => '参数不正确',
'Change password failure' => '修改密码失败',
'Are you sure you want to sign out?' => '确定要退出登录吗?',
'Confirm sign out' => '确定退出',
'All' => '全部',
'Url' => '物理路径',
'Imagewidth' => '宽度',

View File

@ -100,6 +100,24 @@ define(['fast', 'template', 'moment'], function (Fast, Template, Moment) {
$(document).on("click", ".sidebar-toggle", function () {
$("body").toggleClass("sidebar-open");
});
$(document).on("click", "a[href*='user/logout']", function () {
var that = this;
$.ajax({
type: 'GET', dataType: 'html', url: $(that).attr("href"),
success: function (data, status, xhr) {
Fast.api.ajax({url: $(that).attr("href"), loading:false, data: {__token__: xhr.getResponseHeader('__token__')}}, function (data, ret) {
Layer.msg(ret.msg, {icon: 1}, function () {
location.reload();
});
return false;
});
}, error: function (xhr, type) {
Layer.msg(__('Network error'), {icon: 2});
}
});
return false;
});
}
};
Frontend.api = $.extend(Fast.api, Frontend.api);