redbean096@khu.ac.kr

Merge branch 'kakaoDev' of http://khuhub.khu.ac.kr/2020-2_open_source_sw_develop…

…ment_Han/Jaksimsamil into lineDev
import React from 'react';
const LineQR = () => {
return (
<div>
<img
src="https://qr-official.line.me/sid/L/215xiena.png"
width="130"
/>
</div>
);
};
export default LineQR
\ No newline at end of file
......@@ -8,7 +8,7 @@ import Paper from '@material-ui/core/Paper';
import Grid from '@material-ui/core/Grid';
import CircularProgress from '@material-ui/core/CircularProgress';
import styled from 'styled-components';
import KakaoLoginBtn from './KakaoLogin'
import LineQR from './LineQR'
const useStyles = makeStyles((theme) => ({
root: {
......@@ -84,11 +84,8 @@ const SettingForm = ({
<Grid container item xs={6}>
<Paper className={classes.paper} elevation={3}>
<h1>카카오 로그인</h1>
<KakaoLoginBtn
profile={profile}
onChange={onChange}
/>
<h1>QR코드를 찍어주세요</h1>
<LineQR></LineQR>
</Paper>
</Grid>
......
const app = require('koa')
function getRecommend(auth) {
console.log("login success", auth);
const host = 'http://localhost:23023';
const host = 'https://localhost:23023';
const url = host+"/api/profile/recommend";
const data = { username: 'test' };
window.fetch(url, {
method: "POST",
......@@ -16,10 +18,31 @@ function getRecommend(auth) {
})
.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}`,
......@@ -29,7 +52,6 @@ function shareToKakao({problem_number, problem_title, solved_date}) {
}
});
}
export {
getRecommend as default
};
\ No newline at end of file
......