朱思禹提交:添加修改密码,退出登录,登录页美化功能

init
Administrator 4 years ago
parent 847ca105d1
commit 551150dabe

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 686 B

@ -2,11 +2,15 @@
<div class="login-div-style">
<div class="title-style">长春市学生体质健康信息化管理系统</div>
<div class="div-style clearfix">
<span class="span-style">用户名</span>
<a-input class="input-style" placeholder="请输入用户名" :allowClear="true" v-model="account" @change="(evt)=>onChange(evt,'account')"></a-input>
<div class="account-title-style">账号登录</div>
<a-input class="input-style" placeholder="请输入账号" :allowClear="true" v-model="account" @change="(evt)=>onChange(evt,'account')">
<img slot="prefix" src="../assets/account.png">
</a-input>
<div class="tips-style" :style="{visibility:accountTips === true?'visible':'hidden'}">请输入用户名</div>
<span class="span-style">密码</span>
<a-input-password class="input-style" :allowClear="true" placeholder="请输入密码" v-model="pass" @change="(evt)=>onChange(evt,'pass')"></a-input-password>
<a-input-password class="input-style" :allowClear="true" placeholder="请输入密码" v-model="pass" style="margin-top: 0"
@change="(evt)=>onChange(evt,'pass')">
<img slot="prefix" src="../assets/password.png">
</a-input-password>
<div class="tips-style" :style="{visibility:passTips === true?'visible':'hidden'}">请输入密码</div>
<a-button type="primary" class="btn-style" @click="onLogin"></a-button>
<div class="tips-style">{{loginTips}}</div>
@ -149,26 +153,44 @@
.login-div-style{
width: 100%;
height: 100%;
/*background-image: url("../assets/loginBg.png");*/
/*background-size: cover;*/
/*background-repeat: no-repeat;*/
background-image: url("../assets/loginbg.jpg");
background-size: cover;
background-repeat: no-repeat;
position: relative;
padding-top: 100px;
.title-style{
/*position: absolute;*/
/*color:#36FEFE;*/
font-size: 25px;
font-weight: bold;
/*width: 220px;*/
.account-title-style{
width: 78px;
height: 36px;
padding-bottom: 10px;
border-bottom: 2px solid #ffffff;
text-align: center;
margin-bottom: 100px;
font-size: 18px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
margin-left: 55px;
color:#ffffff;
}
.title-style{
position: absolute;
top: 167px;
left: 491px;
width: 583px;
height: 43px;
color:#115AB9;
font-size: 36px;
font-weight: 700;
font-family: Source Han Sans CN, Source Han Sans CN-Bold;
line-height: 40px;
text-shadow: -1px -1px 0 #ffffff,
1px -1px 0 #ffffff,
-1px 1px 0 #ffffff,
1px 1px 0 #ffffff,
0px 2px 2px #ffffff;
}
.div-style{
width: 500px;
padding: 32px 20px 0 20px;
border: 1px solid #e5e5e5;
border-radius: 5px;
margin: auto;
position: absolute;
top: 295px;
left: 428px;
width: 354px;
.span-style{
float: left;
width: 100px;
@ -179,25 +201,38 @@
line-height: 32px;
}
.input-style{
float: left;
width: 330px;
height: 32px;
margin-left: 20px;
width: 100%;
height: 55px;
margin-top: 30px;
/deep/.ant-input{
padding-left: 40px;
height: 100%;
border-radius: 12px;
font-size: 16px;
font-family: Microsoft YaHei, Microsoft YaHei-Regular;
font-weight: 400;
}
}
.tips-style{
float: left;
width: 330px;
margin-left: 120px;
height: 32px;
width: 100%;
height: 30px;
text-align: right;
line-height: 32px;
line-height: 20px;
color:red;
font-size: 14px;
}
.btn-style{
float: left;
width: 330px;
margin-left: 120px;
width: 354px;
height: 56px;
opacity: 1;
background: linear-gradient(0deg,#00d8ff 0%, #009cff 55%, #0054ff 100%);
background: -webkit-linear-gradient(0deg,#00d8ff 0%, #009cff 55%, #0054ff 100%);
background: -moz-linear-gradient(0deg,#00d8ff 0%, #009cff 55%, #0054ff 100%);
border-radius: 28px;
font-size: 20px;
font-family: Source Han Sans CN, Source Han Sans CN-Regular;
font-weight: 400;
letter-spacing: 2px;
}
}
}

@ -2,8 +2,8 @@ import Vue from 'vue'
import App from './App.vue'
import VueBus from 'vue-bus';
// import '../../utils/global-import';
// import 'vue2-toast/lib/toast.css';
// import Toast from 'vue2-toast';
import 'vue2-toast/lib/toast.css';
import Toast from 'vue2-toast';
// import {Modal} from 'ant-design-vue'
// import '../../self-font/style.css';
import "../../commonStyle/commonStyle.scss";
@ -14,14 +14,14 @@ import {resetRoutes} from './router';
import store from './store';
import Cookie from '../../global-llibs/cookie';
import Base64 from '../../global-llibs/base64';
import {Icon} from 'ant-design-vue';
import {Icon,Modal} from 'ant-design-vue';
import iconFont from './font/iconfont';
const MyIcon = Icon.createFromIconfontCN({
scriptUrl:iconFont, // 在 iconfont.cn 上生成
});
// Vue.use(Toast);
Vue.use(Toast);
Vue.use(VueBus);
// Vue.use(Modal);
Vue.use(Modal);
Vue.component('vueScroll', vuescroll)
Vue.component('MyIcon', MyIcon)
Vue.config.productionTip = false

@ -4,17 +4,34 @@
<div class="title-text-style">
长春市<span style="font-size: 10px;vertical-align: top"></span>学生体质健康信息化管理系统
</div>
<div class="logout-div-style">
<div class="logout-div-style" @click="logout">
<a-icon type="logout" style="margin-right: 10px;cursor: pointer"/>
<span style="cursor: pointer">退出登录</span>
</div>
<div class="password-div-style">
<div class="password-div-style" @click="modifyPass">
<a-icon type="key" style="margin-right: 10px;cursor: pointer"/>
<span style="cursor: pointer">修改密码</span>
</div>
<div class="logout-div-style" style="border-left: none">
{{org_name}}<span style="font-size: 8px;vertical-align: top"></span>{{person_name}}欢迎您
</div>
<a-spin :spinning="showSpin">
<a-modal title="修改密码" v-model="showModifyPass" :maskClosable="false" :keyboard="false" :centered="true"
@ok="onOk" @cancel="onCancel">
<div class="modify-pass-container-style clearfix">
<span class="pass-title-style">原密码</span>
<a-input-password class="password-style" v-model="oldPass" :allowClear="true" placeholder="请输入原密码最多50个字符" @change="passChange('oldPass')"/>
<div class="tips-style">{{oldPassTips}}</div>
<span class="pass-title-style">新密码</span>
<a-input-password class="password-style" v-model="newPass" :allowClear="true" placeholder="请输入新密码最多50个字符" @change="passChange('newPass')"/>
<div class="tips-style">{{newPassTips}}</div>
<span class="pass-title-style" style="margin-bottom: 0">确认密码</span>
<a-input-password class="password-style" v-model="confirmPass" :allowClear="true" placeholder="请输入确认密码最多50个字符"
style="margin-bottom: 0" @change="passChange('confirmPass')"/>
<div class="tips-style">{{confirmPassTips}}</div>
</div>
</a-modal>
</a-spin>
</a-layout-header>
<a-layout-slider class="layout-slider-style" theme="light" :collapsible="true"
:collapsedWidth="0" v-model="collapsibled" :zeroWidthTriggerStyle="{backgroundColor:collapsibled?'#31a8fa':'rgba(0,0,0,0)',
@ -64,8 +81,11 @@
<script>
let selectedKey = "";
let openKey = [];
import {Layout,Icon,Menu,Breadcrumb} from 'ant-design-vue';
import {Layout,Icon,Menu,Breadcrumb,Input,Modal,Spin} from 'ant-design-vue';
import {mapState} from 'vuex';
import Cookie from '../../../global-llibs/cookie';
import Interface from '../../../global-llibs/axios-config';
import InterfaceConfig from './interfaceConfig';
export default {
name: "MainPage",
data:function(){
@ -91,6 +111,14 @@
selectedMenu:[selectedKey],
openKeys:openKey,
echartsUpldate:false,
showModifyPass:false,
oldPass:'',
newPass:'',
confirmPass:'',
oldPassTips:'',
newPassTips:'',
confirmPassTips:'',
showSpin:false,
}
},
mounted(){
@ -113,8 +141,120 @@
AIcon:Icon,
AMenu:Menu,
AMenuItem:Menu.Item,
// AModal:Modal,
AInputPassword:Input.Password,
ASpin:Spin
},
methods:{
passChange:function(type){
if (type === 'oldPass'){
if (this.oldPass.replace(/^(\s|\xA0)+|(\s|\xA0)+$/g, '') === ''){
this.oldPass = ''
}else if(this.oldPassTips !== ''){
this.oldPassTips = '';
}
}else if(type === 'newPass'){
if (this.newPass.replace(/^(\s|\xA0)+|(\s|\xA0)+$/g, '') === ''){
this.newPass = ''
}else if(this.newPassTips !== ''){
this.newPassTips = '';
}
}else{
if (this.confirmPass.replace(/^(\s|\xA0)+|(\s|\xA0)+$/g, '') === ''){
this.confirmPass = ''
}else if(this.confirmPassTips !== ''){
this.confirmPassTips = '';
}
}
},
onCancel:function(){
this.showModifyPass = false;
},
onOk:function(){
if (this.oldPass === ''){
this.oldPassTips = '请输入原密码';
return;
}else if (this.newPass === ''){
this.newPassTips = '请输入新密码';
return;
}else if (this.oldPass === this.newPass){
this.newPassTips = '新密码与原密码相同,请重新输入';
return;
}else if(this.confirmPass === ''){
this.confirmPassTips = '请输入确认密码';
return;
}else if(this.newPass !== this.confirmPass){
this.confirmPassTips = '确认密码与新密码不一致,请重新输入';
return;
}
this.showSpin = true;
Interface.callInterface([{
url:InterfaceConfig.saveUserPassword.url,
params:{
user_id:this.$store.state.person_id,
old_login_pwd:this.oldPass,
login_pwd:this.newPass,
last_update_person_id:this.$store.state.person_id,
last_update_person_name:this.$store.state.person_name
},
method:InterfaceConfig.saveUserPassword.method,
isTestLogin:InterfaceConfig.saveUserPassword.isTestLogin
}],(result)=>{
this.showSpin = false;
if (result[0].data.code === 2000){
this.$toast('密码已修改');
this.showModifyPass = false;
}else{
this.confirmPassTips = result[0].data.msg;
}
})
},
clearPassData:function(){
this.oldPass = '';
this.newPass = '';
this.confirmPass = '';
this.confirmPassTips = '';
this.oldPassTips = '';
this.newPassTips = '';
},
modifyPass:function(){
this.clearPassData();
this.showModifyPass = true
},
logout:function(){
let _this = this;
Modal.confirm({
title:'退出登录',
content:'您确定要退出登录吗?',
centered:true,
onOk:function () {
Interface.callInterface([{
url:InterfaceConfig.logout.url,
params:{
user_id:_this.$store.state.person_id,
token:_this.$store.state.token,
},
method:InterfaceConfig.logout.method,
isTestLogin:InterfaceConfig.logout.isTestLogin
}],(result)=>{
if (result[0].data.code === 2000){
Cookie.delete('person_id');
Cookie.delete('person_name');
Cookie.delete('token');
Cookie.delete('org_id');
Cookie.delete('org_name');
Cookie.delete('identity_id');
Cookie.delete('district_id');
Cookie.delete('district_name');
Cookie.delete('role');
_this.$store.commit("clearState");
_this.$router.replace({name:'login'});
}
});
}
})
},
backBtnClick:function(){
this.$bus.emit("ANALYSISRETURN");
},
@ -223,5 +363,30 @@
margin: 0 16px;
}
}
.modify-pass-container-style{
/*padding-top: 20px;*/
.pass-title-style{
float: left;
width: 100px;
line-height: 32px;
letter-spacing: 5px;
text-align: right;
}
.password-style{
float: left;
width: calc(100% - 120px);
/*margin-bottom: 20px;*/
margin-left: 20px;
}
.tips-style{
float: left;
width: calc(100% - 120px);
height: 20px;
margin-left: 120px;
text-align: right;
color: red;
font-size: 14px;
}
}
</style>

@ -0,0 +1,26 @@
const InterfaceConfig = {
/*
* 1.2.4修改密码
* user_id 必填 number 主键
* old_login_pwd 非必填 string 原密码
* login_pwd 必填 string 用户密码
* last_update_person_id 必填 number 最后修改人ID
* last_update_person_name 必填 string 最后修改人姓名
* */
saveUserPassword:{
url:'intellioa/sys/user/saveUserPassword',
method:'post',
isTestLogin:true,
},
/*
* 退出登录
* user_id 必填 string 用户id
* token 必填 string 用户token
* */
logout:{
url:'intellioa/sys/login/logout',
method:'post',
isTestLogin:true
},
};
export default InterfaceConfig

@ -27,6 +27,15 @@ const store = new Vuex.Store({
setSingleParam(state,params){
state[params.key] = _.cloneDeep(params.value);
},
clearState(state){
Object.keys(state).forEach((item)=>{
if (item === 'menu' || item === 'breadCrumb'){
state[item] = [];
}else {
state[item] = '';
}
})
}
}
})

Loading…
Cancel
Save