-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: QR 결제 클래스 날짜 제외 * feat: 호스트 여부 판단 api * feat: 호스트 등록 api 연동 * feat: 클래스 등록 api 연동 * fix: console 삭제 및 주소창 zindex 높임 --------- Co-authored-by: seoyeon Moon <[email protected]>
- Loading branch information
Showing
18 changed files
with
282 additions
and
223 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import axios, { AxiosInstance } from 'axios'; | ||
import { API_BASE_URL } from './url'; | ||
import { getCookie } from '../utils/cookie'; | ||
|
||
export class ImageApiClient { | ||
private static instance: ImageApiClient; | ||
private axiosImgInstance: AxiosInstance; | ||
|
||
constructor() { | ||
this.axiosImgInstance = this.createImageAxiosInstance(); | ||
} | ||
|
||
// 이미지 업로드 | ||
async postLessonImg(formData: FormData) { | ||
console.log('ddddfsdjf>>', formData); | ||
const response = await this.axiosImgInstance.request<string>({ | ||
method: 'post', | ||
url: '/lesson/image-upload', | ||
data: formData, | ||
}); | ||
return response.data; | ||
} | ||
|
||
static getImageInstance(): ImageApiClient { | ||
return this.instance || (this.instance = new this()); | ||
} | ||
|
||
// registerToken(newToken: string) { | ||
// this.axiosInstance = this.createAxiosInstance(newToken); | ||
// } | ||
|
||
logout() { | ||
this.axiosImgInstance = this.createImageAxiosInstance(); | ||
} | ||
|
||
private createImageAxiosInstance = () => { | ||
const headers: any = { | ||
'content-type': 'multipart/form-data', | ||
}; | ||
|
||
const newInstance = axios.create({ | ||
baseURL: API_BASE_URL, | ||
timeout: 100000, | ||
headers, | ||
}); | ||
|
||
newInstance.interceptors.request.use( | ||
(config) => { | ||
const TOKEN = getCookie('token'); | ||
if (TOKEN) { | ||
config.headers['Authorization'] = `Bearer ${TOKEN}`; | ||
} | ||
|
||
config.headers['Content-Type'] = 'multipart/form-data'; | ||
return config; | ||
}, | ||
(error) => { | ||
console.log(error); | ||
return Promise.reject(error); | ||
} | ||
); | ||
|
||
return newInstance; | ||
}; | ||
} |
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
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,17 @@ | ||
export const InfoHost = [ | ||
{ | ||
title: '호스트 등록', | ||
desc: `간편한 방법으로\n호스트가 되어보세요.`, | ||
image: '/images/openlesson1.gif', | ||
}, | ||
{ | ||
title: '클래스 개설 및 운영', | ||
desc: '진행할 클래스를 등록하고 운영해보세요.', | ||
image: '/images/openlesson2.gif', | ||
}, | ||
{ | ||
title: '정산 및 수익 관리', | ||
desc: `매 수업마다 정산을 받을 수 있어요.\n하나펀에서 제공하는\n월별 수익 관리를 받아보세요.`, | ||
image: '/images/openlesson3.gif', | ||
}, | ||
]; |
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 was deleted.
Oops, something went wrong.
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.