오윤석

indexOf가 0인 경우도 찾은 경우임

...@@ -21,7 +21,7 @@ const getCharacterInfo = async function(nickname, characterCode) { ...@@ -21,7 +21,7 @@ const getCharacterInfo = async function(nickname, characterCode) {
21 try { 21 try {
22 const resp = await axios.get("https://maplestory.nexon.com/Common/Character/Detail/" + encodeURI(nickname) + "?p=" + characterCode); 22 const resp = await axios.get("https://maplestory.nexon.com/Common/Character/Detail/" + encodeURI(nickname) + "?p=" + characterCode);
23 23
24 - if (resp.data.indexOf("공개하지 않은 정보입니다.") > 0) { 24 + if (resp.data.indexOf("공개하지 않은 정보입니다.") >= 0) {
25 throw new Error("private_character"); 25 throw new Error("private_character");
26 } 26 }
27 27
...@@ -125,7 +125,7 @@ const analyzeEquipment = async function(nickname, characterCode, job) { ...@@ -125,7 +125,7 @@ const analyzeEquipment = async function(nickname, characterCode, job) {
125 try { 125 try {
126 const resp = await axios.get("https://maplestory.nexon.com/Common/Character/Detail/" + encodeURI(nickname) + "/Equipment?p=" + characterCode); 126 const resp = await axios.get("https://maplestory.nexon.com/Common/Character/Detail/" + encodeURI(nickname) + "/Equipment?p=" + characterCode);
127 127
128 - if (resp.data.indexOf("공개하지 않은 정보입니다.") > 0) { 128 + if (resp.data.indexOf("공개하지 않은 정보입니다.") >= 0) {
129 throw new Error("private_character"); 129 throw new Error("private_character");
130 } 130 }
131 131
......