From 4402880ed97e915e14e41ade56e94f2e984fdd44 Mon Sep 17 00:00:00 2001 From: dshclm <3321914460@qq.com> Date: Fri, 26 Jul 2024 11:16:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/templates/system/user/add.html | 25 ++++++++++++++++--- .../resources/templates/system/user/edit.html | 23 ++++++++++++++++- 2 files changed, 44 insertions(+), 4 deletions(-) diff --git a/ruoyi-admin/src/main/resources/templates/system/user/add.html b/ruoyi-admin/src/main/resources/templates/system/user/add.html index 05d5508..235440f 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/add.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/add.html @@ -16,7 +16,7 @@
- +
@@ -402,7 +402,6 @@ //文件上传 $('#fileUrlId').on('change.bs.fileinput ', function (e) { - debugger // 处理自己的业务 var file = e.target.files[0]; var data = new FormData(); @@ -430,7 +429,27 @@ }); }); - + $(document).ready(function(){ + $("#userName").blur(function(e){ + var text = $(this).val(); + if (text && text.trim() !== ''){ + $.ajax({ + type: "GET", + url: ctx + "system/user/getPinyin", + data: {name: text}, + dataType: 'json', + success: function(res) { + if (res.code == web_status.SUCCESS) { + $("#loginName").val(res.msg); + } + }, + error: function(error) { + $.modal.alertWarning(error); + } + }); + } + }); + }); diff --git a/ruoyi-admin/src/main/resources/templates/system/user/edit.html b/ruoyi-admin/src/main/resources/templates/system/user/edit.html index 8fd5bff..4e06033 100644 --- a/ruoyi-admin/src/main/resources/templates/system/user/edit.html +++ b/ruoyi-admin/src/main/resources/templates/system/user/edit.html @@ -17,7 +17,7 @@
- +
@@ -379,6 +379,27 @@ }); }); + $(document).ready(function(){ + $("#userName").blur(function(e){ + var text = $(this).val(); + if (text && text.trim() !== ''){ + $.ajax({ + type: "GET", + url: ctx + "system/user/getPinyin", + data: {name: text}, + dataType: 'json', + success: function(res) { + if (res.code == web_status.SUCCESS) { + $("#loginName").val(res.msg); + } + }, + error: function(error) { + $.modal.alertWarning(error); + } + }); + } + }); + });