Commit 9f54cfb3 by xinla

密码加密

1 parent 091177cd
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
├── .env.js # 环境变量配置 ├── .env.js # 环境变量配置
├── index.html # html模板 ├── index.html # html模板
├── jsconfig.json # jsconfig 配置 快捷路径等 ├── jsconfig.json # jsconfig 配置 快捷路径等
└── package.json # package.json ├── package.json # package.json
├── vite.config.js # vite 配置 ├── vite.config.js # vite 配置
├── linkwe-mobile // 移动端项目包含移动工作台、任务宝、群裂变等H5 ├── linkwe-mobile // 移动端项目包含移动工作台、任务宝、群裂变等H5
├── linkwe-uniapp // uniapp短链小程序项目 ├── linkwe-uniapp // uniapp短链小程序项目
......
...@@ -161,8 +161,10 @@ export default { ...@@ -161,8 +161,10 @@ export default {
Cookies.remove('password') Cookies.remove('password')
Cookies.remove('rememberMe') Cookies.remove('rememberMe')
} }
let loginForm = JSON.parse(JSON.stringify(this.loginForm))
loginForm.password = encrypt(this.loginForm.password)
this.$store this.$store
.Login(this.loginForm) .Login(loginForm)
.then(() => { .then(() => {
this.$router.push({ path: this.redirect || window.lwConfig.BASE_URL }) this.$router.push({ path: this.redirect || window.lwConfig.BASE_URL })
}) })
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
<script> <script>
import { updateUserPwd } from '@/api/system/user' import { updateUserPwd } from '@/api/system/user'
import { encrypt, decrypt } from '@/utils/jsencrypt'
export default { export default {
data() { data() {
...@@ -53,7 +54,7 @@ export default { ...@@ -53,7 +54,7 @@ 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) => { updateUserPwd(encrypt(this.user.oldPassword), encrypt(this.user.newPassword)).then((response) => {
if (response.code === 200) { if (response.code === 200) {
this.msgSuccess('修改成功') this.msgSuccess('修改成功')
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!