|
|
@@ -21,7 +21,7 @@
|
|
|
oninput="setTimeout(function(){vue.errors.name=''},10)"
|
|
|
name="name" v-model="inputting.name" required autocomplete="name" autofocus>
|
|
|
|
|
|
- <span class="invalid-feedback d-block" v-if="errors.name">
|
|
|
+ <span class="invalid-feedback" v-if="errors.name">
|
|
|
<strong v-for="msg in errors.name">@{{ msg }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
@@ -32,10 +32,10 @@
|
|
|
|
|
|
<div class="col-md-8">
|
|
|
<input id="password" type="password" class="form-control " :class="[errors.password?'is-invalid':'']"
|
|
|
- oninput="setTimeout(function(){vue.errors.password=''},10)"
|
|
|
+ @keypress="passwordInput($event)"
|
|
|
v-model="inputting.password" name="password" required autocomplete="current-password">
|
|
|
|
|
|
- <span class="invalid-feedback d-block" v-if="errors.password">
|
|
|
+ <span class="invalid-feedback" v-if="errors.password">
|
|
|
<strong v-for="msg in errors.password">@{{ msg }}</strong>
|
|
|
</span>
|
|
|
</div>
|
|
|
@@ -80,14 +80,29 @@
|
|
|
<script>
|
|
|
let vue=new Vue({
|
|
|
el:"#list",
|
|
|
+ mounted:function(){
|
|
|
+ $('.invalid-feedback').addClass('d-block')
|
|
|
+ },
|
|
|
data:{
|
|
|
inputting:{name:'',password:'',is_json:true},
|
|
|
errors: {name:'',password:'',},
|
|
|
},
|
|
|
+ methods:{
|
|
|
+ passwordInput:function(e){
|
|
|
+ setTimeout(function(){vue.errors.password=''},10);
|
|
|
+ if(e.key==='Enter'){
|
|
|
+ loginSubmit()
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }
|
|
|
}
|
|
|
)
|
|
|
function loginSubmit() {
|
|
|
+ tempTip.setDuration('99999');
|
|
|
+ tempTip.waitingTip('提交中');
|
|
|
axios.post('{{ route('login') .'?rand='.microtime(true)}}',vue.inputting).then(function (response) {
|
|
|
+ tempTip.setDuration('2000');
|
|
|
+ tempTip.cancelWaitingTip();
|
|
|
if(response.data.success!==true){
|
|
|
if(response.data.errors){
|
|
|
vue.errors=response.data.errors;
|