加解密
This commit is contained in:
parent
bc2ee69dd7
commit
47cb821ccf
|
|
@ -26,6 +26,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { updateUserPwd } from '@/api/system/user'
|
import { updateUserPwd } from '@/api/system/user'
|
||||||
import { validPassword } from '@/utils/validate'
|
import { validPassword } from '@/utils/validate'
|
||||||
|
import { encrypt } from '@/utils/jsencrypt.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -93,13 +94,12 @@ export default {
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs['form'].validate(valid => {
|
this.$refs['form'].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
const oldPassword = encrypt(this.user.oldPassword)
|
||||||
|
const newPassword = encrypt(this.user.newPassword)
|
||||||
|
updateUserPwd(oldPassword, newPassword).then(response => {
|
||||||
this.$modal.msgSuccess('修改成功')
|
this.$modal.msgSuccess('修改成功')
|
||||||
// 进入首页
|
// 进入首页
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
// location.href = '/login';
|
|
||||||
// location.href = '/gl/login';
|
|
||||||
|
|
||||||
location.href = process.env.NODE_ENV === 'production' ? '/sgzbgl/login' : '/login'
|
location.href = process.env.NODE_ENV === 'production' ? '/sgzbgl/login' : '/login'
|
||||||
// location.href = process.env.NODE_ENV === 'production' ? '/gl/login' : '/login'
|
// location.href = process.env.NODE_ENV === 'production' ? '/gl/login' : '/login'
|
||||||
})
|
})
|
||||||
|
|
@ -109,9 +109,6 @@ export default {
|
||||||
},
|
},
|
||||||
close() {
|
close() {
|
||||||
this.$store.dispatch('LogOut').then(() => {
|
this.$store.dispatch('LogOut').then(() => {
|
||||||
// location.href = '/login';
|
|
||||||
// location.href = '/gl/login';
|
|
||||||
|
|
||||||
location.href = process.env.NODE_ENV === 'production' ? '/sgzbgl/login' : '/login'
|
location.href = process.env.NODE_ENV === 'production' ? '/sgzbgl/login' : '/login'
|
||||||
// location.href = process.env.NODE_ENV === 'production-nw' ? '/gl/login' : '/login'
|
// location.href = process.env.NODE_ENV === 'production-nw' ? '/gl/login' : '/login'
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,7 @@ import { getToken } from '@/utils/auth'
|
||||||
import Treeselect from '@riophae/vue-treeselect'
|
import Treeselect from '@riophae/vue-treeselect'
|
||||||
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
||||||
import { validPassword } from '@/utils/validate'
|
import { validPassword } from '@/utils/validate'
|
||||||
import { decrypt } from '@/utils/jsencrypt'
|
import { encrypt, decrypt } from '@/utils/jsencrypt'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'User',
|
name: 'User',
|
||||||
|
|
@ -723,8 +723,9 @@ export default {
|
||||||
inputErrorMessage: '用户密码长度必须介于 5 和 20 之间',
|
inputErrorMessage: '用户密码长度必须介于 5 和 20 之间',
|
||||||
})
|
})
|
||||||
.then(({ value }) => {
|
.then(({ value }) => {
|
||||||
resetUserPwd(row.userId, value).then(response => {
|
const password = encrypt(value)
|
||||||
this.$modal.msgSuccess('修改成功,新密码是:' + value)
|
resetUserPwd(row.userId, password).then(response => {
|
||||||
|
this.$modal.msgSuccess('修改成功')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
.catch(() => {})
|
.catch(() => {})
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
<script>
|
<script>
|
||||||
import { updateUserPwd } from "@/api/system/user";
|
import { updateUserPwd } from "@/api/system/user";
|
||||||
import { validPassword } from '@/utils/validate'
|
import { validPassword } from '@/utils/validate'
|
||||||
|
import { encrypt } from '@/utils/jsencrypt.js'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
|
|
@ -66,7 +67,9 @@ export default {
|
||||||
submit() {
|
submit() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
updateUserPwd(this.user.oldPassword, this.user.newPassword).then(response => {
|
const oldPassword = encrypt(this.user.oldPassword)
|
||||||
|
const newPassword = encrypt(this.user.newPassword)
|
||||||
|
updateUserPwd(oldPassword, newPassword).then(response => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,7 @@ module.exports = {
|
||||||
// target: `http://10.40.92.8:8080`, //超
|
// target: `http://10.40.92.8:8080`, //超
|
||||||
// target: `http://10.40.92.81:8080`, //韩/
|
// target: `http://10.40.92.81:8080`, //韩/
|
||||||
// target: `http://10.40.92.74:8080`,//旭/
|
// target: `http://10.40.92.74:8080`,//旭/
|
||||||
target: `http://10.40.92.136:28080`, //帅
|
target: `http://10.40.92.148:28080`, //帅
|
||||||
// target: `http://10.40.92.5:28080`, //福
|
// target: `http://10.40.92.5:28080`, //福
|
||||||
|
|
||||||
//******** 注意事项 ********* */
|
//******** 注意事项 ********* */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue