|
|
|
|
@ -2,21 +2,23 @@
|
|
|
|
|
<div id="app" class="index" style="width: 100%;height: 100%;text-align: center;">
|
|
|
|
|
<div class="center">
|
|
|
|
|
<div style="height: 110px;">
|
|
|
|
|
<!-- <img src="../../static/img/logo-title.png" style="width: 128px;height: 35px;margin-bottom: 8px;" mode="aspectFit"/>-->
|
|
|
|
|
<!-- <img src="../../static/img/logo-title.png" style="width: 128px;height: 35px;margin-bottom: 8px;" mode="aspectFit"/>-->
|
|
|
|
|
<h1 class="ks-font-color" style="font-size: 30px;">门店拓客</h1>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<Card >
|
|
|
|
|
<Card>
|
|
|
|
|
<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',
|
|
|
|
|
@ -62,43 +64,34 @@
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
// 聚焦事件
|
|
|
|
|
inputFocus: function(){
|
|
|
|
|
inputFocus: function () {
|
|
|
|
|
this.showPrompt = false;
|
|
|
|
|
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,11 +125,13 @@
|
|
|
|
|
background-position: 50%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
.font-prompt{
|
|
|
|
|
|
|
|
|
|
.font-prompt {
|
|
|
|
|
color: #FF6633;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.reserve-style{
|
|
|
|
|
|
|
|
|
|
.reserve-style {
|
|
|
|
|
background: #edf5fd;
|
|
|
|
|
height: 44px;
|
|
|
|
|
font-size: 11px;
|
|
|
|
|
|