|
|
|
|
@ -10,13 +10,15 @@
|
|
|
|
|
<div style="text-align:center">
|
|
|
|
|
<Form ref="formInline" :model="formInline" :rules="ruleInline">
|
|
|
|
|
<FormItem prop="user">
|
|
|
|
|
<i-input type="text" size="large" v-model="formInline.user" placeholder="Username" @on-focus="inputFocus">
|
|
|
|
|
<i-input type="text" size="large" v-model="formInline.user" placeholder="Username"
|
|
|
|
|
@on-focus="inputFocus">
|
|
|
|
|
<Icon type="ios-person-outline" slot="prepend"></Icon>
|
|
|
|
|
</i-input>
|
|
|
|
|
<p v-if="showPromptUser" class="font-prompt">{{loginPrompt}}</p>
|
|
|
|
|
</FormItem>
|
|
|
|
|
<FormItem prop="password">
|
|
|
|
|
<i-input type="password" size="large" v-model="formInline.password" placeholder="Password" @on-focus="inputFocus">
|
|
|
|
|
<i-input type="password" size="large" v-model="formInline.password" placeholder="Password"
|
|
|
|
|
@on-focus="inputFocus">
|
|
|
|
|
<Icon type="ios-lock-outline" slot="prepend"></Icon>
|
|
|
|
|
</i-input>
|
|
|
|
|
<p v-if="showPrompt" class="font-prompt">{{loginPrompt}}</p>
|
|
|
|
|
@ -36,7 +38,7 @@
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
// import http from '../services/login/LoginService'
|
|
|
|
|
import LoginService from '../services/login/LoginService'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'Login',
|
|
|
|
|
@ -67,38 +69,29 @@
|
|
|
|
|
this.showPromptUser = false;
|
|
|
|
|
},
|
|
|
|
|
handleSubmit() {
|
|
|
|
|
// let username = this.formInline.user;
|
|
|
|
|
// let password = this.formInline.password;
|
|
|
|
|
const that = this;
|
|
|
|
|
|
|
|
|
|
let login = this.formInline.user.trim();
|
|
|
|
|
let password = this.formInline.password.trim();
|
|
|
|
|
let request = {
|
|
|
|
|
login:login,
|
|
|
|
|
password:password
|
|
|
|
|
};
|
|
|
|
|
LoginService.login(request, function (data) {
|
|
|
|
|
let code = data.data.code;
|
|
|
|
|
if(code === '0000'){
|
|
|
|
|
that.$router.push('/home');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// let params = {"username": username, "password": password, "rememberMe": false};
|
|
|
|
|
// http.login(params, function (res) {
|
|
|
|
|
// let data = res.data;
|
|
|
|
|
// if (data.results) {
|
|
|
|
|
// that.showPrompt = false;
|
|
|
|
|
// that.showPromptUser = false;
|
|
|
|
|
// let item = data.results;
|
|
|
|
|
// sessionStorage.setItem("sessionId", item.sessionId);
|
|
|
|
|
// that.$Message.success('登录成功');
|
|
|
|
|
//
|
|
|
|
|
// that.$store.commit('LOGIN', item);
|
|
|
|
|
// that.$router.push('/home');
|
|
|
|
|
// } else {
|
|
|
|
|
// // that.$Message.error(data.message);
|
|
|
|
|
// if(data.code == "0003"){
|
|
|
|
|
// that.showPrompt = true;
|
|
|
|
|
// that.showPromptUser = false;
|
|
|
|
|
// that.loginPrompt = data.message;
|
|
|
|
|
// }else {
|
|
|
|
|
// that.showPrompt = false;
|
|
|
|
|
// that.showPromptUser = true;
|
|
|
|
|
// that.loginPrompt = data.message;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
that.$Message.info("登陆成功");
|
|
|
|
|
}else if(code === '0004'){
|
|
|
|
|
that.$Message.info("账号不存在");
|
|
|
|
|
}else if(code === '0003'){
|
|
|
|
|
that.$Message.info("密码错误");
|
|
|
|
|
}else if(code === '1007'){
|
|
|
|
|
that.$Message.info("没有权限");
|
|
|
|
|
}else {
|
|
|
|
|
that.$Message.info("系统繁忙");
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -132,10 +125,12 @@
|
|
|
|
|
background-position: 50%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.font-prompt {
|
|
|
|
|
color: #FF6633;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.reserve-style {
|
|
|
|
|
background: #edf5fd;
|
|
|
|
|
height: 44px;
|
|
|
|
|
|