|
@@ -0,0 +1,82 @@
|
|
|
+<!DOCTYPE html>
|
|
|
+<html lang="en">
|
|
|
+
|
|
|
+<head>
|
|
|
+ <meta name="description" content="Webpage description goes here" />
|
|
|
+ <meta charset="utf-8">
|
|
|
+ <title>Change_me</title>
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1">
|
|
|
+ <meta name="author" content="">
|
|
|
+ <link rel="stylesheet" href="css/style.css">
|
|
|
+ <script src="http://code.jquery.com/jquery-latest.min.js"></script>
|
|
|
+ <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script>
|
|
|
+ <script src="https://static.line-scdn.net/liff/edge/2/sdk.js"></script>
|
|
|
+
|
|
|
+</head>
|
|
|
+
|
|
|
+<body>
|
|
|
+
|
|
|
+ <div class="container">
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <div id="like_button_container"></div>
|
|
|
+ <button onclick="exportcsv();">123</button>
|
|
|
+ <button onclick="login();">in</button>
|
|
|
+ <button onclick="logout();">out</button>
|
|
|
+ <button onclick="test();">test</button>
|
|
|
+ <div id="myGrid" style="height: 600px;width:800px;" class="ag-theme-alpine"></div>
|
|
|
+
|
|
|
+ <script>
|
|
|
+
|
|
|
+ var liffID = '1656493448-Oz6Xrx97';
|
|
|
+
|
|
|
+ function login() {
|
|
|
+ // 登入
|
|
|
+ liff.login({
|
|
|
+ // 使用者登入後要去到哪個頁面
|
|
|
+ redirectUri: 'https://m3.hhh.com.tw/yo/test.html',
|
|
|
+ target: '_blank'
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ function logout() {
|
|
|
+ // 登出
|
|
|
+ liff.logout();
|
|
|
+ }
|
|
|
+
|
|
|
+ liff.init({
|
|
|
+ liffId: liffID
|
|
|
+ }).then(function () {
|
|
|
+ console.log('LIFF init');
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
+ function test() {
|
|
|
+ // 這邊開始寫使用其他功能
|
|
|
+ // 取得使用者類型資料
|
|
|
+ var context = liff.getContext();
|
|
|
+ console.log(context);
|
|
|
+
|
|
|
+ // 取得使用者公開資料
|
|
|
+ // 後台的「Scopes」要設定開啟 profile, openid
|
|
|
+ liff.getProfile()
|
|
|
+ .then(function (profile) {
|
|
|
+ console.log(profile);
|
|
|
+ });
|
|
|
+
|
|
|
+ // 取得使用者 email
|
|
|
+ // 後台的 Email address permission 要是「Applied」
|
|
|
+ // LIFF 的設定,Scopes 的「email*」要打勾
|
|
|
+ // 使用者在登入時,「電子郵件帳號」也要是「許可」的
|
|
|
+ var user = liff.getDecodedIDToken();
|
|
|
+ var email = user.email;
|
|
|
+ console.log(email);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ </script>
|
|
|
+
|
|
|
+</body>
|
|
|
+
|
|
|
+</html>
|