maplestory/backend/services/nexon.js
caadiq 6c51e7d94d OAuth 제거, 닉네임 입력 방식으로 변경 및 관리자 페이지 추가
- 넥슨 OAuth 로그인 제거 (Redis, 세션, User 모델 등)
- 캐릭터 닉네임 입력 → API 키로 조회하는 방식으로 변경
- 관리자 페이지 추가 (/admin?key=<NEXON_API_KEY>)
- 보스 선택 UI를 3단 레이아웃(캐릭터/보스/결과)으로 리디자인
- 캐릭터 및 보스 선택 데이터 localStorage 저장

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-11 18:02:32 +09:00

19 lines
598 B
JavaScript

import axios from 'axios';
const NEXON_API_BASE = 'https://open.api.nexon.com';
export async function getCharacterOcid(characterName) {
const { data } = await axios.get(`${NEXON_API_BASE}/maplestory/v1/id`, {
params: { character_name: characterName },
headers: { 'x-nxopen-api-key': process.env.NEXON_API_KEY },
});
return data.ocid;
}
export async function getCharacterBasic(ocid) {
const { data } = await axios.get(`${NEXON_API_BASE}/maplestory/v1/character/basic`, {
params: { ocid },
headers: { 'x-nxopen-api-key': process.env.NEXON_API_KEY },
});
return data;
}