thumbnail

회원의 프로필 정보 받기

본 API는 알파버전으로서 변경될 수 있습니다.

본 API는 알파버전으로서 변경될 수 있습니다.

사이트 상에서 현재 회원에 대한 정보를 받는 방법은 두 가지가 있습니다.

MEMBER_HASH 라는 변수가 전역으로 설정되어 있기 때문에 바로 호출이 가능합니다.

Plaintext
console.log(MEMBER_HASH);
//응답값 예제 : 07a3095627505d73e50c59e6cc907e8dd71a7993

다음과 같이 호출하면 현재 회원에 대한 프로필 정보를 응답합니다.

Plaintext
//예제
var requestUserProfile = function(type,result){
	$.ajax({
		"type": "GET",
		"url": "/ajax/get_user_profile.cm",
		"data": { "type": type, "__" : MEMBER_HASH }, //MEMBER_HASH 값을 보내서 조회
		"dataType": "json",
		"async": false,
		"success": function(res) {
			if ( res.msg === "SUCCESS" ) {
				if( typeof res.profile === "undefined"){
					result({});
				}else{
					result(res.profile);
				}
			}
		}
	});
};

var getUserProfile = function(){
	var data = {};
	requestUserProfile("ALL", function(result){
		$.extend(data, result);
	});
	return data;
};

var user_profile = getUserProfile();
console.log( JSON.stringify(user_profile) );

//응답값 예졔 : {"name":"홍길동","mobileNumber":"01012345678","email":"example@campaignus.do","avatarUrl":"https://cdn.imweb.me/thumbnail/20230101/123456789.png","joinTime":1593533715000,"group":"일반회원","loginCount":10,"reviewCount":0,"qnaCount":0,"postCount":264,"commentCount":1,"unsubscribeTexting":true,"unsubscribeEmail":true,"pointAmount":0,"couponCount":0,"purchasedCount":9,"purchasedAmount":100,"returnCount":0,"wishCount":1,"cartCount":0,"cartAmount":0,"currency":"KRW"}