账户管理页面

master
Caps 6 years ago
parent f7b69ae7fa
commit 09715125ac

@ -1,149 +1,144 @@
<template> <template>
<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"
<Icon type="ios-person-outline" slot="prepend"></Icon> @on-focus="inputFocus">
</i-input> <Icon type="ios-person-outline" slot="prepend"></Icon>
<p v-if="showPromptUser" class="font-prompt">{{loginPrompt}}</p> </i-input>
</FormItem> <p v-if="showPromptUser" class="font-prompt">{{loginPrompt}}</p>
<FormItem prop="password"> </FormItem>
<i-input type="password" size="large" v-model="formInline.password" placeholder="Password" @on-focus="inputFocus"> <FormItem prop="password">
<Icon type="ios-lock-outline" slot="prepend"></Icon> <i-input type="password" size="large" v-model="formInline.password" placeholder="Password"
</i-input> @on-focus="inputFocus">
<p v-if="showPrompt" class="font-prompt">{{loginPrompt}}</p> <Icon type="ios-lock-outline" slot="prepend"></Icon>
</FormItem> </i-input>
<FormItem> <p v-if="showPrompt" class="font-prompt">{{loginPrompt}}</p>
<Button size="large" type="primary" :long="true" @click="handleSubmit"></Button> </FormItem>
</FormItem> <FormItem>
</Form> <Button size="large" type="primary" :long="true" @click="handleSubmit"></Button>
</div> </FormItem>
</Card> </Form>
</div>
</Card>
</div>
<div class="flex-row-center reserve-style">
<p>©上海奇硕网络科技有限公司 沪ICP备05013116号-2</p>
</div>
</div> </div>
<div class="flex-row-center reserve-style">
<p>©上海奇硕网络科技有限公司 沪ICP备05013116号-2</p>
</div>
</div>
</template> </template>
<script> <script>
// import http from '../services/login/LoginService' import LoginService from '../services/login/LoginService'
export default { export default {
name: 'Login', name: 'Login',
data() { data() {
return { return {
formInline: { formInline: {
user: '', user: '',
password: '' password: ''
}, },
ruleInline: { ruleInline: {
user: [ user: [
{required: true, message: '请输入用户名', trigger: 'blur'} {required: true, message: '请输入用户名', trigger: 'blur'}
], ],
password: [ password: [
{required: true, message: '请输入密码', trigger: 'blur'}, {required: true, message: '请输入密码', trigger: 'blur'},
] ]
},
loginPrompt: '',
showPrompt: false,
showPromptUser: false
}
}, },
loginPrompt: '', methods: {
showPrompt: false, //
showPromptUser: false inputFocus: function () {
} this.showPrompt = false;
}, this.showPromptUser = false;
methods: { },
// handleSubmit() {
inputFocus: function(){ const that = this;
this.showPrompt = false;
this.showPromptUser = false;
},
handleSubmit() {
// let username = this.formInline.user;
// let password = this.formInline.password;
const that = this;
that.$router.push('/home');
// let params = {"username": username, "password": password, "rememberMe": false}; let login = this.formInline.user.trim();
// http.login(params, function (res) { let password = this.formInline.password.trim();
// let data = res.data; let request = {
// if (data.results) { login:login,
// that.showPrompt = false; password:password
// that.showPromptUser = false; };
// let item = data.results; LoginService.login(request, function (data) {
// sessionStorage.setItem("sessionId", item.sessionId); let code = data.data.code;
// that.$Message.success(''); if(code === '0000'){
// that.$router.push('/home');
// that.$store.commit('LOGIN', item); that.$Message.info("登陆成功");
// that.$router.push('/home'); }else if(code === '0004'){
// } else { that.$Message.info("账号不存在");
// // that.$Message.error(data.message); }else if(code === '0003'){
// if(data.code == "0003"){ that.$Message.info("密码错误");
// that.showPrompt = true; }else if(code === '1007'){
// that.showPromptUser = false; that.$Message.info("没有权限");
// that.loginPrompt = data.message; }else {
// }else { that.$Message.info("系统繁忙");
// that.showPrompt = false; }
// that.showPromptUser = true; });
// that.loginPrompt = data.message; }
// } }
// }
// });
}
} }
}
</script> </script>
<style scoped> <style scoped>
.center { .center {
position: fixed; position: fixed;
width: 350px; width: 350px;
height: 300px; height: 300px;
top: 42%; top: 42%;
right: 10%; right: 10%;
transform: translate(-150px, -130px); transform: translate(-150px, -130px);
} }
.ivu-card-body {
padding: 22px;
}
.ivu-card-body { .index {
padding: 22px; width: 100%;
} position: absolute;
top: 0;
bottom: 0;
left: 0;
background-color: #fff;
background-image: url(http://img.kiisoo.com/gds_login_bg.jpg);
background-repeat: no-repeat;
background-size: cover;
background-position: 50%;
overflow: hidden;
}
.index { .font-prompt {
width: 100%; color: #FF6633;
position: absolute; text-align: left;
top: 0; }
bottom: 0;
left: 0; .reserve-style {
background-color: #fff; background: #edf5fd;
background-image: url(http://img.kiisoo.com/gds_login_bg.jpg); height: 44px;
background-repeat: no-repeat; font-size: 11px;
background-size: cover; color: #596274;
background-position: 50%; position: fixed;
overflow: hidden; left: 0;
} right: 0;
.font-prompt{ bottom: 0;
color: #FF6633; }
text-align: left;
}
.reserve-style{
background: #edf5fd;
height: 44px;
font-size: 11px;
color: #596274;
position: fixed;
left: 0;
right: 0;
bottom: 0;
}
</style> </style>

@ -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