重置密码时可以手工输入新密码
This commit is contained in:
parent
6b2adaf13b
commit
f2050a0f5b
@ -99,7 +99,11 @@ public class DeleteUserInput : BaseIdInput
|
|||||||
/// 重置用户密码输入参数
|
/// 重置用户密码输入参数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class ResetPwdUserInput : BaseIdInput
|
public class ResetPwdUserInput : BaseIdInput
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// 新密码(如果为空使用系统配置的默认密码)
|
||||||
|
/// </summary>
|
||||||
|
public string NewPassword { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
// Admin.NET 项目的版权、商标、专利和其他相关权利均受相应法律法规的保护。使用本项目应遵守相关法律法规和许可证的要求。
|
||||||
//
|
//
|
||||||
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
// 本项目主要遵循 MIT 许可证和 Apache 许可证(版本 2.0)进行分发和使用。许可证位于源代码树根目录中的 LICENSE-MIT 和 LICENSE-APACHE 文件。
|
||||||
//
|
//
|
||||||
@ -373,7 +373,9 @@ public class SysUserService : IDynamicApiController, ITransient
|
|||||||
public virtual async Task<string> ResetPwd(ResetPwdUserInput input)
|
public virtual async Task<string> ResetPwd(ResetPwdUserInput input)
|
||||||
{
|
{
|
||||||
var user = await _sysUserRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
var user = await _sysUserRep.GetByIdAsync(input.Id) ?? throw Oops.Oh(ErrorCodeEnum.D0009);
|
||||||
var password = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SysPassword);
|
string password = await _sysConfigService.GetConfigValueByCode<string>(ConfigConst.SysPassword);
|
||||||
|
if (!string.IsNullOrEmpty(input.NewPassword))
|
||||||
|
password = input.NewPassword;
|
||||||
user.Password = CryptogramUtil.Encrypt(password);
|
user.Password = CryptogramUtil.Encrypt(password);
|
||||||
user.LastChangePasswordTime = null;
|
user.LastChangePasswordTime = null;
|
||||||
user.TokenVersion = user.TokenVersion + 1;
|
user.TokenVersion = user.TokenVersion + 1;
|
||||||
|
|||||||
@ -703,7 +703,7 @@ export const SysWechatPayApiAxiosParamCreator = function (configuration?: Config
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
* 必填字段:OutTradeNumber,Reason
|
||||||
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
* @param {RefundRequestInput} [body]
|
* @param {RefundRequestInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
@ -954,7 +954,7 @@ export const SysWechatPayApiFp = function(configuration?: Configuration) {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
* 必填字段:OutTradeNumber,Reason
|
||||||
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
* @param {RefundRequestInput} [body]
|
* @param {RefundRequestInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
@ -1115,7 +1115,7 @@ export const SysWechatPayApiFactory = function (configuration?: Configuration, b
|
|||||||
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundListGet(transactionId, outTradeNumber, options).then((request) => request(axios, basePath));
|
return SysWechatPayApiFp(configuration).apiSysWechatPayRefundListGet(transactionId, outTradeNumber, options).then((request) => request(axios, basePath));
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
*
|
* 必填字段:OutTradeNumber,Reason
|
||||||
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
* @param {RefundRequestInput} [body]
|
* @param {RefundRequestInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
@ -1287,7 +1287,7 @@ export class SysWechatPayApi extends BaseAPI {
|
|||||||
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundListGet(transactionId, outTradeNumber, options).then((request) => request(this.axios, this.basePath));
|
return SysWechatPayApiFp(this.configuration).apiSysWechatPayRefundListGet(transactionId, outTradeNumber, options).then((request) => request(this.axios, this.basePath));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
* 必填字段:OutTradeNumber,Reason
|
||||||
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
* @summary 退款申请 🔖 https://pay.weixin.qq.com/docs/merchant/apis/mini-program-payment/create.html
|
||||||
* @param {RefundRequestInput} [body]
|
* @param {RefundRequestInput} [body]
|
||||||
* @param {*} [options] Override http request option.
|
* @param {*} [options] Override http request option.
|
||||||
|
|||||||
@ -27,4 +27,12 @@ export interface ResetPwdUserInput {
|
|||||||
* @memberof ResetPwdUserInput
|
* @memberof ResetPwdUserInput
|
||||||
*/
|
*/
|
||||||
id: number;
|
id: number;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新密码(如果为空使用系统配置的默认密码)
|
||||||
|
*
|
||||||
|
* @type {string}
|
||||||
|
* @memberof ResetPwdUserInput
|
||||||
|
*/
|
||||||
|
newPassword?: string | null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export default {
|
|||||||
member: '会员',
|
member: '会员',
|
||||||
other: '其他',
|
other: '其他',
|
||||||
accountStatusUpdateSuccess: '账号状态设置成功',
|
accountStatusUpdateSuccess: '账号状态设置成功',
|
||||||
confirmResetPassword: '确定重置密码:【{account}】?',
|
confirmResetPassword: '请输入【{account}】的新密码,如果不填将使用默认密码',
|
||||||
passwordResetSuccess: '密码重置成功为:{password}',
|
passwordResetSuccess: '密码重置成功为:{password}',
|
||||||
confirmUnlockAccount: '确定解除登录锁定:【{account}】?',
|
confirmUnlockAccount: '确定解除登录锁定:【{account}】?',
|
||||||
unlockSuccess: '解除登录锁定成功',
|
unlockSuccess: '解除登录锁定成功',
|
||||||
|
|||||||
@ -293,14 +293,18 @@ const changeStatus = (row: any) => {
|
|||||||
|
|
||||||
// 重置密码
|
// 重置密码
|
||||||
const resetQueryPwd = async (row: any) => {
|
const resetQueryPwd = async (row: any) => {
|
||||||
ElMessageBox.confirm(t('message.list.confirmResetPassword', { account: row.account }), t('message.list.hint'), {
|
ElMessageBox.prompt(
|
||||||
confirmButtonText: t('message.list.confirmButtonText'),
|
t('message.list.confirmResetPassword', { account: row.account }),
|
||||||
cancelButtonText: t('message.list.cancelButtonText'),
|
t('message.list.resetPassword'),
|
||||||
type: 'warning',
|
{
|
||||||
})
|
confirmButtonText: t('message.list.confirmButtonText'),
|
||||||
.then(async () => {
|
cancelButtonText: t('message.list.cancelButtonText'),
|
||||||
|
type: 'warning',
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(async ({ value }) => {
|
||||||
await getAPI(SysUserApi)
|
await getAPI(SysUserApi)
|
||||||
.apiSysUserResetPwdPost({ id: row.id })
|
.apiSysUserResetPwdPost({ id: row.id, newPassword: value })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
ElMessage.success(t('message.list.passwordResetSuccess', { password: res.data.result }));
|
ElMessage.success(t('message.list.passwordResetSuccess', { password: res.data.result }));
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user