Showing
4 changed files
with
40 additions
and
0 deletions
... | @@ -14,6 +14,7 @@ | ... | @@ -14,6 +14,7 @@ |
14 | "react": "^17.0.2", | 14 | "react": "^17.0.2", |
15 | "react-dom": "^17.0.2", | 15 | "react-dom": "^17.0.2", |
16 | "react-scripts": "4.0.3", | 16 | "react-scripts": "4.0.3", |
17 | + "recoil": "^0.4.0", | ||
17 | "typescript": "^4.1.2", | 18 | "typescript": "^4.1.2", |
18 | "web-vitals": "^1.0.1" | 19 | "web-vitals": "^1.0.1" |
19 | }, | 20 | }, | ... | ... |
web/src/api/api-auth.ts
0 → 100644
1 | +import { client } from "./client"; | ||
2 | + | ||
3 | +export const authApi = { | ||
4 | + register : (Data : Object) => { | ||
5 | + return client.post('/auth/register', Data); | ||
6 | + }, | ||
7 | + | ||
8 | + login : (Data : Object) => { | ||
9 | + return client.post('/auth/login', Data); | ||
10 | + }, | ||
11 | + | ||
12 | + logout : () => { | ||
13 | + return client.post('/auth/logout'); | ||
14 | + }, | ||
15 | +}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
web/src/api/api-user.ts
0 → 100644
1 | +import { client } from './client'; | ||
2 | +import { RecoilState } from 'recoil'; | ||
3 | + | ||
4 | +export const userApi = { | ||
5 | + getMyInfo : (token : RecoilState<any>) => { | ||
6 | + return client.get('/user', { | ||
7 | + headers : { | ||
8 | + authorization : token, | ||
9 | + }, | ||
10 | + }); | ||
11 | + }, | ||
12 | +}; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -5340,6 +5340,11 @@ gzip-size@5.1.1: | ... | @@ -5340,6 +5340,11 @@ gzip-size@5.1.1: |
5340 | duplexer "^0.1.1" | 5340 | duplexer "^0.1.1" |
5341 | pify "^4.0.1" | 5341 | pify "^4.0.1" |
5342 | 5342 | ||
5343 | +hamt_plus@1.0.2: | ||
5344 | + version "1.0.2" | ||
5345 | + resolved "https://registry.yarnpkg.com/hamt_plus/-/hamt_plus-1.0.2.tgz#e21c252968c7e33b20f6a1b094cd85787a265601" | ||
5346 | + integrity sha1-4hwlKWjH4zsg9qGwlM2FeHomVgE= | ||
5347 | + | ||
5343 | handle-thing@^2.0.0: | 5348 | handle-thing@^2.0.0: |
5344 | version "2.0.1" | 5349 | version "2.0.1" |
5345 | resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" | 5350 | resolved "https://registry.yarnpkg.com/handle-thing/-/handle-thing-2.0.1.tgz#857f79ce359580c340d43081cc648970d0bb234e" |
... | @@ -9171,6 +9176,13 @@ readdirp@~3.5.0: | ... | @@ -9171,6 +9176,13 @@ readdirp@~3.5.0: |
9171 | dependencies: | 9176 | dependencies: |
9172 | picomatch "^2.2.1" | 9177 | picomatch "^2.2.1" |
9173 | 9178 | ||
9179 | +recoil@^0.4.0: | ||
9180 | + version "0.4.0" | ||
9181 | + resolved "https://registry.yarnpkg.com/recoil/-/recoil-0.4.0.tgz#2a933ba7c043cbf6f50f52da0828a879c7cd7d69" | ||
9182 | + integrity sha512-FZ2ljI4ldZU820V0APbKOtS4bPwPJHvpDBQEl+Cf47DMaM35wuLXl2u37E0TSgdvKAZBOUsIwcBnzE+ncODRxQ== | ||
9183 | + dependencies: | ||
9184 | + hamt_plus "1.0.2" | ||
9185 | + | ||
9174 | recursive-readdir@2.2.2: | 9186 | recursive-readdir@2.2.2: |
9175 | version "2.2.2" | 9187 | version "2.2.2" |
9176 | resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" | 9188 | resolved "https://registry.yarnpkg.com/recursive-readdir/-/recursive-readdir-2.2.2.tgz#9946fb3274e1628de6e36b2f6714953b4845094f" | ... | ... |
-
Please register or login to post a comment