Browse Source

首次登录系统提示用户修改密码

master
yunuo970428 3 years ago
parent
commit
03329ec342
  1. 14
      anrui-system-ui/src/api/User/login.js
  2. 67
      anrui-system-ui/src/styles/el-form.scss
  3. 1
      anrui-system-ui/src/styles/index.scss
  4. 661
      anrui-system-ui/src/views/Home/Home.vue

14
anrui-system-ui/src/api/User/login.js

@ -9,13 +9,15 @@ class user {
data
})
}
logout(data) { // 退出
logout(data) { // 退出
return request({
url: '/portal/v1/sysuser/signOut',
method: 'post',
data: qs.stringify(data)
})
}
updatePassword(data) { // 退出修改密码
return request({
url: '/portal/v1/sysuser/updatePassword',
@ -23,14 +25,20 @@ class user {
data: qs.stringify(data)
})
}
reGetPwd(data){
reGetPwd(data) {
return request({
url: `/system/user/reGetPwd/${data.userName}/${data.userPhone}`,
method: 'post',
data: qs.stringify(data)
})
}
selectPasswordByUserSid(data) {
return request({
url: '/portal/v1/sysuser/selectPasswordByUserSid/' + data,
method: 'get'
})
}
}
export default new user()

67
anrui-system-ui/src/styles/el-form.scss

@ -0,0 +1,67 @@
.listconadd .title {
text-align: center;
font-size: 28px;
//line-height: 90px;
}
.listaddtop {
padding: 0 212px;
border-bottom: 2px solid #e0e3eb;
display: flex;
justify-content: space-between;
align-items: center;
line-height: 34px;
span {
padding: 0 15px;
}
}
.listconadd .demo-ruleForm {
padding: 22px 28px;
}
.el-collapse-item__header {
.el-icon-arrow-right:before {
content: "";
font-size: 20px;
}
}
.demo-ruleForm table {
width: 100%;
border-collapse: collapse;
border: 2px solid #e0e3eb;
border-spacing: 0;
//text-align: right;
td {
border-right: 2px solid #e0e3eb;
border-bottom: 2px solid #e0e3eb;
border-top: 2px solid #e0e3eb;
}
tr {
height: 40px;
}
.el-form-item {
display: inline-block;
}
.el-input {
display: inline-block;
}
}
.tleftb {
text-align: right;
font-size: 14px;
color: #606266;
line-height: 40px !important;
font-weight: 600;
}
.icon {
color: #e84026;
margin-right: 4px;
}

1
anrui-system-ui/src/styles/index.scss

@ -7,6 +7,7 @@
@import './e-table.scss';
@import './element-table.scss';
@import './element-tabs.scss';
@import './el-form.scss';
body {
height: 100%;
-moz-osx-font-smoothing: grayscale;

661
anrui-system-ui/src/views/Home/Home.vue

@ -3,9 +3,9 @@
<div class="header">
<p class="title"><img src="../../assets/loginImg/logo.png"/>安瑞集团信息化平台</p>
<div class="head_info">
<!-- <p>{{Orgname}},</p>-->
<!-- <p>{{Orgname}},</p>-->
<!--<p>{{$store.getters.userInfo.Orgname}}</p>-->
<p>欢迎您{{pNameAndDepartmentNameAndPostName}} {{ roleName }} {{name}}</p>
<p>欢迎您{{ pNameAndDepartmentNameAndPostName }} {{ roleName }} {{ name }}</p>
<!--<img src="@/assets/images/info.png" />-->
<p @click="logout()" class="dy"><img src="@/assets/images/dy.png"/></p>
</div>
@ -16,7 +16,7 @@
<ul class="grid-content bg-ltop">
<li @click="todowork">
<div style="position: relative">
<el-badge v-if="shuliang.workCount !== 0" :value="shuliang.workCount" size="mini" class="mark" />
<el-badge v-if="shuliang.workCount !== 0" :value="shuliang.workCount" size="mini" class="mark"/>
<img src="@/assets/home/ltIcon1.png">
</div>
<p>待办工作</p>
@ -72,7 +72,7 @@
<ul class="bg-bottom">
<li @click="toNav(index)" v-for="(item,index) in menus" :key='index'>
<img :src="item.imgUrl">
<p>{{item.title}}</p>
<p>{{ item.title }}</p>
</li>
</ul>
<p class="copy">Copyright © {{ year }} 安瑞集团 All Rights Reserved</p>
@ -162,342 +162,429 @@
<p>系统管理</p>
</li> -->
<!--</ul>-->
<el-dialog center :visible.sync="dialogVisible" width="40%" :show-close="false" :close-on-click-modal="false">
<el-form :model="form" class="formadd">
<el-row style="border-top: 1px solid #e0e3eb">
<el-col :span="4" class="tleftb">
<span>原密码</span>
</el-col>
<el-col :span="20">
<el-form-item><el-input v-model="form.original" type="password" show-password/></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>新密码</span>
</el-col>
<el-col :span="20">
<el-form-item><el-input v-model="form.password" type="password" show-password/></el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="4" class="tleftb">
<span>确认密码</span>
</el-col>
<el-col :span="20">
<el-form-item><el-input v-model="form.confirmPassword" type="password" show-password/></el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="handleConirm"> </el-button>
<el-button size="small" @click="handleQuXiao"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import {getToken, removeToken, getStorage, removeStorage} from '@/utils/auth'
import {sourcesofrole} from '@/api/system/Role/role.js'
import User from '@/api/User/login.js'
import { getTodoNum } from '@/api/system/home/home'
import { getToken, removeToken, getStorage, removeStorage } from '@/utils/auth'
import {sourcesofrole} from '@/api/system/Role/role.js'
import User from '@/api/User/login.js'
import { getTodoNum } from '@/api/system/home/home'
export default {
data() {
return {
menus: [{
imgUrl: require('@/assets/home/bIcon1.png'),
title: '业务管理'
}, {
imgUrl: require('@/assets/home/scm.png'),
title: '供应链管理'
}, {
imgUrl: require('@/assets/home/bIcon2.png'),
title: '风控管理'
}, {
imgUrl: require('@/assets/home/bIcon3.png'),
title: '审计管理'
}, {
imgUrl: require('@/assets/home/bIcon4.png'),
title: '财务管理'
}, {
imgUrl: require('@/assets/home/bIcon5.png'),
title: '行政管理'
}, {
imgUrl: require('@/assets/home/bIcon6.png'),
title: '报表中心'
}, {
imgUrl: require('@/assets/home/bIcon7.png'),
title: '基础信息'
}, {
imgUrl: require('@/assets/home/notice.png'),
title: '消息中心'
}, {
imgUrl: require('@/assets/home/bIcon8.png'),
title: '系统管理'
}],
userInfo: {},
shuliang: {
workCount: ''
},
timer: '',
Orgname: '',
departmentName: '',
name: '',
pNameAndDepartmentNameAndPostName: '',
roleName: '',
year: ''
}
},
beforeCreate() {
export default {
data() {
return {
menus: [{
imgUrl: require('@/assets/home/bIcon1.png'),
title: '业务管理'
}, {
imgUrl: require('@/assets/home/scm.png'),
title: '供应链管理'
}, {
imgUrl: require('@/assets/home/bIcon2.png'),
title: '风控管理'
}, {
imgUrl: require('@/assets/home/bIcon3.png'),
title: '审计管理'
}, {
imgUrl: require('@/assets/home/bIcon4.png'),
title: '财务管理'
}, {
imgUrl: require('@/assets/home/bIcon5.png'),
title: '行政管理'
}, {
imgUrl: require('@/assets/home/bIcon6.png'),
title: '报表中心'
}, {
imgUrl: require('@/assets/home/bIcon7.png'),
title: '基础信息'
}, {
imgUrl: require('@/assets/home/notice.png'),
title: '消息中心'
}, {
imgUrl: require('@/assets/home/bIcon8.png'),
title: '系统管理'
}],
userInfo: {},
shuliang: {
workCount: ''
},
dialogVisible: false,
form: {
original: '',
password: '',
confirmPassword: '',
userSid: ''
},
timer: '',
Orgname: '',
departmentName: '',
name: '',
pNameAndDepartmentNameAndPostName: '',
roleName: '',
year: ''
}
},
beforeCreate() {
},
created() {
this.getNum()
this.timer = setInterval(this.getNum, 20000)
},
mounted() {
this.Orgname = window.sessionStorage.getItem('Orgname')
this.departmentName = window.sessionStorage.getItem('departmentName')
this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('pNameAndDepartmentNameAndPostName')
this.roleName = window.sessionStorage.getItem('roleName')
this.name = window.sessionStorage.getItem('name')
var nowDate = new Date()
this.year = nowDate.getFullYear()
},
created() {
this.getsPasswordByUserSid()
},
mounted() {
this.Orgname = window.sessionStorage.getItem('Orgname')
this.departmentName = window.sessionStorage.getItem('departmentName')
this.pNameAndDepartmentNameAndPostName = window.sessionStorage.getItem('pNameAndDepartmentNameAndPostName')
this.roleName = window.sessionStorage.getItem('roleName')
this.name = window.sessionStorage.getItem('name')
var nowDate = new Date()
this.year = nowDate.getFullYear()
// sourcesofrole({ psid: '0', roleSid: this.$store.getters.userInfo.roleSid }).then(res => {
// this.menus = res.data
// })
},
methods: {
getsPasswordByUserSid() {
User.selectPasswordByUserSid(window.sessionStorage.getItem('userSid')).then((resp) => {
if (resp.success && resp.data) {
this.dialogVisible = true
} else {
this.getNum()
this.timer = setInterval(this.getNum, 20000)
}
})
},
methods: {
getNum() {
getTodoNum(window.sessionStorage.getItem('userSid')).then((resp) => {
if (resp.success) {
this.shuliang.workCount = resp.data
}
})
},
todowork() {
window.open('/#/todo' + '?token=' + getStorage(), '_blank')
// this.$router.push({ path: '/todo' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
donework() {
window.open('/#/done' + '?token=' + getStorage(), '_blank')
// this.$router.push({ path: '/done' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
logout() {
this.$confirm('确定要退出吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
User.logout({ token: getStorage() }).then(res => {
removeStorage()
this.$store.commit('user/SET_UESRINFO', '')
this.$router.push({ path: '/login' })
getNum() {
getTodoNum(window.sessionStorage.getItem('userSid')).then((resp) => {
if (resp.success) {
this.shuliang.workCount = resp.data
}
})
},
handleConirm() {
if (this.form.original === '') {
this.$message({ showClose: true, type: 'error', message: '原密码不能为空' })
return
}
if (this.form.password !== this.form.confirmPassword) {
this.$message({ showClose: true, type: 'error', message: '两次输入密码不一致' })
return
}
this.form.userSid = window.sessionStorage.getItem('userSid')
User.updatePassword(this.form).then((resp) => {
if (resp.success) {
const tip = '密码修改成功,请重新登录点击确定退出'
this.$confirm(tip, '提示', {
confirmButtonText: '确定',
type: 'warning'
}).then(() => {
this.handleQuXiao()
})
})
},
xxzx() {
this.$alert('项目正在开发中', '提示', {
dangerouslyUseHTMLString: true
})
},
toNavbar(name) {
let myPopup = window.open(name + '?token=' + getStorage(), '_blank')
},
toNav(index, name, titleName) {
if (index == '9') {
// this.$router.push({path: '/index'})
let myPopup = window.open('/#/index', '_blank')
} else if (index == '7') {
let myPopup = window.open('http://120.46.172.184/base/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '8') {
let myPopup = window.open('http://120.46.172.184/message/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '1') {
let myPopup = window.open('http://120.46.172.184/scm/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '4') {
let myPopup = window.open('http://120.46.172.184/fin/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '5') {
let myPopup = window.open('http://120.46.172.184/manage/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '0') {
let myPopup = window.open('http://120.46.172.184/buscenter/#/' + '?token=' + getStorage(), '_blank')
}
// const page = this.$router.resolve({name: name})
// window.open(page.href,'_blank')
})
},
handleQuXiao() {
this.dialogVisible = false
this.form = {
original: '',
password: '',
confirmPassword: ''
}
User.logout({ token: getStorage() }).then((res) => {
if (res.success) {
removeStorage()
this.$store.commit('user/SET_UESRINFO', '')
this.$router.push({ path: '/login' })
}
})
},
todowork() {
window.open('/#/todo' + '?token=' + getStorage(), '_blank')
// this.$router.push({ path: '/todo' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
donework() {
window.open('/#/done' + '?token=' + getStorage(), '_blank')
// this.$router.push({ path: '/done' + '?token=' + getStorage() })
// window.open('http://127.0.0.1/message'+'?token='+getStorage(),'_blank')
},
logout() {
this.$confirm('确定要退出吗, 是否继续?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
User.logout({token: getStorage()}).then(res => {
removeStorage()
this.$store.commit('user/SET_UESRINFO', '')
this.$router.push({ path: '/login' })
})
})
},
xxzx() {
this.$alert('项目正在开发中', '提示', {
dangerouslyUseHTMLString: true
})
},
toNavbar(name) {
let myPopup = window.open(name + '?token=' + getStorage(), '_blank')
},
beforeDestroy() {
clearInterval(this.timer)
toNav(index, name, titleName) {
if (index == '9') {
// this.$router.push({path: '/index'})
let myPopup = window.open('/#/index', '_blank')
} else if (index == '7') {
let myPopup = window.open('http://120.46.172.184/base/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '8') {
let myPopup = window.open('http://120.46.172.184/message/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '1') {
let myPopup = window.open('http://120.46.172.184/scm/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '4') {
let myPopup = window.open('http://120.46.172.184/fin/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '5') {
let myPopup = window.open('http://120.46.172.184/manage/#/' + '?token=' + getStorage(), '_blank')
} else if (index == '0') {
let myPopup = window.open('http://120.46.172.184/buscenter/#/' + '?token=' + getStorage(), '_blank')
}
// const page = this.$router.resolve({name: name})
// window.open(page.href,'_blank')
}
},
beforeDestroy() {
clearInterval(this.timer)
}
}
</script>
<style scoped="scoped">
li:hover,
p:hover {
cursor: pointer
}
li:hover,
p:hover {
cursor: pointer
}
</style>
<style lang="scss" scoped>
p {
margin: 0;
padding: 0;
}
p {
margin: 0;
padding: 0;
}
.header {
background-color: #0294d7;
color: #fff;
overflow: hidden;
height: 60px;
line-height: 60px;
.title {
img {
width: 70px;
vertical-align: middle;
font-family: Adobe Heiti Std;
}
.header {
background-color: #0294d7;
color: #fff;
overflow: hidden;
height: 60px;
line-height: 60px;
float: left;
font-size: 34px;
margin-left: 35px;
height: 60px;
line-height: 60px;
.title {
img {
width: 70px;
vertical-align: middle;
font-family: Adobe Heiti Std;
}
.head_info {
float: right;
margin-top: 0;
font-size: 17px;
}
float: left;
font-size: 34px;
margin-left: 35px;
height: 60px;
line-height: 60px;
}
p {
float: left;
}
.head_info {
float: right;
margin-top: 0;
font-size: 17px;
}
.head_info img {
width: 25px;
margin-top: 20px;
margin-left: 30px;
margin-right: 10px;
p {
float: left;
}
}
.head_info .dy {
margin-left: 10px;
margin-right: 20px;
}
.head_info img {
width: 25px;
margin-top: 20px;
margin-left: 30px;
margin-right: 10px;
float: left;
}
.container1 {
background: #E9F1F7;
padding: 20px;
width: 100%;
height: calc(100% - 60px);
margin: 0;
.head_info .dy {
margin-left: 10px;
margin-right: 20px;
}
.bg-ltop {
margin: 0;
padding: 0 20px;
background-image: url(../../assets/home/ltBg.png);
border-radius: 10px;
overflow: hidden;
height: 190px;
.container1 {
background: #E9F1F7;
padding: 20px;
width: 100%;
height: calc(100% - 60px);
margin: 0;
li {
float: left;
list-style: none;
width: 25%;
text-align: center;
.bg-ltop {
margin: 0;
padding: 0 20px;
background-image: url(../../assets/home/ltBg.png);
border-radius: 10px;
overflow: hidden;
height: 190px;
img {
width: 70px;
margin: 45px auto 10px auto;
}
li {
float: left;
list-style: none;
width: 25%;
text-align: center;
img {
width: 70px;
margin: 45px auto 10px auto;
}
}
}
.bg-rtop {
background-image: url(../../assets/home/rtBg.png);
border-radius: 10px;
height: 190px;
overflow: hidden;
position: relative;
.bg-rtop {
background-image: url(../../assets/home/rtBg.png);
border-radius: 10px;
height: 190px;
overflow: hidden;
position: relative;
.anrui {
width: 100%;
height: 40px;
}
.anrui {
width: 100%;
height: 40px;
}
.rt_title {
position: absolute;
top: 10px;
left: 15px;
font-size: 18px;
font-family: SourceHanSerifCN;
font-weight: 600;
color: #191919;
}
.rt_title {
position: absolute;
top: 10px;
left: 15px;
font-size: 18px;
font-family: SourceHanSerifCN;
font-weight: 600;
color: #191919;
}
ul {
margin: 0px auto;
padding: 0;
height: 148px;
width: 100%;
ul {
margin: 0px auto;
padding: 0;
height: 148px;
width: 100%;
li {
font-size: 14px;
height: 33px;
line-height: 28px;
list-style: none;
text-decoration: underline;
border-bottom: 1px solid #666;
width: calc(100% - 70px);
margin-left: 40px;
position: relative;
padding-top: 10px;
font-family: SimSun;
li {
font-size: 14px;
height: 33px;
line-height: 28px;
list-style: none;
text-decoration: underline;
border-bottom: 1px solid #666;
width: calc(100% - 70px);
margin-left: 40px;
position: relative;
padding-top: 10px;
font-family: SimSun;
img {
width: 16px;
margin: 5px 10px;
position: absolute;
left: -30px;
}
img {
width: 16px;
margin: 5px 10px;
position: absolute;
left: -30px;
}
.notice {
display: inline-block;
width: 65%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.notice {
display: inline-block;
width: 65%;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
}
.anrui_time {
float: right;
display: inline-block;
margin-right: 5px;
line-height: 30px;
}
.anrui_time {
float: right;
display: inline-block;
margin-right: 5px;
line-height: 30px;
}
}
}
}
.bg-bottom {
background-image: url(../../assets/home/bottomBg.png);
border-radius: 10px;
overflow: hidden;
margin: 20px 0 0 0;
padding: 10px 20px;
.bg-bottom {
background-image: url(../../assets/home/bottomBg.png);
border-radius: 10px;
overflow: hidden;
margin: 20px 0 0 0;
padding: 10px 20px;
li {
float: left;
list-style: none;
width: 11.6%;
margin: 10px 2.5%;
background: #fff;
border-radius: 40px;
text-align: center;
padding: 10px 25px 15px;
li {
float: left;
list-style: none;
width: 11.6%;
margin: 10px 2.5%;
background: #fff;
border-radius: 40px;
text-align: center;
padding: 10px 25px 15px;
img {
width: 80%;
margin: 10px auto;
}
img {
width: 80%;
margin: 10px auto;
}
}
}
}
.copy {
position: fixed;
bottom: 0;
width: calc(100% - 40px);
margin: auto;
text-align: center;
line-height: 40px;
border-top: 2px solid #4E74A6;
background: #E9F1F7;
font-size: 14px;
color: #666;
}
.mark {
position: absolute;
top: 38%;
margin-left: 58px;
}
.mark {
::v-deep .el-badge__content {
font-size: 14px !important;
}
.copy {
position: fixed;
bottom: 0;
width: calc(100% - 40px);
margin: auto;
text-align: center;
line-height: 40px;
border-top: 2px solid #4E74A6;
background: #E9F1F7;
font-size: 14px;
color: #666;
}
.mark {
position: absolute;
top: 38%;
margin-left: 58px;
}
.mark {
::v-deep .el-badge__content {
font-size: 14px !important;
}
}
</style>

Loading…
Cancel
Save