-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
212 additions
and
178 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import callApi from '../../utils/api'; | ||
|
||
// [bad] | ||
|
||
export type getSummonerRes = { | ||
id: string, | ||
accountId: string, | ||
puuid: string, | ||
name: string, | ||
profileIconId: number, | ||
revisionDate: number, | ||
summonerLevel: number | ||
export type updateLolInfoProps = { | ||
result: 1 | -1; | ||
idx: string; | ||
id: string; | ||
nickname: string; | ||
profileImageUrl: string; | ||
lolTear: string; | ||
lolLevel: string; | ||
lolLane: string; | ||
lolChampion: string; | ||
}; | ||
export const getSummoner = function(nickname: string) { | ||
const url = `https://kr.api.riotgames.com/lol/summoner/v4/summoners/by-name/${nickname}?api_key=${process.env.REACT_APP_RIOT_API_KEY}`; | ||
return callApi.get<{}, getSummonerRes>(url); | ||
export const updateLolInfo = function (idx: string) { | ||
return callApi.get<{}, updateLolInfoProps>(`users/lolInfo/${idx}`); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { loginReq, signupReq } from '.'; | ||
|
||
interface signupVerifyProps extends signupReq { | ||
rPassword: string; | ||
} | ||
export const signupVerify = (req: signupVerifyProps) => { | ||
if (req.id && req.password && req.nickname && req.rPassword) | ||
return { result: -1, message: '필수 입력칸이 비어있습니다.' }; | ||
if ( | ||
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test( | ||
req.id, | ||
) | ||
) | ||
return { result: -1, message: '이메일 형식이 아닙니다.' }; | ||
if ( | ||
!/(?=.*\d{1,50})(?=.*[~`!@#$%&*()-+=]{1,50})(?=.*[a-zA-Z]{1,50}).{8,50}$/.test( | ||
req.password, | ||
) | ||
) | ||
return { | ||
result: -1, | ||
message: | ||
'비밀번호는 숫자, 영문, 특수문자를 포함하며, 8자리 이상 이여야 합니다.', | ||
}; | ||
if (req.password !== req.rPassword) | ||
return { result: -1, message: '비밀번호 두개가 다릅니다.' }; | ||
|
||
return { result: 1, message: '' }; | ||
}; | ||
|
||
export const loginVerify = (req: loginReq) => { | ||
if (req.id && req.password) | ||
return { result: -1, message: '필수 입력칸이 비어있습니다.' }; | ||
if ( | ||
!/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test( | ||
req.id, | ||
) | ||
) | ||
return { result: -1, message: '이메일 형식이 아닙니다.' }; | ||
return { result: 1, message: '' }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.