init
Showing
1 changed file
with
28 additions
and
2 deletions
| ... | @@ -156,8 +156,34 @@ | ... | @@ -156,8 +156,34 @@ |
| 156 | layer_show('添加员工', '<?=site_url('perm/staffEdit');?>/'+id); | 156 | layer_show('添加员工', '<?=site_url('perm/staffEdit');?>/'+id); |
| 157 | } | 157 | } |
| 158 | 158 | ||
| 159 | function reset() { | 159 | function reset(id) { |
| 160 | layer_show('重置密码', '<?=site_url('perm/reset');?>'); | 160 | //layer_show('重置密码', '<?=site_url('perm/reset');?>'); |
| 161 | layer.confirm('您确定要将密码重置为 123456 吗?', { | ||
| 162 | btn: ['确认','取消'], | ||
| 163 | title: '重置密码', | ||
| 164 | icon: 3 | ||
| 165 | }, function(){ | ||
| 166 | $.ajax({ | ||
| 167 | type: 'put', | ||
| 168 | url: apiBaseUrl + 'system/user/resetPassword/'+id+'?newPassword=' + 123456, | ||
| 169 | cache: false, | ||
| 170 | dataType: 'json', | ||
| 171 | data: JSON.stringify(data), | ||
| 172 | contentType: "application/json; charset=UTF-8", | ||
| 173 | success: function (data) { | ||
| 174 | if (data.msg) { | ||
| 175 | layer.alert(data.msg); | ||
| 176 | } else if (data.code != 0) { | ||
| 177 | layer.alert('操作失败'); | ||
| 178 | } else { | ||
| 179 | layer.msg('重置成功'); | ||
| 180 | } | ||
| 181 | }, | ||
| 182 | error: function () { | ||
| 183 | layer.alert("请求失败") | ||
| 184 | } | ||
| 185 | }) | ||
| 186 | }); | ||
| 161 | } | 187 | } |
| 162 | 188 | ||
| 163 | function freeze(id) { | 189 | function freeze(id) { | ... | ... |
-
Please register or sign in to post a comment