Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-2_open_source_sw_development_Han
/
Jaksimsamil
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
redbean096@khu.ac.kr
2020-12-09 11:18:15 +0000
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ae758d3b50053c4345df45e13d883a0e59e99e85
ae758d3b
1 parent
d3a78919
delete unecessary code and module
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
2 additions
and
90 deletions
jaksimsamil-page/.eslintcache
jaksimsamil-page/src/components/home/HomeForm.js
jaksimsamil-page/src/components/setting/KakaoLogin.js
jaksimsamil-page/src/containers/setting/SettingContainer.js
jaksimsamil-page/src/lib/api/auth.js
jaksimsamil-page/src/scripts/getRecommend.js
jaksimsamil-page/.eslintcache
View file @
ae758d3
This diff is collapsed. Click to expand it.
jaksimsamil-page/src/components/home/HomeForm.js
View file @
ae758d3
...
...
@@ -3,7 +3,7 @@ import { makeStyles } from '@material-ui/core/styles';
import
Paper
from
'@material-ui/core/Paper'
;
import
Grid
from
'@material-ui/core/Grid'
;
import
palette
from
'../../lib/styles/palette'
;
import
AuthForm
from
'../auth/AuthForm'
;
const
useStyles
=
makeStyles
((
theme
)
=>
({
root
:
{
flexGrow
:
1
,
...
...
jaksimsamil-page/src/components/setting/KakaoLogin.js
deleted
100644 → 0
View file @
d3a7891
import
React
from
'react'
;
import
getRecommend
from
"../../scripts/getRecommend"
;
const
KakaoLoginBtn
=
()
=>
{
const
KakaoLogin
=
function
()
{
window
.
Kakao
.
Auth
.
login
({
success
:
getRecommend
,
fail
:
function
(
err
)
{
console
.
log
(
"login failed"
,
err
);
}
})
}
return
(
<
div
>
<
button
onClick
=
{
KakaoLogin
}
a
id
=
"custom-login-btn"
href
=
"javascript:loginWithKakao()"
>
<
img
src
=
"//k.kakaocdn.net/14/dn/btqCn0WEmI3/nijroPfbpCa4at5EIsjyf0/o.jpg"
width
=
"140"
/>
<
/button
>
<
/div
>
);
};
export
default
KakaoLoginBtn
\ No newline at end of file
jaksimsamil-page/src/containers/setting/SettingContainer.js
View file @
ae758d3
...
...
@@ -75,7 +75,7 @@ const SettingContainer = ({ history }) => {
}
},
[
dispatch
,
user
,
history
]);
useEffect
(()
=>
{
if
(
loading
[
'profile/SYNC_BJID'
]
==
true
)
{
if
(
loading
[
'profile/SYNC_BJID'
])
{
setLoading
(
true
);
}
else
{
setLoading
(
false
);
...
...
jaksimsamil-page/src/lib/api/auth.js
View file @
ae758d3
...
...
@@ -9,8 +9,3 @@ export const register = ({ username, password }) =>
export
const
check
=
()
=>
client
.
get
(
'api/auth/check'
);
export
const
logout
=
()
=>
client
.
post
(
'/api/auth/logout'
);
export
const
kakaotoken
=
(
kakaotoken
)
=>
client
.
post
(
'api/auth/kakaotoken'
,
{
kakaotoken
:
kakaotoken
});
...
...
jaksimsamil-page/src/scripts/getRecommend.js
deleted
100644 → 0
View file @
d3a7891
const
app
=
require
(
'koa'
)
function
getRecommend
(
auth
)
{
console
.
log
(
"login success"
,
auth
);
const
host
=
'https://localhost:23023'
;
const
url
=
host
+
"/api/profile/recommend"
;
const
data
=
{
username
:
'test'
};
window
.
fetch
(
url
,
{
method
:
"POST"
,
body
:
JSON
.
stringify
(
data
),
headers
:
{
'Content-Type'
:
'application/json'
}
})
.
then
(
res
=>
{
console
.
log
(
res
);
return
res
.
json
();
})
.
then
(
shareToKakao
);
}
const
TOKEN
=
'tdN03DyXDAcKGZsuiPndaU7UC2GzuEQYUhPCkDnGWXGGdiPmV15QYbFU1U5JP5EpiETIKLqOmci/RxFZTfD7FRMED0OpT+3qgEYBNf8T9/jRzHRm7rblBLtzFBVOeXeYRcluOsz4koE4JaAJaUtMtwdB04t89/1O/w1cDnyilFU='
function
shareToKakao
({
problem_number
,
problem_title
,
solved_date
})
{
console
.
log
(
'getting ready to share...'
);
const
boj_link
=
"https://acmicpc.net/problem/"
+
problem_number
.
toString
();
window
.
fetch
(
'https://www.osstest17.ml:23023/hook'
,
{
method
:
"POST"
,
body
:
JSON
.
stringify
(
data
),
headers
:
{
'Authorization'
:
`Bearer
${
TOKEN
}
`
},
json
:
{
"replyToken"
:
eventObj
.
replyToken
,
"messages"
:[
{
"type"
:
"text"
,
"text"
:
"Hello, user"
},
{
"type"
:
"text"
,
"text"
:
"May I help you?"
}
]
}
})
window
.
Kakao
.
Link
.
sendDefault
({
objectType
:
'text'
,
text
:
`오늘의 추천문제는
${
problem_title
}
`
,
link
:
{
mobileWebUrl
:
boj_link
,
webUrl
:
boj_link
,
}
});
}
export
{
getRecommend
as
default
};
\ No newline at end of file
Please
register
or
login
to post a comment