diff --git a/yuthon_notice/models/yuthon_notice.py b/yuthon_notice/models/yuthon_notice.py index da2bdabd7..16f830e25 100644 --- a/yuthon_notice/models/yuthon_notice.py +++ b/yuthon_notice/models/yuthon_notice.py @@ -230,8 +230,10 @@ class YuthonNotice(models.Model): url=url, btntxt="详细信息" ) - if result_data and isinstance(result_data, list) and 'msgid' in result_data[-1]: - msg_id = result_data[-1]['msgid'] + if result_data and isinstance(result_data, tuple) and len(result_data) >= 2: + res_dict = result_data[1] + if res_dict.get('errcode') == 0 and res_dict.get('errmsg') == 'ok' and 'msgid' in res_dict: + msg_id = res_dict['msgid'] for mapping in user_wecom_mapping: emp_id = mapping['emp_id']