diff --git a/src/api/management/user.js b/src/api/management/user.js
index d60c532ae..6de390470 100644
--- a/src/api/management/user.js
+++ b/src/api/management/user.js
@@ -238,3 +238,34 @@ export function registerUser(data) {
data
});
}
+/** 超管重置用户密码 */
+export function adminResetUserPassword(userId) {
+ return request({
+ url: `/api/userinfo/${userId}/reset/pwd`,
+ method: 'put'
+ });
+}
+/** 找回密码 */
+export function findPassword(data) {
+ return request({
+ url: `/api/userinfo/retrieve/pwd`,
+ method: 'put',
+ data
+ });
+}
+/** 发送手机验证码 */
+export function sendPhoneVfcode(data) {
+ return request({
+ url: '/api/userinfo/mobile/code',
+ method: 'post',
+ data
+ });
+}
+/** 发送邮箱验证码 */
+export function sendEmailVfcode(params) {
+ return request({
+ url: '/api/userinfo/email/code',
+ method: 'post',
+ params
+ });
+}
diff --git a/src/views/login/forgetPassword.vue b/src/views/login/forgetPassword.vue
new file mode 100644
index 000000000..7a351683b
--- /dev/null
+++ b/src/views/login/forgetPassword.vue
@@ -0,0 +1,262 @@
+
+
+
+
+
+ 找回途径:
+
+
+ 手机号找回
+ 邮箱找回
+
+
+
+
+ 邮 箱:
+
+
+
+
+
+ 手机号:
+
+
+
+
+
+ 密 码:
+
+
+
+
+
+
+
+
+ 验证码:
+
+
+
+ {{ $t('global.sendCode') }}
+ {{ passWordCodeTime }}
+
+
+
+ 找回
+ 返回登录
+
+
+
+
+
+
+
diff --git a/src/views/login/index.vue b/src/views/login/index.vue
index 86b9e48c1..027ed2e6a 100644
--- a/src/views/login/index.vue
+++ b/src/views/login/index.vue
@@ -100,6 +100,9 @@
{{ $t('login.login') }}
+
@@ -128,6 +131,7 @@
+
@@ -156,10 +160,11 @@ import { getSimulationInfoNew } from '@/api/simulation';
import { getSimulationInfoByGroup } from '@/api/rtSimulation';
import { getSessionStorage } from '@/utils/auth';
import Register from './register';
+import ForgetPassword from './forgetPassword';
export default {
name: 'Login',
- components: { QrcodeVue, FloatPart, Register },
+ components: { QrcodeVue, FloatPart, Register, ForgetPassword },
data() {
const validateName = (rule, value, callback) => {
if (value) {
@@ -623,6 +628,9 @@ export default {
// },
registerUser() {
this.$refs.register.doShow();
+ },
+ forgetPassword() {
+ this.$refs.forgetPassword.doShow();
}
}
};
@@ -762,7 +770,7 @@ export default {
.popover_box {
position: absolute;
right: 80px;
- bottom: 106px;
+ bottom: 124px;
cursor: pointer;
color: #225592;
font-size: 14px;
diff --git a/src/views/system/userControl/index.vue b/src/views/system/userControl/index.vue
index c31ad1a67..1faf04231 100644
--- a/src/views/system/userControl/index.vue
+++ b/src/views/system/userControl/index.vue
@@ -15,6 +15,7 @@ import DictionaryEdit from './edit';
import CreateUser from './createUser';
import CreateSingleUser from './createSingleUser';
import BindCompany from './bindCompany';
+import {adminResetUserPassword} from '@/api/management/user';
export default {
name: 'UserControl',
@@ -163,6 +164,10 @@ export default {
name: '绑定组织管理员',
handleClick: this.handleBind
},
+ {
+ name: '重置密码',
+ handleClick: this.resetPassword
+ },
{
name: '删除',
handleClick: this.handleDelete
@@ -222,6 +227,19 @@ export default {
handleBind(index, row) {
this.$refs.bindCompany.doShow(row);
},
+ resetPassword(index, row) {
+ this.$confirm('操作会将改用户密码重置为初始密码,是否继续', this.$t('global.tips'), {
+ confirmButtonText: this.$t('global.confirm'),
+ cancelButtonText: this.$t('global.cancel'),
+ type: 'warning'
+ }).then(() => {
+ adminResetUserPassword(row.id).then(response => {
+ this.$message.success('重置密码成功!');
+ }).catch(() => {
+ this.$message.error('重置密码失败!');
+ });
+ });
+ },
handleDelete(index, row) {
deleteUserInLogic(row.id).then(resp=> {
// 逻辑删除