diff --git a/smssend/smssend.py b/smssend/smssend.py index 401f6d8..2dc02dd 100644 --- a/smssend/smssend.py +++ b/smssend/smssend.py @@ -182,7 +182,7 @@ class SMSEngine: else: return None - async def check_sms_code(self, code_id: str, vcode: str) -> bool: + async def check_sms_code(self, code_id: str, vcode: str, mark_used: bool = True) -> bool: env = ServerEnv() async with get_sor_context(env, 'smssend') as sor: code_info = await sor.R('validatecode', {'id': code_id}) @@ -204,7 +204,8 @@ class SMSEngine: debug(f'check_sms_code():timeout ') return False - await sor.U('validatecode', {'id': code_id, 'del_flg': '1'}) + if mark_used: + await sor.U('validatecode', {'id': code_id, 'del_flg': '1'}) debug(f'check_sms_code(): return True ') return True