20250918
This commit is contained in:
BIN
Binary file not shown.
@@ -95,7 +95,7 @@
|
|||||||
<i class="fa fa-sign-in mr-2"></i> 后台登录信息
|
<i class="fa fa-sign-in mr-2"></i> 后台登录信息
|
||||||
</a>
|
</a>
|
||||||
<div class="border-t border-gray-200 my-1"></div>
|
<div class="border-t border-gray-200 my-1"></div>
|
||||||
<a href="{{ url_for('logout') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
<a href="{{ url_for('user.logout') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
||||||
<i class="fa fa-sign-out mr-2"></i> 退出
|
<i class="fa fa-sign-out mr-2"></i> 退出
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -688,7 +688,7 @@
|
|||||||
formData.append('new_password', newPassword);
|
formData.append('new_password', newPassword);
|
||||||
formData.append('confirm_password', confirmPassword);
|
formData.append('confirm_password', confirmPassword);
|
||||||
|
|
||||||
fetch('{{ url_for('change_password') }}', {
|
fetch('{{ url_for('user.change_password') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
@@ -698,7 +698,7 @@
|
|||||||
// 密码修改成功,先执行退出功能,再跳转到登录页面
|
// 密码修改成功,先执行退出功能,再跳转到登录页面
|
||||||
alert(data.message);
|
alert(data.message);
|
||||||
// 重定向到退出路由,系统会自动完成退出并跳转到登录页面
|
// 重定向到退出路由,系统会自动完成退出并跳转到登录页面
|
||||||
window.location.href = '{{ url_for('logout') }}';
|
window.location.href = '{{ url_for('user.logout') }}';
|
||||||
} else if (data.error) {
|
} else if (data.error) {
|
||||||
// 显示服务器返回的错误信息
|
// 显示服务器返回的错误信息
|
||||||
showPasswordError(data.error);
|
showPasswordError(data.error);
|
||||||
@@ -747,7 +747,7 @@
|
|||||||
document.getElementById('profileSuccess').classList.add('hidden');
|
document.getElementById('profileSuccess').classList.add('hidden');
|
||||||
|
|
||||||
// 加载用户信息
|
// 加载用户信息
|
||||||
fetch('{{ url_for('get_user_profile') }}')
|
fetch('{{ url_for('user.get_user_profile') }}')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -823,7 +823,7 @@
|
|||||||
formData.append('phone', phone);
|
formData.append('phone', phone);
|
||||||
formData.append('department', department);
|
formData.append('department', department);
|
||||||
|
|
||||||
fetch('{{ url_for('update_user_profile') }}', {
|
fetch('{{ url_for('user.update_user_profile') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
body: formData
|
body: formData
|
||||||
})
|
})
|
||||||
@@ -940,7 +940,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
// 异步提交修改
|
// 异步提交修改
|
||||||
fetch('{{ url_for('update_login_info') }}', {
|
fetch('{{ url_for('user.update_login_info') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -987,7 +987,7 @@
|
|||||||
// 检查用户名是否为admin
|
// 检查用户名是否为admin
|
||||||
if (currentUsername === 'admin') {
|
if (currentUsername === 'admin') {
|
||||||
// 如果是admin用户,重定向到用户管理页面
|
// 如果是admin用户,重定向到用户管理页面
|
||||||
window.location.href = '{{ url_for('users_management') }}';
|
window.location.href = '{{ url_for('user.users_management') }}';
|
||||||
} else {
|
} else {
|
||||||
// 如果不是admin用户,显示提示信息
|
// 如果不是admin用户,显示提示信息
|
||||||
alert('只有管理员才可以进行用户管理');
|
alert('只有管理员才可以进行用户管理');
|
||||||
|
|||||||
@@ -85,7 +85,7 @@
|
|||||||
<a href="#" onclick="showChangePasswordModal()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
<a href="#" onclick="showChangePasswordModal()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
||||||
<i class="fa fa-key mr-2"></i> 修改密码
|
<i class="fa fa-key mr-2"></i> 修改密码
|
||||||
</a>
|
</a>
|
||||||
<a href="{{ url_for('users_management') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors bg-primary/10">
|
<a href="{{ url_for('user.users_management') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors bg-primary/10">
|
||||||
<i class="fa fa-users mr-2"></i> 用户管理
|
<i class="fa fa-users mr-2"></i> 用户管理
|
||||||
</a>
|
</a>
|
||||||
<a href="#" onclick="showUserProfileModal()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
<a href="#" onclick="showUserProfileModal()" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<i class="fa fa-sign-in mr-2"></i> 后台登录信息
|
<i class="fa fa-sign-in mr-2"></i> 后台登录信息
|
||||||
</a>
|
</a>
|
||||||
<div class="border-t border-gray-200 my-1"></div>
|
<div class="border-t border-gray-200 my-1"></div>
|
||||||
<a href="{{ url_for('logout') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
<a href="{{ url_for('user.logout') }}" class="block px-4 py-2 text-sm text-gray-700 hover:bg-primary hover:text-white transition-colors">
|
||||||
<i class="fa fa-sign-out mr-2"></i> 退出
|
<i class="fa fa-sign-out mr-2"></i> 退出
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
@@ -491,7 +491,7 @@
|
|||||||
|
|
||||||
// 加载用户列表
|
// 加载用户列表
|
||||||
function loadUsers() {
|
function loadUsers() {
|
||||||
fetch('{{ url_for('get_users') }}')
|
fetch('{{ url_for('user.get_users') }}')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -583,7 +583,7 @@
|
|||||||
const filterDepartment = document.getElementById('filterDepartment').value;
|
const filterDepartment = document.getElementById('filterDepartment').value;
|
||||||
const filterStatus = document.getElementById('filterStatus').value;
|
const filterStatus = document.getElementById('filterStatus').value;
|
||||||
|
|
||||||
fetch('{{ url_for('get_users') }}')
|
fetch('{{ url_for('user.get_users') }}')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -614,7 +614,7 @@
|
|||||||
const confirmMessage = `确定要${newStatus === 'active' ? '启用' : '禁用'}用户 ${username} 吗?`;
|
const confirmMessage = `确定要${newStatus === 'active' ? '启用' : '禁用'}用户 ${username} 吗?`;
|
||||||
|
|
||||||
if (confirm(confirmMessage)) {
|
if (confirm(confirmMessage)) {
|
||||||
fetch('{{ url_for('update_user_status') }}', {
|
fetch('{{ url_for('user.update_user_status') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -670,7 +670,7 @@
|
|||||||
const username = document.getElementById('editUsername').value;
|
const username = document.getElementById('editUsername').value;
|
||||||
const newDepartment = document.getElementById('editUserDepartment').value;
|
const newDepartment = document.getElementById('editUserDepartment').value;
|
||||||
|
|
||||||
fetch('{{ url_for('update_user_department') }}', {
|
fetch('{{ url_for('user.update_user_department') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -715,7 +715,7 @@
|
|||||||
const userId = document.getElementById('resetUserId').value;
|
const userId = document.getElementById('resetUserId').value;
|
||||||
const username = document.getElementById('resetUsername').value;
|
const username = document.getElementById('resetUsername').value;
|
||||||
|
|
||||||
fetch('{{ url_for('reset_user_password') }}', {
|
fetch('{{ url_for('user.reset_user_password') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
@@ -810,7 +810,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 异步提交修改
|
// 异步提交修改
|
||||||
fetch('{{ url_for('change_password') }}', {
|
fetch('{{ url_for('user.change_password') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
@@ -829,7 +829,7 @@
|
|||||||
|
|
||||||
// 3秒后跳转登录页
|
// 3秒后跳转登录页
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.location.href = '{{ url_for('login') }}';
|
window.location.href = '{{ url_for('user.login') }}';
|
||||||
}, 3000);
|
}, 3000);
|
||||||
} else {
|
} else {
|
||||||
// 显示错误信息
|
// 显示错误信息
|
||||||
@@ -865,7 +865,7 @@
|
|||||||
// 个人信息相关函数
|
// 个人信息相关函数
|
||||||
function showUserProfileModal() {
|
function showUserProfileModal() {
|
||||||
// 获取个人信息
|
// 获取个人信息
|
||||||
fetch('{{ url_for('get_user_profile') }}')
|
fetch('{{ url_for('user.get_user_profile') }}')
|
||||||
.then(response => response.json())
|
.then(response => response.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
@@ -910,7 +910,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 异步提交修改
|
// 异步提交修改
|
||||||
fetch('{{ url_for('update_user_profile') }}', {
|
fetch('{{ url_for('user.update_user_profile') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/x-www-form-urlencoded'
|
'Content-Type': 'application/x-www-form-urlencoded'
|
||||||
@@ -1018,7 +1018,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
// 异步提交修改
|
// 异步提交修改
|
||||||
fetch('{{ url_for('update_login_info') }}', {
|
fetch('{{ url_for('user.update_login_info') }}', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
|
|||||||
Reference in New Issue
Block a user