|
|
@@ -10,6 +10,7 @@
|
|
|
<div class="alert alert-success h1">{{Session::get('successTip')}}</div>
|
|
|
@endif
|
|
|
<div id="list">
|
|
|
+ @include("maintenance.user._resetPwd")
|
|
|
<table class="table table-striped table-sm td-min-width-80" id="table">
|
|
|
<tr v-for="(user,i) in users" @click="selectTr===i+1?selectTr=0:selectTr=i+1" :class="selectTr===i+1?'focusing' : ''">
|
|
|
<td class="text-muted"><span>@{{user.id}}</span></td>
|
|
|
@@ -35,6 +36,7 @@
|
|
|
<td class="text-muted"><span>@{{user.created_at}}</span></td>
|
|
|
<td>
|
|
|
@can('用户-编辑')
|
|
|
+ <button class="btn btn-sm btn-warning" @click="openResetPwdModal(user)">重置密码</button>
|
|
|
<button class="btn btn-sm btn-outline-primary" @click="edit(user.id)">改</button> @endcan
|
|
|
@can('用户-删除')
|
|
|
<button class="btn btn-sm btn-outline-dark" @click="destroy(user)">删</button> @endcan
|
|
|
@@ -65,7 +67,8 @@
|
|
|
{name:'{{$owner->id}}',value:'{{$owner->name}}'},
|
|
|
@endforeach
|
|
|
],
|
|
|
- selectTr:0
|
|
|
+ selectTr:0,
|
|
|
+ user:{},
|
|
|
},
|
|
|
mounted:function(){
|
|
|
let data = [
|
|
|
@@ -130,6 +133,26 @@
|
|
|
tempTip.show('删除用户失败!'+'网络错误:' + err)
|
|
|
});
|
|
|
},
|
|
|
+ openResetPwdModal(user){
|
|
|
+ this.user = user;
|
|
|
+ $("#modal").modal("show");
|
|
|
+ },
|
|
|
+ resetPwd(){
|
|
|
+ window.tempTip.setIndex(1099);
|
|
|
+ window.tempTip.setDuration(3000);
|
|
|
+ if (this.user.pwd.length<6){
|
|
|
+ window.tempTip.show("密码最少为六位");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.user.pwd!==this.user.rePwd){
|
|
|
+ window.tempTip.show("两次密码输入不一致");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ window.tempTip.postBasicRequest("{{url('maintenance/user/resetPassword')}}",this.user,()=>{
|
|
|
+ $("#modal").modal("hide");
|
|
|
+ return "已重置用户:“"+this.user.name+"”的密码";
|
|
|
+ },true);
|
|
|
+ },
|
|
|
}
|
|
|
});
|
|
|
</script>
|