diff --git a/api.py b/api.py
index f977f7f..455179c 100644
--- a/api.py
+++ b/api.py
@@ -17,7 +17,7 @@ def facebookAuth(token):
else:
return False, None, None
-@app.route('/courseTable', methods=["POST"])
+@app.route('/courseTable', methods=["GET"])
def get():
# 若 access code 通過 facebook 驗證
status, uid, name = facebookAuth(request.values['token'])
diff --git a/index.html b/index.html
index 97e9a71..c41a714 100644
--- a/index.html
+++ b/index.html
@@ -18,47 +18,6 @@
-
-
-
-
-
-
-
@@ -77,7 +36,7 @@
-
+
diff --git a/js/index.vue b/js/index.vue
index 7dc7eee..5d7a6eb 100644
--- a/js/index.vue
+++ b/js/index.vue
@@ -7,6 +7,27 @@ var vm = new Vue({
'selectDepartment': '',
'foundName': "",
},
+ created() {
+ window.fbAsyncInit = function() {
+ FB.init({
+ appId : '',
+ cookie : true,
+ xfbml : true,
+ version : 'v9.0'
+ });
+
+ FB.AppEvents.logPageView();
+ vm.checkLogin()
+ };
+
+ (function(d, s, id){
+ var js, fjs = d.getElementsByTagName(s)[0];
+ if (d.getElementById(id)) {return;}
+ js = d.createElement(s); js.id = id;
+ js.src = "https://connect.facebook.net/en_US/sdk.js";
+ fjs.parentNode.insertBefore(js, fjs);
+ }(document, 'script', 'facebook-jssdk'));
+ },
mounted() {
axios
.get("./output.json")
@@ -25,6 +46,18 @@ var vm = new Vue({
})
},
methods: {
+ 'checkLogin': function(){
+ console.log("check login")
+ FB.getLoginStatus(function(response) {
+ vm.statusChangeCallback(response);
+ });
+ },
+ 'statusChangeCallback': function(response){
+ console.log(response)
+ if(response.status == "connected"){
+
+ }
+ },
'getTime': function(timeString){
ans = []
number = ""