Commit 82745899 authored by “yiyousong”'s avatar “yiyousong”

perf:修改密码和修改用户添加账号密码加密

parent c0ba780a
...@@ -20,9 +20,3 @@ export function changePassword(params) { ...@@ -20,9 +20,3 @@ export function changePassword(params) {
export function editPassword(params) { export function editPassword(params) {
return http.post(`${baseURL}/zwfw/user/reset/password`, params); return http.post(`${baseURL}/zwfw/user/reset/password`, params);
} }
// 获取图形验证码
export function createCode(params) {
return http.post(`${baseURL}/zwfw/securitycode/createCode`, params, {
responseType: "blob",
});
}
...@@ -631,18 +631,20 @@ img { ...@@ -631,18 +631,20 @@ img {
tr, th,td{ tr, th,td{
border:none !important; border:none !important;
} }
// .ant-table-body-inner{
// &::-webkit-scrollbar{ // 表格鼠标移入显示滚动条
// display: none; .ant-table-body,.ant-table-body-inner{
// } &::-webkit-scrollbar{
// } display: none;
// :hover{ }
// .ant-table-body-inner{ }
// &::-webkit-scrollbar{ :hover{
// display: block; .ant-table-body,.ant-table-body-inner{
// } &::-webkit-scrollbar{
// } display:block;
// } }
}
}
} }
.ant-table-thead th { .ant-table-thead th {
background: linear-gradient(0deg, #f9fbff 0%, #cbddff 78%); background: linear-gradient(0deg, #f9fbff 0%, #cbddff 78%);
...@@ -760,18 +762,18 @@ img { ...@@ -760,18 +762,18 @@ img {
} }
} }
// 表格鼠标移入显示滚动条 // 表格鼠标移入显示滚动条
.ant-table { // .ant-table {
.ant-table-body,.ant-table-body-inner{ // .ant-table-body,.ant-table-body-inner{
&::-webkit-scrollbar{ // &::-webkit-scrollbar{
display: none; // display: none;
} // }
} // }
:hover{ // :hover{
.ant-table-body,.ant-table-body-inner{ // .ant-table-body,.ant-table-body-inner{
&::-webkit-scrollbar{ // &::-webkit-scrollbar{
display:block; // display:block;
} // }
} // }
} // }
} // }
\ No newline at end of file \ No newline at end of file
import Storage from "@/utils/js/Storage"; // import Storage from "@/utils/js/Storage";
import store from "@/store"; import store from "@/store";
// 修改密码权限 // 修改密码权限
export const permission = { export const permission = {
......
...@@ -39,7 +39,6 @@ axios.interceptors.response.use( ...@@ -39,7 +39,6 @@ axios.interceptors.response.use(
// 取出数据 // 取出数据
let { code, msg } = response.data; let { code, msg } = response.data;
if (code === -1) { if (code === -1) {
console.log(response.data);
message.error({ message.error({
content: msg, content: msg,
maxCount: 1, maxCount: 1,
...@@ -49,7 +48,14 @@ axios.interceptors.response.use( ...@@ -49,7 +48,14 @@ axios.interceptors.response.use(
store.commit("user/reset"); store.commit("user/reset");
router.push("/"); router.push("/");
} }
} else if (code === 401) { } else if (
code === 401 ||
code === 201 ||
code === 101 ||
code === 102 ||
code === 9001 ||
code === 9002
) {
message.error({ message.error({
content: msg, content: msg,
maxCount: 1, maxCount: 1,
......
...@@ -42,6 +42,7 @@ import { changePassWord } from "@/utils/js/validate"; ...@@ -42,6 +42,7 @@ import { changePassWord } from "@/utils/js/validate";
import { changePassword, LogoutInterface } from "@/api/user"; import { changePassword, LogoutInterface } from "@/api/user";
import { mapMutations } from "vuex"; import { mapMutations } from "vuex";
import { encrypt } from "@/utils"; import { encrypt } from "@/utils";
import storage from "@/utils/js/Storage";
export default { export default {
props: { props: {
visibleEditPwd: { visibleEditPwd: {
......
...@@ -13,8 +13,8 @@ ...@@ -13,8 +13,8 @@
:model="form" :model="form"
:rules="rules" :rules="rules"
ref="formData" ref="formData"
:label-col="{ span: 5 }" :label-col="{ span: 6 }"
:wrapper-col="{ span: 19 }" :wrapper-col="{ span: 18 }"
> >
<a-form-model-item label="用户名" prop="loginName"> <a-form-model-item label="用户名" prop="loginName">
<a-input <a-input
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
<div slot="footer"> <div slot="footer">
<a-button style="margin-left: 10px" @click="handleClose">取消</a-button> <a-button style="margin-left: 10px" @click="handleClose">取消</a-button>
<a-button type="primary" class="addclass" @click="handleOk">确定</a-button> <a-button type="primary" class="addclass" @click="handleOk"
>确定</a-button
>
</div> </div>
</a-modal> </a-modal>
</div> </div>
...@@ -45,6 +47,7 @@ ...@@ -45,6 +47,7 @@
<script> <script>
import { changeAccount, changePassWord } from "@/utils/js/validate"; import { changeAccount, changePassWord } from "@/utils/js/validate";
import { editPassword } from "@/api/user"; import { editPassword } from "@/api/user";
import { encrypt } from "@/utils";
export default { export default {
props: { props: {
visibleEditPwd: { visibleEditPwd: {
...@@ -98,7 +101,11 @@ export default { ...@@ -98,7 +101,11 @@ export default {
handleOk() { handleOk() {
this.$refs.formData.validate(async (valid) => { this.$refs.formData.validate(async (valid) => {
if (valid) { if (valid) {
let res = await editPassword(this.form); let obj = {
loginName: encrypt(this.form.loginName),
newPwd: encrypt(this.form.newPwd),
};
let res = await editPassword(obj);
if (res.code === 1) { if (res.code === 1) {
this.$message.success("密码修改成功"); this.$message.success("密码修改成功");
this.handleClose(); this.handleClose();
......
...@@ -69,6 +69,7 @@ import { getListByParentId } from "@/api/area.js"; ...@@ -69,6 +69,7 @@ import { getListByParentId } from "@/api/area.js";
import { userSave } from "@/api/userManagement.js"; import { userSave } from "@/api/userManagement.js";
import { TreeSelect } from "ant-design-vue"; import { TreeSelect } from "ant-design-vue";
const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD
import { encrypt } from "@/utils";
export default { export default {
data() { data() {
return { return {
...@@ -180,6 +181,7 @@ export default { ...@@ -180,6 +181,7 @@ export default {
...this.form, ...this.form,
areaNames: JSON.stringify(this.form.areaNames), areaNames: JSON.stringify(this.form.areaNames),
areaCodes: this.form.areaNames.map((v) => v.areaCode).join(","), areaCodes: this.form.areaNames.map((v) => v.areaCode).join(","),
loginName: encrypt(this.form.loginName),
}); });
let { code, msg } = res; let { code, msg } = res;
if (code === 1) { if (code === 1) {
......
...@@ -80,7 +80,9 @@ ...@@ -80,7 +80,9 @@
</a-form-model> </a-form-model>
<div slot="footer"> <div slot="footer">
<a-button style="margin-left: 10px" @click="resetForm">重置</a-button> <a-button style="margin-left: 10px" @click="resetForm">重置</a-button>
<a-button type="primary" class="addclass" @click="onSubmit">确定</a-button> <a-button type="primary" class="addclass" @click="onSubmit"
>确定</a-button
>
</div> </div>
</a-modal> </a-modal>
</div> </div>
...@@ -91,6 +93,7 @@ import { changeAccount, changePassWord } from "@/utils/js/validate"; ...@@ -91,6 +93,7 @@ import { changeAccount, changePassWord } from "@/utils/js/validate";
import { getListByParentId } from "@/api/area.js"; import { getListByParentId } from "@/api/area.js";
import { userSave } from "@/api/userManagement.js"; import { userSave } from "@/api/userManagement.js";
import { TreeSelect } from "ant-design-vue"; import { TreeSelect } from "ant-design-vue";
import { encrypt } from "@/utils";
const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD const SHOW_PARENT = TreeSelect.SHOW_PARENT; //SHOW_ALL, SHOW_PARENT, SHOW_CHILD
export default { export default {
data() { data() {
...@@ -189,6 +192,8 @@ export default { ...@@ -189,6 +192,8 @@ export default {
...this.form, ...this.form,
areaCodes: this.form.areaCodes.join(","), areaCodes: this.form.areaCodes.join(","),
areaNames: JSON.stringify(this.changeSelect), areaNames: JSON.stringify(this.changeSelect),
loginName: encrypt(this.form.loginName),
loginPwd: encrypt(this.form.loginPwd),
}); });
let { code, msg } = res; let { code, msg } = res;
if (code === 1) { if (code === 1) {
......
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