修改问题

master
sunzehua 12 months ago
parent 9fab9f4b6a
commit 3f1bd00ae8

@ -102,6 +102,10 @@ const user = {
reject(response.message)
return
}
if (response.needPassWord) {
reject(response)
return
}
const result = response.data
Vue.ls.set(ACCESS_TOKEN, result, 7 * 24 * 60 * 60 * 1000)
commit('SET_TOKEN', result)

@ -79,6 +79,9 @@ service.interceptors.response.use(response => {
message.error(response.data.message)
return response.data
} else {
if (response.headers['need-modify-password']) {
response.data.needPassWord = true
}
return response.data
}
}, err)

@ -488,28 +488,18 @@ export default {
console.log('首次搜索内容', e, this.type, this.bookingInitData)
if (this.type === 'forwarder') {
this.inLoading = true
const arr = []
this.selectList = []
setTimeout(() => {
if (this.agentFilter.length === 0) {
setTimeout(() => {
this.inLoading = false
this.selectList = this.bookingInitData[`${this.type}InitList`]
}, 100);
if (this.agentFilter.length === 0) {
this.inLoading = false
this.selectList = this.bookingInitData[`${this.type}InitList`]
} else {
this.agentFilter.forEach(item => {
this.bookingInitData[`${this.type}InitList`].forEach(ite => {
if (ite.codeName == item.agentCode) {
arr.push(ite)
}
})
})
setTimeout(() => {
this.inLoading = false
this.selectList = arr
}, 100);
this.agentFilter.forEach(item => {
item.shortName = item.agent
item.codeName = item.agentCode
})
this.selectList = this.agentFilter
}, 500);
}
}, 900);
return false
}
if (

@ -76,8 +76,7 @@
<div class="nav">
<a-dropdown>
<span>
<i
class="iconfont icon-bianjiwenjian"></i>批量操作
<i class="iconfont icon-bianjiwenjian"></i>批量操作
</span>
<a-menu slot="overlay">
<a-menu-item>
@ -344,6 +343,18 @@
</span>
</div>
</template>
<template #txxp="{ row }">
<div style="display: flex;align-items: center;">
<span style="margin-right: 10px;cursor: pointer;color: #36cfc9;" class="iconfont icon-dayinxiaopiao" @click="TxxpLink(row)"></span>
<div v-if="row.extendState" style="display: flex;align-items: center;">
<div>
<div>{{ row.extendState.txxpBeginTime.substring(0,16) }}</div>
<div>{{ row.extendState.txxpEndTime.substring(0,16) }}</div>
</div>
<div v-if="row.extendState.txxpPdfUrl" @click="handleLookPdf(row)" style="cursor: pointer;color: #36cfc9;margin-left:10px;"></div>
</div>
</div>
</template>
<template #lstShipOrderCompareRlt="{ row }">
<div class="goods-status">
<a-popover>
@ -1212,6 +1223,9 @@
</a-form-item>
</a-form>
</a-modal>
<a-modal title="提箱小票" width="900px" :visible="txxpUrlFlag" :footer="null" @cancel="txxpUrlFlag = false">
<iframe :src="txxpUrl" width="800" height="600" frameborder="0"></iframe>
</a-modal>
<a-modal :title="webDataTitle" width="1400px" :visible="webDataFlag" :footer="null" @cancel="webDataFlag = false">
<iframe frameborder="0" height="700px" style="width: 100%;" :srcdoc="webData">
<!-- <div v-html="webData" style="overflow: hidden;"></div> -->
@ -1235,7 +1249,7 @@
<a-select-option value="YFD1">已放单-取消</a-select-option>
</a-select>
<a-button type="primary" @click="handleSubimtServe"></a-button>
<a-icon style="margin-left: 20px;" @click="serviceFlag=false" type="close" />
<a-icon style="margin-left: 20px;" @click="serviceFlag = false" type="close" />
</div>
</a-spin>
</div>
@ -1282,7 +1296,8 @@ import {
GetWebData,
CancelServiceStatusByList,
SaveServiceStatusByList,
BachUpdateShipagency
BachUpdateShipagency,
TxxpLink
} from '@/api/modular/main/BookingLedger'
import initData from './modules/initData'
@ -1406,6 +1421,8 @@ export default {
goodStatusShow: false,
goodStatusScreenX: 0,
goodStatusScreenY: 0,
txxpUrl: '',
txxpUrlFlag: false,
goodStatusData: null,
goodStatusSeat: 'bottom',
editingForm: this.$form.createForm(this),
@ -2372,7 +2389,9 @@ export default {
console.log('页码设置成功')
})
},
handleLookPdf(row) {
window.open(row.extendState.txxpPdfUrl);
},
toggleAdvanced() {
this.advanced = !this.advanced
this.$forceUpdate()
@ -2452,6 +2471,19 @@ export default {
})
}
},
TxxpLink(row) {
TxxpLink(row.id)
.then(res => {
if (res.success) {
window.open(res.data);
} else {
this.$message.error(res.message)
}
})
.catch(err => {
console.log(err)
})
},
handleSearchTxxp() {
const select = this.$refs.xGrid.getCheckboxRecords()
const pkIdArr = select.map((item, index) => {
@ -4404,7 +4436,8 @@ export default {
.vxe-table--render-default {
color: black;
}
.fangdan-modal{
.fangdan-modal {
position: fixed;
top: 100px;
left: 36%;

@ -508,6 +508,14 @@ export default {
showHeaderOverflow: true,
slots: { default: 'fangdan' }
},
{
field: 'txxp',
label: 'txxp',
width: 190,
title: '提箱小票',
showHeaderOverflow: true,
slots: { default: 'txxp' }
},
{ field: 'startETA', label: 'startETA', width: 120, title: '起始港ETA', showHeaderOverflow: true, sortable: true },
{ field: 'startATA', label: 'startATA', width: 120, title: '起始港ATA', showHeaderOverflow: true, sortable: true }
],

@ -105,7 +105,7 @@
@search="handleSearch"
v-model="form.agentCode"
style="width: 200px">
<a-select-option v-for="(item, index) in agentList" :key="index" :value="item.codeName">{{item.shortName }}</a-select-option>
<a-select-option v-for="(item, index) in agentList" :key="index" :value="item.codeName">{{ item.shortName }}</a-select-option>
</a-select>
</a-spin>
</div>
@ -188,7 +188,7 @@ export default {
},
mounted() {
this.getList()
DjyCustomerSuggest({ keyword: '' }).then(res => {
DjyCustomerSuggest({ keyword: '', type: 'booking_agent' }).then(res => {
this.agentList = res.data.rows
})
},
@ -199,7 +199,7 @@ export default {
this.getList()
},
handleSearch(e) {
DjyCustomerSuggest({ keyword: e }).then(res => {
DjyCustomerSuggest({ keyword: e, type: 'booking_agent' }).then(res => {
this.agentList = res.data.rows
})
},

@ -10,109 +10,111 @@
<a-input
placeholder="请输入原密码"
type="password"
v-decorator="['password', {rules: [{required: true, message: '请输入原密码!'}]}]" />
v-decorator="['password', { rules: [{ required: true, message: '请输入原密码!' }] }]" />
</a-form-item>
<a-form-item label="新密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入新密码"
type="password"
v-decorator="['newPassword', {rules: [{required: true, min: 5, message: '请输入至少五个字符的账号!'},{
validator: validateToNextPassword,
},]}]" />
v-decorator="['newPassword', {rules: [{required: true, message: '请输入新密码!'},{validator: validateToNextPassword},]}]"
/>
</a-form-item>
<a-form-item label="重复新密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请再次输入新密码"
type="password"
v-decorator="['confirm', {rules: [{required: true, message: '请再次输入新密码!'},
{
validator: compareToFirstPassword,
}]}]" />
v-decorator="['confirm', {
rules: [{ required: true, message: '请再次输入新密码!' },
{
validator: compareToFirstPassword,
}]
}]" />
</a-form-item>
</a-form>
</a-modal>
</template>
<script>
import {
sysUserUpdatePwd
} from '@/api/modular/system/userManage'
export default {
data() {
return {
labelCol: {
xs: {
span: 24
},
sm: {
span: 5
}
},
wrapperCol: {
xs: {
span: 24
},
sm: {
span: 16
}
import {
sysUserUpdatePwd
} from '@/api/modular/system/userManage'
export default {
data() {
return {
labelCol: {
xs: {
span: 24
},
confirmLoading: false,
visible_updPwd: false,
userId: '',
formUpdPwd: this.$form.createForm(this)
}
},
methods: {
open(id) {
this.userId = id
this.visible_updPwd = true
},
handleOkUpdPwd() {
const {
formUpdPwd: {
validateFields
}
} = this
validateFields((errors, values) => {
if (!errors) {
this.confirmLoading = true
values.id = this.userId
sysUserUpdatePwd(values).then((res) => {
if (res.success) {
this.$message.success('修改成功')
this.handleCancel()
} else {
this.$message.error('修改失败:' + res.message)
}
// eslint-disable-next-line handle-callback-err
}).finally((err) => {
this.confirmLoading = false
})
}
})
},
handleCancel() {
this.visible_updPwd = false
sm: {
span: 5
}
},
compareToFirstPassword(rule, value, callback) {
const formUpdPwd = this.formUpdPwd
if (value && value !== formUpdPwd.getFieldValue('newPassword')) {
// eslint-disable-next-line standard/no-callback-literal
callback('请确认两次输入密码的一致性!')
} else {
callback()
wrapperCol: {
xs: {
span: 24
},
sm: {
span: 16
}
},
validateToNextPassword(rule, value, callback) {
const formUpdPwd = this.formUpdPwd
if (value && this.confirmDirty) {
formUpdPwd.validateFields(['confirm'], {
force: true
confirmLoading: false,
visible_updPwd: false,
userId: '',
formUpdPwd: this.$form.createForm(this)
}
},
methods: {
open(id) {
this.userId = id
this.visible_updPwd = true
},
handleOkUpdPwd() {
const {
formUpdPwd: {
validateFields
}
} = this
validateFields((errors, values) => {
if (!errors) {
this.confirmLoading = true
values.id = this.userId
sysUserUpdatePwd(values).then((res) => {
if (res.success) {
this.$message.success('修改成功')
this.handleCancel()
} else {
this.$message.error('修改失败:' + res.message)
}
// eslint-disable-next-line handle-callback-err
}).finally((err) => {
this.confirmLoading = false
})
}
})
},
handleCancel() {
this.visible_updPwd = false
},
validPassword(value) {
var reg = /^(?![0-9]+$)(?![^0-9]+$)(?![a-zA-Z]+$)(?![^a-zA-Z]+$)(?![a-zA-Z0-9]+$)[a-zA-Z0-9\S]{8,30}$/;
if (value.match(reg)) {
return true;
}
return false;
},
compareToFirstPassword(rule, value, callback) {
const formUpdPwd = this.formUpdPwd
if (value && value !== formUpdPwd.getFieldValue('newPassword')) {
// eslint-disable-next-line standard/no-callback-literal
callback('请确认两次输入密码的一致性!')
} else {
callback()
}
}
},
validateToNextPassword (rule, value, callback) {
if (this.validPassword(value)) callback()
else callback(new Error('密码8-30位且包含字母、数字、特殊符号'))
}
}
}
</script>

@ -1,53 +1,51 @@
<template>
<div class="main">
<a-form id="formLogin" class="user-layout-login" ref="formLogin" :form="form" @submit="handleSubmit">
<!-- <a-tabs
<a-spin :spinning="loading">
<a-form id="formLogin" class="user-layout-login" ref="formLogin" :form="form" @submit="handleSubmit">
<!-- <a-tabs
:activeKey="customActiveKey"
:tabBarStyle="{ textAlign: 'center', borderBottom: 'unset' }"
@change="handleTabClick"
> -->
<!-- <a-tab-pane key="tab1" tab="账号密码登录"> -->
<a-alert
v-if="isLoginError"
type="error"
showIcon
style="margin-bottom: 24px;"
:message="this.accountLoginErrMsg"
/>
<a-form-item>
<a-input
size="large"
type="text"
placeholder="账号"
v-decorator="[
'account',
{
initialValue: '',
rules: [{ required: true, message: '请输入帐户名' }, { validator: handleUsernameOrEmail }],
validateTrigger: 'change'
}
]"
>
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input>
</a-form-item>
<!-- <a-tab-pane key="tab1" tab="账号密码登录"> -->
<a-alert
v-if="isLoginError"
type="error"
showIcon
style="margin-bottom: 24px;"
:message="this.accountLoginErrMsg" />
<a-form-item>
<a-input
size="large"
type="text"
placeholder="账号"
v-decorator="[
'account',
{
initialValue: '',
rules: [{ required: true, message: '请输入帐户名' }, { validator: handleUsernameOrEmail }],
validateTrigger: 'change'
}
]">
<a-icon slot="prefix" type="user" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input>
</a-form-item>
<a-form-item>
<a-input
size="large"
type="password"
autocomplete="false"
placeholder="密码"
v-decorator="[
'password',
{ initialValue: '', rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur' }
]"
>
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input>
</a-form-item>
<!-- </a-tab-pane> -->
<!-- <a-tab-pane key="tab2" tab="手机号登录">
<a-form-item>
<a-input
size="large"
type="password"
autocomplete="false"
placeholder="密码"
v-decorator="[
'password',
{ initialValue: '', rules: [{ required: true, message: '请输入密码' }], validateTrigger: 'blur' }
]">
<a-icon slot="prefix" type="lock" :style="{ color: 'rgba(0,0,0,.25)' }" />
</a-input>
</a-form-item>
<!-- </a-tab-pane> -->
<!-- <a-tab-pane key="tab2" tab="手机号登录">
<a-alert
v-if="isLoginError"
type="error"
@ -99,16 +97,16 @@
</a-col>
</a-row>
</a-tab-pane> -->
<!-- </a-tabs> -->
<!-- </a-tabs> -->
<a-form-item>
<a-checkbox v-decorator="['rememberMe', { valuePropName: 'checked' }]"></a-checkbox>
<a @click="FnGo" class="forge-password" style="float: right;">
忘记密码
</a>
</a-form-item>
<a-form-item>
<a-checkbox v-decorator="['rememberMe', { valuePropName: 'checked' }]"></a-checkbox>
<a @click="FnGo" class="forge-password" style="float: right;">
忘记密码
</a>
</a-form-item>
<a-form-item>
<a-form-item>
<!-- <Verify
@success="verifySuccess"
:mode="'pop'"
@ -116,22 +114,20 @@
:imgSize="{ width: '330px', height: '155px' }"
ref="verify"
></Verify> -->
</a-form-item>
</a-form-item>
<a-form-item style="margin-top:24px">
<a-button
size="large"
type="primary"
htmlType="submit"
class="login-button"
:loading="state.loginBtn"
:disabled="state.loginBtn"
>确定</a-button
>
</a-form-item>
<a-form-item style="margin-top:24px">
<a-button
size="large"
type="primary"
htmlType="submit"
class="login-button"
:loading="state.loginBtn"
:disabled="state.loginBtn">确定</a-button>
</a-form-item>
<div class="user-login-other">
<!-- <span>其他登录方式</span>
<div class="user-login-other">
<!-- <span>其他登录方式</span>
<a>
<a-icon class="item-icon" type="alipay-circle"></a-icon>
</a>
@ -141,16 +137,17 @@
<a>
<a-icon class="item-icon" type="weibo-circle"></a-icon>
</a> -->
<a class="register" @click="FnGo"></a>
</div>
</a-form>
<a class="register" @click="FnGo"></a>
</div>
</a-form>
</a-spin>
<upd-pwd ref="updPwd" />
<two-step-captcha
v-if="requiredTwoStepCaptcha"
:visible="stepCaptchaVisible"
@success="stepCaptchaSuccess"
@cancel="stepCaptchaCancel"
></two-step-captcha>
@cancel="stepCaptchaCancel"></two-step-captcha>
</div>
</template>
@ -158,12 +155,14 @@
import TwoStepCaptcha from '@/components/tools/TwoStepCaptcha'
import { mapActions } from 'vuex'
import { getSmsCaptcha, getCaptchaOpen } from '@/api/modular/system/loginManage'
import { ACCESS_TOKEN, ALL_APPS_MENU, DICT_TYPE_TREE_DATA } from '@/store/mutation-types'
import UpdPwd from './updPwd.vue'
import Verify from '@/components/verifition/Verify'
import store from '@/store'
export default {
components: {
TwoStepCaptcha,
Verify
Verify,
UpdPwd
},
data() {
return {
@ -171,9 +170,11 @@ export default {
loginBtn: false,
// login type: 0 email, 1 username, 2 telephone
loginType: 0,
needPassWord: false,
isLoginError: false,
requiredTwoStepCaptcha: false,
stepCaptchaVisible: false,
loading: false,
form: this.$form.createForm(this),
state: {
time: 60,
@ -191,6 +192,10 @@ export default {
created() {
// this.getCaptchaOpen()
},
mounted() {
window.addEventListener('beforeunload', e => this.beforeunloadHandler(e))
},
methods: {
...mapActions(['Login', 'Logout', 'dictTypeData', 'getNoticReceiveList']),
FnGo() {
@ -247,9 +252,25 @@ export default {
loginParams[!state.loginType ? 'account' : 'account'] = values.account
loginParams.password = values.password
Login(loginParams)
.then(res => this.loginSuccess(res))
.catch(err => this.requestFailed(err))
.finally(() => {
.then(res => {
this.loginSuccess(res)
this.needPassWord = false
}).catch(err => {
if (err.needPassWord) {
this.$message.warning('需要更换密码')
this.needPassWord = true
this.loading = true
this.$store.dispatch('GetInfo').then(res => {
this.$refs.updPwd.open(res.id)
this.loading = false
}).catch(() => {
this.$message.error('获取个人信息失败')
this.loading = false
})
} else {
this.requestFailed(err)
}
}).finally(() => {
state.loginBtn = false
})
} else {
@ -323,12 +344,29 @@ export default {
this.$router.push({ path: '/' })
this.isLoginError = false
//
this.dictTypeData().then(res => {})
this.dictTypeData().then(res => { })
},
requestFailed(err) {
this.accountLoginErrMsg = err
this.isLoginError = true
},
beforeunloadHandler(e) {
if (this.needPassWord) {
this.$store.commit('SET_TOKEN', '')
this.$store.commit('SET_ROLES', [])
this.$store.commit('SET_BUTTONS', [])
this.$store.commit('SET_ADMINTYPE', '')
this.$store.commit('SET_INFO', null)
this.$ls.remove(ACCESS_TOKEN)
this.$ls.remove(ALL_APPS_MENU)
this.$ls.remove(DICT_TYPE_TREE_DATA)
this.$ls.remove('FIRSTFLAG')
}
}
},
deactivated() {
window.removeEventListener('beforeunload', e => this.beforeunloadHandler(e))
}
}
</script>
@ -336,6 +374,7 @@ export default {
<style lang="less" scoped>
.user-layout-login {
margin-top: 100px;
label {
font-size: 14px;
}

@ -0,0 +1,123 @@
<template>
<a-modal title="修改密码" @cancel="handleCancel" :visible="visible_updPwd" :confirm-loading="confirmLoading">
<a-form :form="formUpdPwd">
<a-form-item label="原密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入原密码"
type="password"
v-decorator="['password', { rules: [{ required: true, message: '请输入原密码!' }] }]" />
</a-form-item>
<a-form-item label="新密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请输入新密码"
type="password"
v-decorator="['newPassword', { rules: [{ required: true, message: '请输入新密码!' }, { validator: validateToNextPassword },] }]" />
</a-form-item>
<a-form-item label="重复新密码" :labelCol="labelCol" :wrapperCol="wrapperCol" has-feedback>
<a-input
placeholder="请再次输入新密码"
type="password"
v-decorator="['confirm', {
rules: [{ required: true, message: '请再次输入新密码!' },
{
validator: compareToFirstPassword,
}]
}]" />
</a-form-item>
</a-form>
<template slot="footer">
<a-button @click="handleCancel"></a-button>
<a-button type="primary" :loading="confirmLoading" @click="handleOkUpdPwd"></a-button>
</template>
</a-modal>
</template>
<script>
import {
sysUserUpdatePwd
} from '@/api/modular/system/userManage'
import { ACCESS_TOKEN, ALL_APPS_MENU, DICT_TYPE_TREE_DATA } from '@/store/mutation-types'
export default {
data() {
return {
labelCol: {
xs: {
span: 24
},
sm: {
span: 5
}
},
wrapperCol: {
xs: {
span: 24
},
sm: {
span: 16
}
},
confirmLoading: false,
visible_updPwd: false,
userId: '',
formUpdPwd: this.$form.createForm(this)
}
},
methods: {
open(id) {
this.userId = id
this.visible_updPwd = true
},
handleOkUpdPwd() {
this.formUpdPwd.validateFields((errors, values) => {
if (!errors) {
// this.confirmLoading = true
values.id = this.userId
sysUserUpdatePwd(values).then((res) => {
if (res.success) {
this.$message.success('修改成功,请重新登陆')
this.handleCancel()
this.$store.commit('SET_TOKEN', '')
this.$store.commit('SET_ROLES', [])
this.$store.commit('SET_BUTTONS', [])
this.$store.commit('SET_ADMINTYPE', '')
this.$store.commit('SET_INFO', null)
this.$ls.remove(ACCESS_TOKEN)
this.$ls.remove(ALL_APPS_MENU)
this.$ls.remove(DICT_TYPE_TREE_DATA)
this.$ls.remove('FIRSTFLAG')
} else {
this.$message.error('修改失败:' + res.message)
}
// eslint-disable-next-line handle-callback-err
}).finally((err) => {
this.confirmLoading = false
})
}
})
},
handleCancel() {
this.visible_updPwd = false
},
validPassword(value) {
var reg = /^(?![0-9]+$)(?![^0-9]+$)(?![a-zA-Z]+$)(?![^a-zA-Z]+$)(?![a-zA-Z0-9]+$)[a-zA-Z0-9\S]{8,30}$/;
if (value.match(reg)) {
return true;
}
return false;
},
compareToFirstPassword(rule, value, callback) {
const formUpdPwd = this.formUpdPwd
if (value && value !== formUpdPwd.getFieldValue('newPassword')) {
// eslint-disable-next-line standard/no-callback-literal
callback('请确认两次输入密码的一致性!')
} else {
callback()
}
},
validateToNextPassword(rule, value, callback) {
if (this.validPassword(value)) callback()
else callback(new Error('密码8-30位且包含字母、数字、特殊符号'))
}
}
}
</script>
Loading…
Cancel
Save