diff --git a/adm/sms_admin/member_update.php b/adm/sms_admin/member_update.php index 6b6b5caa7..baae01d76 100644 --- a/adm/sms_admin/member_update.php +++ b/adm/sms_admin/member_update.php @@ -4,8 +4,6 @@ include_once("./_common.php"); auth_check_menu($auth, $sub_menu, "r"); -$token = get_token(); - $g5['title'] = "회원정보 업데이트"; include_once(G5_ADMIN_PATH.'/admin.head.php'); @@ -39,21 +37,39 @@ include_once(G5_ADMIN_PATH.'/admin.head.php'); $( "#mb_update_form" ).submit(function( e ) { e.preventDefault(); $("#res_msg").html('업데이트 중입니다. 잠시만 기다려 주십시오...'); - var params = { mtype : 'json', token : '' }; + var action = $(this).attr("action"); $.ajax({ - url: $(this).attr("action"), - cache:false, - timeout : 30000, - dataType:"json", - data:params, - success: function(data) { - if(data.error){ - alert( data.error ); + url: '/ajax.token.php', + type: 'POST', + dataType: 'json', + data: { admin_csrf_token_key: '' }, + success: function(tokenData) { + if(tokenData.error){ + alert(tokenData.error); $("#res_msg").html(""); - } else { - $("#datetime").html( data.datetime ); - $("#res_msg").html( data.res_msg ); + return; } + $.ajax({ + url: action, + type: 'POST', + cache:false, + timeout : 30000, + dataType:"json", + data: { mtype : 'json', token : tokenData.token }, + success: function(data) { + if(data.error){ + alert( data.error ); + $("#res_msg").html(""); + } else { + $("#datetime").html( data.datetime ); + $("#res_msg").html( data.res_msg ); + } + }, + error: function (xhr, ajaxOptions, thrownError) { + alert(xhr.status); + alert(thrownError); + } + }); }, error: function (xhr, ajaxOptions, thrownError) { alert(xhr.status);