Commit 80795587 authored by caimeng's avatar caimeng

新增修改密码页面

parent 91e2a421
......@@ -86,25 +86,56 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
e.preventDefault()
......
......@@ -91,25 +91,57 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
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:
this.imgList = item
break
// 补充图片
if(xcxSupplAttachInfo && xcxSupplAttachInfo.length){
xcxSupplAttachInfo.forEach(item=>{
imgArray = imgArray.concat(item.screenList)
})
}
this.imgList = imgArray;
this.imgViewerVisible = true
const m = (e) => {
e.preventDefault()
......
......@@ -89,25 +89,56 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
e.preventDefault()
......
......@@ -88,25 +88,56 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
e.preventDefault()
......
......@@ -88,25 +88,56 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
e.preventDefault()
......
......@@ -90,25 +90,56 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
e.preventDefault()
......
......@@ -189,24 +189,76 @@
methods: {
showImgViewer(item, type) {
switch (type) {
case 'idCard':
case 'face':
const arr = []
item.forEach(o => {
console.log(o, '是啥')
arr.push(o[1])
})
const {
clientIdCardInfoResponse,
creditAttachInfo,
faceInfoResponse,
supplAttachInfo,
xcxSupplAttachInfo
} = 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:
this.imgList = item
break
// 活体
if(faceInfoResponse){
for(let val of values(faceInfoResponse)){
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
const m = (e) => {
......
......@@ -82,7 +82,18 @@ export const asyncRoutes = [
title: '首页',
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 {
params
})
},
// 用户信息
updatePwd(data) {
return request({
url: '/user/updatePassword',
method: 'post',
data
})
},
// 发送验证码
send_msg_code(data) {
return request({
......
/**
* @description 路由拦截状态管理,目前两种模式:all模式与intelligence模式,其中partialRoutes是菜单暂未使用
*/
import { asyncRoutes, constantRoutes } from "@/router";
import { getRouterList } from "@/api/router";
import { convertRouter, filterRoutes } from "@/utils/routes";
import API from "@/server/api";
import Layout from "@/vab/layouts";
import { asyncRoutes, constantRoutes } from '@/router'
import { getRouterList } from '@/api/router'
import { convertRouter, filterRoutes } from '@/utils/routes'
import API from '@/server/api'
import Layout from '@/vab/layouts'
const state = { routes: [], partialRoutes: [] };
const state = { routes: [], partialRoutes: [] }
const getters = {
routes: (state) => state.routes,
partialRoutes: (state) => state.partialRoutes
};
}
const mutations = {
setRoutes(state, routes) {
state.routes = routes;
state.routes = routes
},
setPartialRoutes(state, routes) {
state.partialRoutes = routes;
state.partialRoutes = routes
}
};
}
const actions = {
async setRoutes({ commit }, mode) {
let routes = asyncRoutes;
console.log(mode,'路由模式');
if (mode === "all") {
let routes = asyncRoutes
console.log(mode, '路由模式')
if (mode === 'all' && process.env.NODE_ENV !== 'development') {
//let data = [
// {
// path: '/',
......@@ -68,19 +68,18 @@ const actions = {
// ]
// }
//];
let { result } = await API.userInfo();
const data = result.menuList;
let { result } = await API.userInfo()
const data = result.menuList
//console.log(data,'wori')
if (data[data.length - 1].path !== "*"){
data.push({ path: "*", redirect: "/404", hidden: true });
if (data[data.length - 1].path !== '*') {
data.push({ path: '*', redirect: '/404', hidden: true })
}
routes = convertRouter(data);
routes = convertRouter(data)
}
const finallyRoutes = filterRoutes([...constantRoutes, ...routes]);
commit("setRoutes", finallyRoutes);
return [...routes];
const finallyRoutes = filterRoutes([...constantRoutes, ...routes])
commit('setRoutes', finallyRoutes)
return [...routes]
},
/**
* @description 画廊布局、综合布局设置路由
......@@ -88,7 +87,7 @@ const actions = {
* @param accessedRoutes 画廊布局、综合布局设置路由
*/
setPartialRoutes({ commit }, accessedRoutes) {
commit("setPartialRoutes", accessedRoutes);
commit('setPartialRoutes', accessedRoutes)
}
};
export default { state, getters, mutations, actions };
}
export default { state, getters, mutations, actions }
<template>
<el-dropdown @command="handleCommand">
<span class="avatar-dropdown">
<img :src="avatar" alt="" class="user-avatar" />
<div class="user-name">
<el-dropdown @command='handleCommand'>
<span class='avatar-dropdown'>
<img :src='avatar' alt='' class='user-avatar' />
<div class='user-name'>
{{ username }}
<vab-remix-icon icon-class="arrow-down-s-line" />
<vab-remix-icon icon-class='arrow-down-s-line' />
</div>
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item command="logout">
<vab-remix-icon icon-class="logout-circle-r-line" />
<el-dropdown-menu slot='dropdown'>
<el-dropdown-item command='logout'>
<vab-remix-icon icon-class='logout-circle-r-line' />
{{ translateTitle('退出登录') }}
</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>
</template>
......@@ -27,15 +31,15 @@
computed: {
...mapGetters({
avatar: 'user/avatar',
username: 'user/username',
}),
username: 'user/username'
})
},
created() {
this.initSearchData()
},
methods: {
async initSearchData() {
await this.$store.dispatch('common/GetSearchData');
await this.$store.dispatch('common/GetSearchData')
},
translateTitle,
handleCommand(command) {
......@@ -43,6 +47,9 @@
case 'logout':
this.logout()
break
case 'editPwd':
this.editPwd()
break
case 'personalCenter':
this.personalCenter()
break
......@@ -52,7 +59,7 @@
this.$router.push('/personalCenter/personalCenter')
},
async logout() {
await this.$store.dispatch('user/logout');
await this.$store.dispatch('user/logout')
if (recordRoute) {
const fullPath = this.$route.fullPath
await this.$router.push(`/login?redirect=${fullPath}`)
......@@ -60,10 +67,15 @@
await this.$router.push('/login')
}
},
},
async editPwd() {
await this.$router.push({
path: '/editPwd'
})
}
}
}
</script>
<style lang="scss" scoped>
<style lang='scss' scoped>
.avatar-dropdown {
display: flex;
align-content: center;
......
......@@ -14,11 +14,11 @@
<el-input v-model='queryForm.mobile' clearable placeholder='请输入客户手机号码' />
</el-form-item>
<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
v-for='(item,index) in searchData.preStatusList'
:label='item.preStatusStr'
:key='index'
:label='item.preStatusStr'
:value='item.preStatus'></el-option>
</el-select>
</el-form-item>
......@@ -92,10 +92,12 @@
<!-- 分页 -->
<el-pagination
: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'
:total='total'
background
@size-change='handleSizeChange'
@current-change='handleCurrentChange'
/>
......@@ -233,6 +235,11 @@
this.queryForm.current = val
this.fetchData()
},
// 页码变更
handleSizeChange(val) {
this.queryForm.size = val
this.fetchData()
},
async fetchData() {
this.listLoading = true
const form = this.queryForm
......
......@@ -124,7 +124,9 @@
<el-pagination
: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'
:total='total'
background
......@@ -336,10 +338,16 @@
console.log(row, type)
},
// 页码变更
handleCurrentChange(val) {
this.queryForm.current = val
this.fetchData()
},
// 页码变更
handleSizeChange(val) {
this.queryForm.size = val
this.fetchData()
},
async fetchData() {
this.listLoading = true
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