2024-08-05 08:26:35 +00:00
|
|
|
|
<!--
|
|
|
|
|
* @Author: ym
|
|
|
|
|
* @Date: 2021-09-28 10:53:53
|
|
|
|
|
* @LastEditTime: 2022-01-09 18:57:16
|
|
|
|
|
* @LastEditors: Please set LastEditors
|
|
|
|
|
* @Description: In User Settings Edit
|
|
|
|
|
* @FilePath: \background-front-end\src\views\common\home.vue
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
2024-12-20 10:17:10 +00:00
|
|
|
|
<div class="mod-home">
|
|
|
|
|
<el-dialog
|
2024-12-22 08:06:28 +00:00
|
|
|
|
title="提示:当前密码安全级别较低,请您修改密码"
|
2024-12-20 10:17:10 +00:00
|
|
|
|
:visible.sync="dialogVisible"
|
2024-12-22 08:06:28 +00:00
|
|
|
|
width="500px"
|
2024-12-20 10:17:10 +00:00
|
|
|
|
:show-close="false"
|
|
|
|
|
:destroy-on-close="true"
|
|
|
|
|
:close-on-click-modal="false"
|
|
|
|
|
>
|
2024-12-22 08:06:28 +00:00
|
|
|
|
<el-form ref="ruleForm" :model="form" :rules="rules">
|
|
|
|
|
<el-form-item
|
|
|
|
|
label="新密码"
|
|
|
|
|
:label-width="formLabelWidth"
|
|
|
|
|
prop="password"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
placeholder="请输入新密码"
|
|
|
|
|
style="width: 240px; margin-right: 20px"
|
|
|
|
|
v-model="form.password"
|
|
|
|
|
show-password
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item
|
|
|
|
|
prop="isPassword"
|
|
|
|
|
label="确认新密码:"
|
|
|
|
|
:label-width="formLabelWidth"
|
|
|
|
|
>
|
|
|
|
|
<el-input
|
|
|
|
|
style="width: 240px"
|
|
|
|
|
placeholder="请再次输入新密码"
|
|
|
|
|
v-model="form.isPassword"
|
|
|
|
|
show-password
|
|
|
|
|
></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
2024-12-20 10:17:10 +00:00
|
|
|
|
<span slot="footer" class="dialog-footer">
|
|
|
|
|
<!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
|
2024-12-22 08:06:28 +00:00
|
|
|
|
<el-button type="primary" @click="confirmPassword"
|
2024-12-20 10:17:10 +00:00
|
|
|
|
>确定并重新登入</el-button
|
|
|
|
|
>
|
|
|
|
|
</span>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</div>
|
2024-08-05 08:26:35 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2024-12-22 08:06:28 +00:00
|
|
|
|
import { clearLoginInfo } from "@/utils";
|
2024-12-20 10:17:10 +00:00
|
|
|
|
export default {
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dialogVisible: false,
|
2024-12-22 08:06:28 +00:00
|
|
|
|
formLabelWidth: "120px",
|
|
|
|
|
form: {
|
|
|
|
|
isPassword: "",
|
|
|
|
|
password: "",
|
|
|
|
|
},
|
|
|
|
|
rules: {
|
|
|
|
|
password: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入新密码",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
min: 8,
|
|
|
|
|
max: 12,
|
|
|
|
|
message:
|
|
|
|
|
"密码由8-12位字母、数字、特殊符号(~、@、#、$、%、*)的组成,请重新输入",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
var passwordreg =
|
|
|
|
|
/(?=.*\d)(?=.*[a-zA-Z])(?=.*[^a-zA-Z0-9]).{8,12}/;
|
|
|
|
|
if (!passwordreg.test(value)) {
|
|
|
|
|
callback(
|
|
|
|
|
new Error(
|
|
|
|
|
"密码由8-12位字母、数字、特殊符号(~、@、#、$、%、*)的组成,请重新输入"
|
|
|
|
|
)
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
isPassword: [
|
|
|
|
|
{
|
|
|
|
|
required: true,
|
|
|
|
|
message: "请输入确认密码",
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
trigger: "blur",
|
|
|
|
|
validator: (rule, value, callback) => {
|
|
|
|
|
if (value != this.form.password) {
|
|
|
|
|
callback(new Error("密码输入不一致"));
|
|
|
|
|
} else {
|
|
|
|
|
callback();
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
2024-12-20 10:17:10 +00:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
|
|
|
|
if (
|
|
|
|
|
JSON.parse(sessionStorage.getItem("password")) == "123456" &&
|
|
|
|
|
JSON.parse(sessionStorage.getItem("role")) === "ROLE_BRAND_MANAGER"
|
|
|
|
|
) {
|
|
|
|
|
this.dialogVisible = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
2024-12-22 08:06:28 +00:00
|
|
|
|
methods: {
|
|
|
|
|
confirmPassword() {
|
|
|
|
|
this.$refs.ruleForm.validate((valid) => {
|
|
|
|
|
console.log(valid);
|
|
|
|
|
if (valid) {
|
|
|
|
|
this.$api.mer_admin
|
|
|
|
|
.simplePassword({
|
|
|
|
|
password: this.form.password,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
this.$api.logout().then(({ data }) => {
|
|
|
|
|
clearLoginInfo();
|
|
|
|
|
this.$router.push({ name: "login" });
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
},
|
2024-12-20 10:17:10 +00:00
|
|
|
|
};
|
2024-08-05 08:26:35 +00:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.mod-home {
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
.el-carousel__item h3 {
|
2024-10-08 10:06:38 +00:00
|
|
|
|
color: #475669;
|
|
|
|
|
font-size: 18px;
|
|
|
|
|
opacity: 0.75;
|
|
|
|
|
line-height: 300px;
|
|
|
|
|
margin: 0;
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-carousel__item:nth-child(2n) {
|
|
|
|
|
background-color: #99a9bf;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.el-carousel__item:nth-child(2n + 1) {
|
|
|
|
|
background-color: #d3dce6;
|
|
|
|
|
}
|
2024-08-05 08:26:35 +00:00
|
|
|
|
</style>
|