Commit 80795587 authored by caimeng's avatar caimeng

新增修改密码页面

parent 91e2a421
...@@ -86,25 +86,56 @@ ...@@ -86,25 +86,56 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
}
} }
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -91,25 +91,57 @@ ...@@ -91,25 +91,57 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥')
arr.push(o[1]) xcxSupplAttachInfo
}) } = this.info
let imgArray = [];
const {values} = Object;
// 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
if(val) imgArray.push(val)
}
}
console.log(arr, '预览图片的地址') // 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = arr // 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
break // 补充图片
default: if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
this.imgList = item xcxSupplAttachInfo.forEach(item=>{
break imgArray = imgArray.concat(item.screenList)
})
} }
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -89,25 +89,56 @@ ...@@ -89,25 +89,56 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
}
} }
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -88,25 +88,56 @@ ...@@ -88,25 +88,56 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
}
} }
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -88,25 +88,56 @@ ...@@ -88,25 +88,56 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
}
} }
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -90,25 +90,56 @@ ...@@ -90,25 +90,56 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
}
} }
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
e.preventDefault() e.preventDefault()
......
...@@ -189,24 +189,76 @@ ...@@ -189,24 +189,76 @@
methods: { methods: {
showImgViewer(item, type) { showImgViewer(item, type) {
switch (type) { const {
case 'idCard': clientIdCardInfoResponse,
case 'face': creditAttachInfo,
const arr = [] faceInfoResponse,
item.forEach(o => { supplAttachInfo,
console.log(o, '是啥') xcxSupplAttachInfo
arr.push(o[1]) } = this.info
})
console.log(arr, '预览图片的地址') let imgArray = [];
const {values} = Object;
this.imgList = arr // 客户身份证
if(clientIdCardInfoResponse){
for(let val of values(clientIdCardInfoResponse)){
if(val) imgArray.push(val)
}
}
break // 活体
default: if(faceInfoResponse){
this.imgList = item for(let val of values(faceInfoResponse)){
break if(val) imgArray.push(val)
} }
}
// 授信图片
if(creditAttachInfo && creditAttachInfo.length){
creditAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 附件图片
if(supplAttachInfo && supplAttachInfo.length){
supplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
//this.data = this.info
//switch (type) {
// case 'idCard':
// case 'face':
// const arr = []
// item.forEach(o => {
// console.log(o, '是啥')
// arr.push(o[1])
// })
//
// console.log(arr, '预览图片的地址')
//
// this.imgList = arr
//
// break
// default:
// this.imgList = item
// break
//}
this.imgViewerVisible = true this.imgViewerVisible = true
const m = (e) => { const m = (e) => {
......
...@@ -82,7 +82,18 @@ export const asyncRoutes = [ ...@@ -82,7 +82,18 @@ export const asyncRoutes = [
title: '首页', title: '首页',
affix: true affix: true
} }
} },
{
path: '/editPwd',
name: 'Index',
component: () => import('@/views/password/edit'),
meta: {
noKeepAlive: true,
title: '修改密码',
affix: false
},
hidden: true
},
] ]
}, },
{ {
......
...@@ -26,6 +26,14 @@ export default { ...@@ -26,6 +26,14 @@ export default {
params params
}) })
}, },
// 用户信息
updatePwd(data) {
return request({
url: '/user/updatePassword',
method: 'post',
data
})
},
// 发送验证码 // 发送验证码
send_msg_code(data) { send_msg_code(data) {
return request({ return request({
......
/** /**
* @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用 * @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用
*/ */
import { asyncRoutes, constantRoutes } from "@/router"; import { asyncRoutes, constantRoutes } from '@/router'
import { getRouterList } from "@/api/router"; import { getRouterList } from '@/api/router'
import { convertRouter, filterRoutes } from "@/utils/routes"; import { convertRouter, filterRoutes } from '@/utils/routes'
import API from "@/server/api"; import API from '@/server/api'
import Layout from "@/vab/layouts"; import Layout from '@/vab/layouts'
const state = { routes: [], partialRoutes: [] }; const state = { routes: [], partialRoutes: [] }
const getters = { const getters = {
routes: (state) => state.routes, routes: (state) => state.routes,
partialRoutes: (state) => state.partialRoutes partialRoutes: (state) => state.partialRoutes
}; }
const mutations = { const mutations = {
setRoutes(state, routes) { setRoutes(state, routes) {
state.routes = routes; state.routes = routes
}, },
setPartialRoutes(state, routes) { setPartialRoutes(state, routes) {
state.partialRoutes = routes; state.partialRoutes = routes
} }
}; }
const actions = { const actions = {
async setRoutes({ commit }, mode) { async setRoutes({ commit }, mode) {
let routes = asyncRoutes; let routes = asyncRoutes
console.log(mode,'路由模式'); console.log(mode, '路由模式')
if (mode === "all") { if (mode === 'all' && process.env.NODE_ENV !== 'development') {
//let data = [ //let data = [
// { // {
// path: '/', // path: '/',
...@@ -68,19 +68,18 @@ const actions = { ...@@ -68,19 +68,18 @@ const actions = {
// ] // ]
// } // }
//]; //];
let { result } = await API.userInfo(); let { result } = await API.userInfo()
const data = result.menuList; const data = result.menuList
//console.log(data,'wori')
if (data[data.length - 1].path !== "*"){ if (data[data.length - 1].path !== '*') {
data.push({ path: "*", redirect: "/404", hidden: true }); data.push({ path: '*', redirect: '/404', hidden: true })
} }
routes = convertRouter(data); routes = convertRouter(data)
} }
const finallyRoutes = filterRoutes([...constantRoutes, ...routes]); const finallyRoutes = filterRoutes([...constantRoutes, ...routes])
commit("setRoutes", finallyRoutes); commit('setRoutes', finallyRoutes)
return [...routes]; return [...routes]
}, },
/** /**
* @description 画廊布局、综合布局设置路由 * @description 画廊布局、综合布局设置路由
...@@ -88,7 +87,7 @@ const actions = { ...@@ -88,7 +87,7 @@ const actions = {
* @param accessedRoutes 画廊布局、综合布局设置路由 * @param accessedRoutes 画廊布局、综合布局设置路由
*/ */
setPartialRoutes({ commit }, accessedRoutes) { setPartialRoutes({ commit }, accessedRoutes) {
commit("setPartialRoutes", accessedRoutes); commit('setPartialRoutes', accessedRoutes)
} }
}; }
export default { state, getters, mutations, actions }; export default { state, getters, mutations, actions }
<template> <template>
<el-dropdown @command="handleCommand"> <el-dropdown @command='handleCommand'>
<span class="avatar-dropdown"> <span class='avatar-dropdown'>
<img :src="avatar" alt="" class="user-avatar" /> <img :src='avatar' alt='' class='user-avatar' />
<div class="user-name"> <div class='user-name'>
{{ username }} {{ username }}
<vab-remix-icon icon-class="arrow-down-s-line" /> <vab-remix-icon icon-class='arrow-down-s-line' />
</div> </div>
</span> </span>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot='dropdown'>
<el-dropdown-item command="logout"> <el-dropdown-item command='logout'>
<vab-remix-icon icon-class="logout-circle-r-line" /> <vab-remix-icon icon-class='logout-circle-r-line' />
{{ translateTitle('退出登录') }} {{ translateTitle('退出登录') }}
</el-dropdown-item> </el-dropdown-item>
<el-dropdown-item command='editPwd'>
<vab-remix-icon icon-class='lock-password-line' />
<span>修改密码</span>
</el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</template> </template>
...@@ -27,15 +31,15 @@ ...@@ -27,15 +31,15 @@
computed: { computed: {
...mapGetters({ ...mapGetters({
avatar: 'user/avatar', avatar: 'user/avatar',
username: 'user/username', username: 'user/username'
}), })
}, },
created() { created() {
this.initSearchData() this.initSearchData()
}, },
methods: { methods: {
async initSearchData() { async initSearchData() {
await this.$store.dispatch('common/GetSearchData'); await this.$store.dispatch('common/GetSearchData')
}, },
translateTitle, translateTitle,
handleCommand(command) { handleCommand(command) {
...@@ -43,6 +47,9 @@ ...@@ -43,6 +47,9 @@
case 'logout': case 'logout':
this.logout() this.logout()
break break
case 'editPwd':
this.editPwd()
break
case 'personalCenter': case 'personalCenter':
this.personalCenter() this.personalCenter()
break break
...@@ -52,7 +59,7 @@ ...@@ -52,7 +59,7 @@
this.$router.push('/personalCenter/personalCenter') this.$router.push('/personalCenter/personalCenter')
}, },
async logout() { async logout() {
await this.$store.dispatch('user/logout'); await this.$store.dispatch('user/logout')
if (recordRoute) { if (recordRoute) {
const fullPath = this.$route.fullPath const fullPath = this.$route.fullPath
await this.$router.push(`/login?redirect=${fullPath}`) await this.$router.push(`/login?redirect=${fullPath}`)
...@@ -60,10 +67,15 @@ ...@@ -60,10 +67,15 @@
await this.$router.push('/login') await this.$router.push('/login')
} }
}, },
}, async editPwd() {
await this.$router.push({
path: '/editPwd'
})
}
}
} }
</script> </script>
<style lang="scss" scoped> <style lang='scss' scoped>
.avatar-dropdown { .avatar-dropdown {
display: flex; display: flex;
align-content: center; align-content: center;
......
...@@ -14,11 +14,11 @@ ...@@ -14,11 +14,11 @@
<el-input v-model='queryForm.mobile' clearable placeholder='请输入客户手机号码' /> <el-input v-model='queryForm.mobile' clearable placeholder='请输入客户手机号码' />
</el-form-item> </el-form-item>
<el-form-item v-if='searchData!==null' prop='preStatus' label='授信状态'> <el-form-item v-if='searchData!==null' prop='preStatus' label='授信状态'>
<el-select :popper-append-to-body='false' v-model='queryForm.preStatus' clearable placeholder='请选择授信状态'> <el-select v-model='queryForm.preStatus' :popper-append-to-body='false' clearable placeholder='请选择授信状态'>
<el-option <el-option
v-for='(item,index) in searchData.preStatusList' v-for='(item,index) in searchData.preStatusList'
:label='item.preStatusStr'
:key='index' :key='index'
:label='item.preStatusStr'
:value='item.preStatus'></el-option> :value='item.preStatus'></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
...@@ -92,10 +92,12 @@ ...@@ -92,10 +92,12 @@
<!-- 分页 --> <!-- 分页 -->
<el-pagination <el-pagination
:current-page='queryForm.current' :current-page='queryForm.current'
layout='total, prev, pager, next' layout='total,sizes, prev, pager, next'
:page-sizes='[10,20,30,40,50,100]'
background
:page-size='queryForm.size' :page-size='queryForm.size'
:total='total' :total='total'
background @size-change='handleSizeChange'
@current-change='handleCurrentChange' @current-change='handleCurrentChange'
/> />
...@@ -233,6 +235,11 @@ ...@@ -233,6 +235,11 @@
this.queryForm.current = val this.queryForm.current = val
this.fetchData() this.fetchData()
}, },
// 页码变更
handleSizeChange(val) {
this.queryForm.size = val
this.fetchData()
},
async fetchData() { async fetchData() {
this.listLoading = true this.listLoading = true
const form = this.queryForm const form = this.queryForm
......
...@@ -124,7 +124,9 @@ ...@@ -124,7 +124,9 @@
<el-pagination <el-pagination
:current-page='queryForm.current' :current-page='queryForm.current'
layout='total, prev, pager, next' layout='total,sizes, prev, pager, next'
:page-sizes='[10,20,30,40,50,100]'
@size-change='handleSizeChange'
:page-size='queryForm.size' :page-size='queryForm.size'
:total='total' :total='total'
background background
...@@ -336,10 +338,16 @@ ...@@ -336,10 +338,16 @@
console.log(row, type) console.log(row, type)
}, },
// 页码变更
handleCurrentChange(val) { handleCurrentChange(val) {
this.queryForm.current = val this.queryForm.current = val
this.fetchData() this.fetchData()
}, },
// 页码变更
handleSizeChange(val) {
this.queryForm.size = val
this.fetchData()
},
async fetchData() { async fetchData() {
this.listLoading = true this.listLoading = true
const form = this.queryForm const form = this.queryForm
......
<template>
<div class='page'>
<block-header title='修改密码' />
<el-row>
<el-col :span='12'>
<el-form ref='form' :model='form' :rules='rules' label-width='100px' label-suffix=':'>
<el-form-item prop='oldPassword' label='原密码'>
<el-input v-model='form.oldPassword' show-password clearable placeholder='请输入' />
</el-form-item>
<el-form-item prop='newPassword' label='新密码'>
<el-input v-model='form.newPassword' show-password clearable placeholder='请输入' />
</el-form-item>
<el-form-item prop='confirmPassword' label='确认密码'>
<el-input v-model='form.confirmPassword' show-password clearable placeholder='请输入' />
</el-form-item>
<el-form-item>
<el-button type='primary' @click='handleSubmit("form")'>确 定</el-button>
<el-button @click='handleCancel'>取 消</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
</div>
</template>
<script>
import API from '@/server/api'
import { mapGetters } from 'vuex'
import { isPassword } from '@/utils/validate'
import _ from 'lodash'
import { recordRoute } from '@/config'
export default {
name: 'EditPassword',
data() {
return {
form: {
oldPassword: '',
newPassword: '',
confirmPassword: '',
loginName: '',
userId: ''
},
rules: {
oldPassword: [
{
required: true,
trigger: 'blur',
message: '请输入原密码'
}
],
newPassword: [
{
required: true,
trigger: 'blur',
message: '请输入新密码'
}
],
confirmPassword: [
{
required: true,
trigger: 'blur',
message: '请再次输入新密码'
},
{
validator: (rule, value, callback) => {
const newPwd = this.form.newPassword
if (_.trim(newPwd) !== _.trim(value)) {
callback(new Error('两次输入的密码不一致'))
} else {
callback()
}
},
trigger: 'blur'
}
]
}
}
},
computed: {
...mapGetters(['user'])
},
methods: {
handleSubmit(formName) {
// 提交
this.$refs[formName].validate(async (valid) => {
if (valid) {
const { loginName, userId } = this.user
this.form.loginName = loginName
this.form.userId = userId
const form = this.form
const res = await API.updatePwd({
...form
})
if (res.success) {
this.$message.success(res.message)
setTimeout(async () => {
await this.$store.dispatch('user/logout')
await this.$router.push('/login')
}, 1500)
}
}
})
},
handleCancel() {
this.$router.back()
}
}
}
</script>
<style>
</style>
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