Skip to content

Commit

Permalink
fix(hotfix bug): oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
abalone0204 committed Jun 12, 2016
1 parent 04bfb9b commit b658663
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions front-end/app/API/checkAccessToken.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
export default function checkAccessToken({
access_token
}) {
const url = `https://graph.facebook.com/debug_token?input_token=${access_token}&access_token=${access_token}`
const url = `https://graph.facebook.com/me?access_token=${access_token}&fileds=email,id,name`
return fetch(url)
.then(checkStatus)
.then(parseJSON)
.then(response => {
return response.data.is_valid
return !!(response.id)
})

}
14 changes: 11 additions & 3 deletions front-end/app/components/CommentInput/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,16 @@ class CommentInput extends React.Component {
this.state = {
confirm: false,
showConfirm: false,
commentType: 'normal'
commentType: 'normal',
commentsWordCount: 0
}
}
handleChange(e) {
const {commentsWordCount} = this.state
// this.setState({commentsWordCount: })
console.log('e:', 501-this.refs.commentInput.value.length);


}
render() {
const {
Expand All @@ -20,7 +28,7 @@ class CommentInput extends React.Component {
changeUserIdentity,
sendCreateCommentRequest
} = this.props
const {showConfirm} =this.state
const {showConfirm, commentsWordCount} =this.state

const handleSubmit = (type) => (e) => {
if (!!this.refs.commentInput.value) {
Expand Down Expand Up @@ -59,7 +67,7 @@ class CommentInput extends React.Component {
showConfirm ?
<textarea disabled ref='commentInput' placeholder="對這份工作有什麼看法,或分享你的面試心得" styleName='comment-input' name="comment" cols="30" rows="7"></textarea>
:
<textarea ref='commentInput' placeholder="對這份工作有什麼看法,或分享你的面試心得" styleName='comment-input' name="comment" cols="30" rows="7"></textarea>
<textarea onChange={this.handleChange.bind(this)} ref='commentInput' placeholder="對這份工作有什麼看法,或分享你的面試心得" styleName='comment-input' name="comment" cols="30" rows="7"></textarea>
:
<textarea disabled placeholder="登入後才能留言" styleName='comment-input' name="comment" cols="30" rows="7"></textarea>
}
Expand Down

0 comments on commit b658663

Please sign in to comment.