Commit 39a4dcdc authored by qinj's avatar qinj

Merge branch 'dev' of http://120.25.63.219:6088/rex/portalhtml into dev

parents 2289103c 84f8de39
...@@ -3,7 +3,7 @@ export const employee = { ...@@ -3,7 +3,7 @@ export const employee = {
createUrl: '/employee/create', createUrl: '/employee/create',
searchUrl: '/employee/search', searchUrl: '/employee/search',
detailUrl: '/employee/getOne', detailUrl: '/employee/getOne',
updateUrl: '/employee/update', updateUrl: '/updatePassword',
confirmUpdateUrl: '/employee/confirmUpdate', confirmUpdateUrl: '/employee/confirmUpdate',
cancelUpdateUrl: '/employee/cancelUpdate' cancelUpdateUrl: '/employee/cancelUpdate'
} }
......
...@@ -38,9 +38,8 @@ const actions = { ...@@ -38,9 +38,8 @@ const actions = {
data.roles = ['admin'] data.roles = ['admin']
data.avatar = 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif' data.avatar = 'https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif'
commit('SET_TOKEN', data.ObjectID) commit('SET_TOKEN', data.ObjectID)
if (data.ExtIsFistTime_SDK) {
localStorage.setItem('CEINFO', JSON.stringify(data)) localStorage.setItem('CEINFO', JSON.stringify(data))
} else { if (!data.ExtIsFistTime_SDK) {
localStorage.setItem('USERINFO', JSON.stringify(data)) localStorage.setItem('USERINFO', JSON.stringify(data))
} }
setToken(data.ObjectID) setToken(data.ObjectID)
......
...@@ -80,8 +80,34 @@ ...@@ -80,8 +80,34 @@
<!-- <p>创新服务全民</p> <!-- <p>创新服务全民</p>
</div> --> </div> -->
<el-dialog :visible.sync="updatePassword"> <el-dialog
:visible.sync="updatePassword"
width='40%'
:close-on-click-modal="clickModel"
:close-on-press-escape="clickModel"
:show-close="clickModel"
>
<div class="changePass">
<div class="title-container">
<img src="../../assets/images/login_top.png">
<h3 class="title">修改初始密码</h3>
</div>
<div >
<ele-form
ref="form"
v-bind="formConfig"
v-model="formData"
/>
</div>
<div class="submit-btn">
<el-button
:loading="loading"
type="primary"
icon="el-icon-check"
@click="handleNext"
>确定</el-button>
</div>
</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
...@@ -90,12 +116,22 @@ ...@@ -90,12 +116,22 @@
// import { validUsername } from '@/utils/validate' // import { validUsername } from '@/utils/validate'
// import LangSelect from '@/components/LangSelect' // import LangSelect from '@/components/LangSelect'
// import SocialSign from './components/SocialSignin' // import SocialSign from './components/SocialSignin'
import path from 'path'; // import path from 'path';
import { update } from '@/api/flow/flow-definition'; // import { update } from '@/api/flow/flow-definition';
// import changePassword from '@/views/changePass/index'
import Title from '@/components/Title'
import EleTable from '@/components/EleTable/EleTable.vue'
import { employee } from '@/api/account'
export default { export default {
name: 'Login', name: 'Login',
// components: { LangSelect, SocialSign }, // components: { LangSelect, SocialSign },
components: {
// changePassword,
Title,
EleTable
},
data() { data() {
const validateUsername = (rule, value, callback) => { const validateUsername = (rule, value, callback) => {
if (!value) { if (!value) {
...@@ -112,6 +148,7 @@ export default { ...@@ -112,6 +148,7 @@ export default {
} }
} }
return { return {
clickModel: false,
loginForm: { loginForm: {
username: '', username: '',
password: '' password: ''
...@@ -126,7 +163,69 @@ export default { ...@@ -126,7 +163,69 @@ export default {
showDialog: false, showDialog: false,
redirect: undefined, redirect: undefined,
otherQuery: {}, otherQuery: {},
updatePassword: false updatePassword: false,
formData: {},
formConfig: {
isDialog: true,
isShowBackBtn: false,
isShowSubmitBtn: false,
isShowCancelBtn: false,
formDesc: {
OldPassword: {
type: "input",
label: "原始密码",
layout: 14,
required: true,
rules: [
{
trigger: "blur",
message: "请输入原始密码"
}
],
attrs: {
size: "mini",
clearable: false
}
},
NewPassword: {
type: "input",
label: "新密码",
layout: 14,
required: true,
rules: [
{
trigger: "blur",
message: "请输入新密码"
}
],
attrs: {
size: "mini",
clearable: false
}
},
AgainPassword: {
type: "input",
label: "确认密码",
layout: 14,
required: true,
rules: [
{
trigger: "blur",
message: "请输入新密码"
}
],
attrs: {
size: "mini",
clearable: false
}
}
},
order: [
"OldPassword",
"NewPassword",
"AgainPassword"
]
}
} }
}, },
watch: { watch: {
...@@ -143,6 +242,7 @@ export default { ...@@ -143,6 +242,7 @@ export default {
}, },
created() { created() {
localStorage.removeItem('USERINFO') localStorage.removeItem('USERINFO')
this.userInfo = JSON.parse(localStorage.getItem('CEINFO'))
// window.addEventListener('storage', this.afterQRScan) // window.addEventListener('storage', this.afterQRScan)
}, },
mounted() { mounted() {
...@@ -180,22 +280,22 @@ export default { ...@@ -180,22 +280,22 @@ export default {
} }
this.$store.dispatch('user/login', params) this.$store.dispatch('user/login', params)
.then(() => { .then(() => {
// if (JSON.parse(localStorage.getItem('CEINFO')).ExtIsFistTime_SDK) { const start = JSON.parse(localStorage.getItem('CEINFO')).ExtIsFistTime_SDK ? true : false
// this.$confirm('首次登入请修改密码', '提示', { console.log(start)
// confirmButtonText: '确定', if (start) {
// type: 'warning' this.$confirm('首次登入请修改密码', '提示', {
// }).then(() => { confirmButtonText: '确定',
// let dataInfo = JSON.parse(localStorage.getItem('CEINFO')) showClose: false,
// localStorage.setItem('USERINFO', JSON.stringify(dataInfo)) showCancelButton: false,
// localStorage.setItem('CEINFO', '') type: 'warning'
// this.$router.push({ path: '/changePass' , query: this.otherQuery }) }).then(() => {
// }).catch(() => { this.updatePassword = true
// console.log('登入失败') this.loading = false
// }); })
// } else { } else {
this.$router.push({ path: this.redirect || '/', query: this.otherQuery }) this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
// }
this.loading = false this.loading = false
}
}) })
.catch(() => { .catch(() => {
this.loading = false this.loading = false
...@@ -214,25 +314,49 @@ export default { ...@@ -214,25 +314,49 @@ export default {
} }
return acc return acc
}, {}) }, {})
},
async handleNext() {
await this.$refs.form.validate()
this.loading = true
if (this.$refs.form.$refs.NewPassword[0].value === this.$refs.form.$refs.AgainPassword[0].value) {
const formData = this.formData
formData.ObjectID = this.userInfo.ObjectID
console.log(formData)
const formNewData = {
objectID: formData.ObjectID,
extPassword_SDK: formData.OldPassword,
newPassword: formData.NewPassword
}
this.$request(employee.updateUrl, formNewData).then(() => {
localStorage.setItem('USERINFO', JSON.stringify(this.userInfo))
localStorage.removeItem('CEINFO')
// console.log("登入成功")
this.loading = false
this.updatePassword = false
this.$router.push({ path: this.redirect || '/', query: this.otherQuery })
})
} else {
this.$message.error('确认密码出错!!')
}
},
updateBaseInfo() {
const formData = this.formData
this.formData.ObjectID = this.userInfo.ObjectID
console.log(333333333, this.formData)
// this.$getUpdateChange(JSON.parse(this.formDataOldStr), this.formData)
if (Object.keys(formData).length > 1) {
this.loading = true
this.$request(employee.updateUrl, formData).then(() => {
this.loading = false
this.$message.success('更新成功!')
})
} else {
this.$message.error('sorry')
}
} }
// afterQRScan() {
// if (e.key === 'x-admin-oauth-code') {
// const code = getQueryObject(e.newValue)
// const codeMap = {
// wechat: 'code',
// tencent: 'code'
// }
// const type = codeMap[this.auth_type]
// const codeName = code[type]
// if (codeName) {
// this.$store.dispatch('LoginByThirdparty', codeName).then(() => {
// this.$router.push({ path: this.redirect || '/' })
// })
// } else {
// alert('第三方登录失败')
// }
// }
// }
} }
} }
</script> </script>
...@@ -249,23 +373,36 @@ export default { ...@@ -249,23 +373,36 @@ export default {
display: inline-block; display: inline-block;
height: 47px; height: 47px;
width: 85%; width: 85%;
input { input {
border: 0px; border: 0px;
border-radius: 0px;
padding: 12px 5px 12px 15px; padding: 12px 5px 12px 15px;
color: #999; color: #999;
height: 47px; height: 47px;
font-size: 14px; font-size: 14px;
} }
} }
.el-form-item { .el-form-item {
border: 1px solid #ccc; border: 1px solid #ccc;
border-radius: 5px; border-radius: 5px;
color: #454545; color: #454545;
margin-bottom: 30px; margin-bottom: 30px;
} }
.changePass {
.el-form-item {
border: none;
display: flex;
.el-form-item__content {
border: 1px solid #454545;
border-radius: 5px;
}
.ele-form-btns{
border: none !important;
}
}
.el-form-item__label {
width: 90px;
}
}
} }
</style> </style>
...@@ -326,7 +463,7 @@ $dark_gray:#889aa4; ...@@ -326,7 +463,7 @@ $dark_gray:#889aa4;
.title-container { .title-container {
position: relative; position: relative;
margin: 50px auto; margin: 0px auto 50px !important;
img { img {
width: 50%; width: 50%;
margin-left: 25%; margin-left: 25%;
...@@ -357,4 +494,33 @@ $dark_gray:#889aa4; ...@@ -357,4 +494,33 @@ $dark_gray:#889aa4;
user-select: none; user-select: none;
} }
} }
.submit-btn {
.el-button {
height: 40px;
width: 300px;
}
}
.el-dialog__body {
padding: 0px 20px;
}
.changePass {
::v-deep .el-row {
display: flex;
flex-flow: wrap;
justify-content: center;
}
::v-deep .el-form-item {
margin-bottom: 20px;
}
::v-deep .el-form-item__content {
width: 220px;
height: 32px;
.el-input {
height: 32px;
.el-input__inner {
height: 28px;
}
}
}
}
</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