账户管理页面

master
Caps 6 years ago
parent f7b69ae7fa
commit 09715125ac

@ -2,21 +2,23 @@
<div id="app" class="index" style="width: 100%;height: 100%;text-align: center;"> <div id="app" class="index" style="width: 100%;height: 100%;text-align: center;">
<div class="center"> <div class="center">
<div style="height: 110px;"> <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> <h1 class="ks-font-color" style="font-size: 30px;">门店拓客</h1>
</div> </div>
<Card > <Card>
<div style="text-align:center"> <div style="text-align:center">
<Form ref="formInline" :model="formInline" :rules="ruleInline"> <Form ref="formInline" :model="formInline" :rules="ruleInline">
<FormItem prop="user"> <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> <Icon type="ios-person-outline" slot="prepend"></Icon>
</i-input> </i-input>
<p v-if="showPromptUser" class="font-prompt">{{loginPrompt}}</p> <p v-if="showPromptUser" class="font-prompt">{{loginPrompt}}</p>
</FormItem> </FormItem>
<FormItem prop="password"> <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> <Icon type="ios-lock-outline" slot="prepend"></Icon>
</i-input> </i-input>
<p v-if="showPrompt" class="font-prompt">{{loginPrompt}}</p> <p v-if="showPrompt" class="font-prompt">{{loginPrompt}}</p>
@ -36,7 +38,7 @@
</template> </template>
<script> <script>
// import http from '../services/login/LoginService' import LoginService from '../services/login/LoginService'
export default { export default {
name: 'Login', name: 'Login',
@ -62,43 +64,34 @@
}, },
methods: { methods: {
// //
inputFocus: function(){ inputFocus: function () {
this.showPrompt = false; this.showPrompt = false;
this.showPromptUser = false; this.showPromptUser = false;
}, },
handleSubmit() { handleSubmit() {
// let username = this.formInline.user;
// let password = this.formInline.password;
const that = this; 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'); that.$router.push('/home');
that.$Message.info("登陆成功");
}else if(code === '0004'){
// let params = {"username": username, "password": password, "rememberMe": false}; that.$Message.info("账号不存在");
// http.login(params, function (res) { }else if(code === '0003'){
// let data = res.data; that.$Message.info("密码错误");
// if (data.results) { }else if(code === '1007'){
// that.showPrompt = false; that.$Message.info("没有权限");
// that.showPromptUser = false; }else {
// let item = data.results; that.$Message.info("系统繁忙");
// 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;
// }
// }
// });
} }
} }
} }
@ -132,11 +125,13 @@
background-position: 50%; background-position: 50%;
overflow: hidden; overflow: hidden;
} }
.font-prompt{
.font-prompt {
color: #FF6633; color: #FF6633;
text-align: left; text-align: left;
} }
.reserve-style{
.reserve-style {
background: #edf5fd; background: #edf5fd;
height: 44px; height: 44px;
font-size: 11px; font-size: 11px;

@ -12,10 +12,10 @@ import http from '../CommonHttp'
* @param call 成功的回调 * @param call 成功的回调
* @returns {Promise<any>} 返回Promise对象 * @returns {Promise<any>} 返回Promise对象
*/ */
export function login(url, params, call) { export function login(params, call) {
return http.post(url, params).then(call) return http.get('/login', params).then(call)
} }
export default { export default {
login: login login,
} }

Loading…
Cancel
Save