Commit 7a7e702a by lihu541

新增登录验证码

数据显示bug修改
parent d34728b5
...@@ -167,3 +167,14 @@ ...@@ -167,3 +167,14 @@
.color2{color: #FF7277;} .color2{color: #FF7277;}
.color3{ color: #15C436;} .color3{ color: #15C436;}
#color4{} #color4{}
.flex{
/*flex 布局*/
display: flex;
/*实现垂直居中*/
align-items: center;
/*实现水平居中*/
justify-content: center;
text-align: justify;
}
...@@ -416,6 +416,18 @@ ...@@ -416,6 +416,18 @@
this.sweetBar = [] this.sweetBar = []
res.data.content.forEach(item => { res.data.content.forEach(item => {
if (item.YWSJ) {
} else {
if (item.XZQH_TEXT) {
} else if (item.YLJGDM_EX2) {
} else {
return false
}
}
let obj = { let obj = {
place: '', place: '',
value: 0 value: 0
...@@ -761,7 +773,6 @@ ...@@ -761,7 +773,6 @@
this.threeCode = 2 this.threeCode = 2
this.cityArea = 2 this.cityArea = 2
//点击得到 "区分级" //点击得到 "区分级"
this._group = 'YLJGDM' this._group = 'YLJGDM'
this.themeID = 45 this.themeID = 45
...@@ -770,7 +781,6 @@ ...@@ -770,7 +781,6 @@
} else if (this.pageLevel === 'sq') { } else if (this.pageLevel === 'sq') {
this.threeCode = 3 this.threeCode = 3
this.cityArea = 3 this.cityArea = 3
this._group = 'YWSJ' this._group = 'YWSJ'
this.themeID = 44 this.themeID = 44
......
...@@ -5,13 +5,29 @@ ...@@ -5,13 +5,29 @@
<p class="lgtitle">上海市疾病预防控制管理服务云平台</p> <p class="lgtitle">上海市疾病预防控制管理服务云平台</p>
<el-input v-model="loginID" placeholder="账 号" clearable></el-input> <el-input v-model="loginID" placeholder="账 号" clearable></el-input>
<el-input v-model="loginPas" placeholder="密 码" show-password></el-input> <el-input v-model="loginPas" placeholder="密 码" show-password></el-input>
<el-input v-model="MACIP" value="MAC:35:38:33:33:31:30" :disabled="true"> </el-input> <el-input v-model="MACIP" value="MAC:35:38:33:33:31:30" :disabled="true"></el-input>
<!--验证码-->
<div class="flex" style="vertical-align:center;text-align: center;">
<el-input
v-model="captcha_code"
placeholder="验证码"
prefix-icon="lj-icon-yanzhengma"
autocomplete="off"
autocapitalize="off"
spellcheck="false"
maxlength="8"
style="width: 130px;display: inline-block;margin: 0px 12px 0px 0px;"
></el-input>
<img src="" ref="code" @click="changeCode" height="40">
</div>
<div class="PassAbout"> <div class="PassAbout">
<div class="MemoryPass"> <div class="MemoryPass">
<el-checkbox v-model="checked">记住密码</el-checkbox> <el-checkbox v-model="checked">记住密码</el-checkbox>
</div> </div>
<div class="ChangePass"> <div class="ChangePass">
<router-link to="/UserRepass">修改密码</router-link> <i class="el-icon-warning-outline"></i> <router-link to="/UserRepass">修改密码</router-link>
<i class="el-icon-warning-outline"></i>
</div> </div>
</div> </div>
<el-button type="primary" @click="Login()">登录</el-button> <el-button type="primary" @click="Login()">登录</el-button>
...@@ -20,58 +36,61 @@ ...@@ -20,58 +36,61 @@
</template> </template>
<script> <script>
import {login} from '@/api/userlogin.js' import {login, getCode} from '@/api/userlogin.js'
export default { export default {
data() { data() {
return { return {
loginID: '', loginID: '',
loginPas: '', loginPas: '',
errormsg:'', errormsg: '',
MACIP:'MAC:35:38:33:33:31:30', MACIP: 'MAC:35:38:33:33:31:30',
checked: false, checked: false,
value2:'' captcha_key: "",
captcha_code: "",
value2: ''
} }
}, },
methods:{ methods: {
Login(){ Login() {
if(!this.loginID){ if (!this.loginID) {
this.$message.error('用户名不可为空'); this.$message.error('用户名不可为空');
return false return false
} }
if(!this.loginPas){ if (!this.loginPas) {
this.$message.error('用户密码不可为空'); this.$message.error('用户密码不可为空');
return false return false
} }
let _this = this let _this = this
// 用户登录 // 用户登录
//login(this.loginID, this.$md5(this.loginPas)).then( res=>{ login(this.loginID, this.$md5(this.loginPas)).then(res => {
login(this.loginID,this.loginPas).then( res=>{ // login(this.loginID,this.loginPas).then( res=>{
console.log(res) console.log(res)
if(res.code==1){ if (res.code == 1) {
sessionStorage.setItem('token', res.data.token); sessionStorage.setItem('token', res.data.token);
sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo)); sessionStorage.setItem('userinfo', JSON.stringify(res.data.userInfo));
sessionStorage.setItem('ywsj', res.data.userInfo.jzrq); sessionStorage.setItem('ywsj', res.data.userInfo.jzrq);
sessionStorage.setItem('porgcode', res.data.userInfo.porgcode); sessionStorage.setItem('porgcode', res.data.userInfo.porgcode);
sessionStorage.setItem('organizcode', res.data.userInfo.organizcode); sessionStorage.setItem('organizcode', res.data.userInfo.organizcode);
sessionStorage.setItem('organizcodeName', res.data.userInfo.jgjc); sessionStorage.setItem('organizcodeName', res.data.userInfo.jgjc);
if('hcms.shizhang' === res.data.userInfo.roles[0]){//市角色 if ('hcms.shizhang' === res.data.userInfo.roles[0]) {//市角色
sessionStorage.setItem('userRole', "city"); sessionStorage.setItem('userRole', "city");
}else if('hcms.App_Qu' === res.data.userInfo.roles[0]){//区角色 } else if ('hcms.App_Qu' === res.data.userInfo.roles[0]) {//区角色
sessionStorage.setItem('userRole', "area"); sessionStorage.setItem('userRole', "area");
}else if('hcms.APP_SQYZ' === res.data.userInfo.roles[0]){//社区角色 } else if ('hcms.APP_SQYZ' === res.data.userInfo.roles[0]) {//社区角色
sessionStorage.setItem('userRole', "hospital"); sessionStorage.setItem('userRole', "hospital");
} }
this.$router.push({path: './Index'}); this.$router.push({path: './Index'});
}else{ } else {
_this.$message.error(res.msg); _this.$message.error(res.msg);
} }
if(res.msg == "操作成功"){ if (res.msg == "操作成功") {
//单选框被选中时,将 local 存储 //单选框被选中时,将 local 存储
if(this.checked){ if (this.checked) {
// local 存储 用户登录返回的所有数据(不包含密码) // local 存储 用户登录返回的所有数据(不包含密码)
// local 存储 用户密码 // local 存储 用户密码
sessionStorage.setItem('userID', this.loginID); sessionStorage.setItem('userID', this.loginID);
...@@ -80,24 +99,37 @@ ...@@ -80,24 +99,37 @@
} }
// 登陆成功, 路由跳转 // 登陆成功, 路由跳转
this.$router.push({path: './Index'}); this.$router.push({path: './Index'});
}else{ } else {
let errormsg = res.msg let errormsg = res.msg
_this.$message.error(`${errormsg}`); _this.$message.error(`${errormsg}`);
} }
}).catch( err=>{ }).catch(err => {
console.log("登录报错!"); console.log("登录报错!");
}) })
},
//更换验证码
changeCode() {
this.$refs.code.setAttribute(
"src", 'http://shiro.easyweb.vip/assets/captcha' + '?t=' + (new Date).getTime()
);
} }
}, },
mounted() { mounted() {
if(sessionStorage.getItem('userID') && sessionStorage.getItem('userPas')){ this.$refs.code.setAttribute(
"src", 'http://shiro.easyweb.vip/assets/captcha'
);
if (sessionStorage.getItem('userID') && sessionStorage.getItem('userPas')) {
// 若 local 存在即自动跳转 // 若 local 存在即自动跳转
// 获取密码与账户 // 获取密码与账户
this.loginID = sessionStorage.getItem('userID') this.loginID = sessionStorage.getItem('userID')
this.loginPas = sessionStorage.getItem('userPas') this.loginPas = sessionStorage.getItem('userPas')
this.checked = sessionStorage.getItem('ifselect') this.checked = sessionStorage.getItem('ifselect')
console.log(sessionStorage.getItem('ifselect')); console.log(sessionStorage.getItem('ifselect'));
// let localUserID = JSON.parse(sessionStorage.getItem('UserMessage')).data.userInfo.userId // let localUserID = JSON.parse(sessionStorage.getItem('UserMessage')).data.userInfo.userId
// let localUserPas = sessionStorage.getItem('UserPass') // let localUserPas = sessionStorage.getItem('UserPass')
// login(localUserID, localUserPas).then( res=>{ // login(localUserID, localUserPas).then( res=>{
...@@ -111,7 +143,7 @@ ...@@ -111,7 +143,7 @@
// this.$message.error(`${errormsg}`); // this.$message.error(`${errormsg}`);
// } // }
// }) // })
}else{ } else {
// console.log(localUserID); // console.log(localUserID);
// console.log(localUserPas); // console.log(localUserPas);
// this.$message.error(`暂无local或local被清除,请手动登录!`); // this.$message.error(`暂无local或local被清除,请手动登录!`);
...@@ -121,28 +153,34 @@ ...@@ -121,28 +153,34 @@
</script> </script>
<style lang="stylus" scoped> <style lang="stylus" scoped>
.userlogdom >>> ::-webkit-input-placeholder .userlogdom >>> ::-webkit-input-placeholder
color: #777; color: #777;
font-size: 14px; font-size: 14px;
.userlogdom >>> .el-input .userlogdom >>> .el-input
width 250px width 250px
display block display block
margin 10px auto margin 10px auto
.userlogdom >>> .el-checkbox__label .userlogdom >>> .el-checkbox__label
color #fff color #fff
.userlogdom >>> .el-button .userlogdom >>> .el-button
width 250px width 250px
height 40px height 40px
display block display block
margin 15px auto 0 margin 15px auto 0
.usercontainer .usercontainer
width 100% width 100%
height 600px height 600px
overflow hidden overflow hidden
.userlogdom .userlogdom
width 600px width 600px
height 500px height 500px
margin 90px auto 0 margin 90px auto 0
.lgtitle .lgtitle
width 100% width 100%
text-align center text-align center
...@@ -153,20 +191,25 @@ ...@@ -153,20 +191,25 @@
font-size 28px font-size 28px
color #54daf8 color #54daf8
text-shadow 0 2px 2px #000 text-shadow 0 2px 2px #000
.PassAbout .PassAbout
width 250px width 250px
height 30px height 30px
margin 0 auto margin 0 auto
.MemoryPass .MemoryPass
float left float left
.ChangePass .ChangePass
float right float right
color #FFF color #FFF
a
a
color #FFF color #FFF
text-decoration none text-decoration none
&:hover &:hover
cursor pointer cursor pointer
color #FFF color #FFF
text-decoration underline text-decoration underline
</style> </style>
...@@ -2230,8 +2230,8 @@ ...@@ -2230,8 +2230,8 @@
_this.data_code.push(obj.code) _this.data_code.push(obj.code)
}else{ }else{
let NameTemp let NameTemp
NameTemp = item.YWSJ.substring(6, 7) + '月' ? NameTemp = item.YWSJ.substring(5, 7) + '月' ?
item.YWSJ.substring(6, 7) + '月' : item.YLJGDM_EX2.substring(6, 7) + '月' item.YWSJ.substring(5, 7) + '月' : item.YLJGDM_EX2.substring(5, 7) + '月'
_this.data_x.push(NameTemp) _this.data_x.push(NameTemp)
} }
item.zbxx.forEach((item2, index) => { item.zbxx.forEach((item2, index) => {
...@@ -2309,10 +2309,10 @@ ...@@ -2309,10 +2309,10 @@
let b = getActiveNum(_this.gxyseriesB_g[index] - _this.gxyseriesB_q[index]) let b = getActiveNum(_this.gxyseriesB_g[index] - _this.gxyseriesB_q[index])
obj.name = _this.data_x[index] obj.name = _this.data_x[index]
obj.code = _this.data_code[index] obj.code = _this.data_code[index]
obj.tag1 = getActiveNum(_this.gxyseriesE[index]) obj.tag1 = getActiveNum(_this.gxyseriesC[index])
obj.tag2 = getActiveNum(_this.gxyseriesF[index]) obj.tag2 = getActiveNum(_this.gxyseriesD[index])
obj.tag3 = getActiveNum(_this.gxyseriesC[index]) obj.tag3 = getActiveNum(_this.gxyseriesE[index])
obj.tag4 = getActiveNum(_this.gxyseriesD[index]) obj.tag4 = getActiveNum(_this.gxyseriesF[index])
obj.tag5 = getActiveNum(_this.gxyseriesG[index]) obj.tag5 = getActiveNum(_this.gxyseriesG[index])
obj.tag6 = getActiveNum(_this.gxyseriesH[index]) obj.tag6 = getActiveNum(_this.gxyseriesH[index])
_this.tableAll.push(obj) _this.tableAll.push(obj)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment