diff --git a/inventory_check/static/css/style.css b/inventory_check/static/css/style.css index 79e32be..3df316d 100644 --- a/inventory_check/static/css/style.css +++ b/inventory_check/static/css/style.css @@ -1,14 +1,14 @@ main { text-align: center; vertical-align: middle; - font-size: 25px; + font-size: 18px; } input { width: 4ch; text-align: center; } hr { - width: 450px; + width: 350px; height: 3px; } .grail{ @@ -20,7 +20,7 @@ hr { align-items: center; } .handler { - width: 450px; + width: 350px; display: flex; flex-wrap: wrap; align-content: space-between; @@ -29,8 +29,8 @@ hr { align-items: center; } button, input { - font-size: 25px; + font-size: 18px; } form { - width:450px; + width:350px; } \ No newline at end of file diff --git a/inventory_check/static/js/script.js b/inventory_check/static/js/script.js index 96cc806..6a33d2b 100644 --- a/inventory_check/static/js/script.js +++ b/inventory_check/static/js/script.js @@ -43,30 +43,52 @@ function checknext() { .catch(error => console.error('Error:', error)); } -function apiAuth() { - if (!window.h5sdk) { - alert("请在飞书客户端中打开"); - return; - } +// function apiAuth() { +// if (!window.h5sdk) { +// alert("请在飞书客户端中打开"); +// return; +// } - window.h5sdk.ready(() => { - tt.requestAccess({ - appID: "your_app_id", - scopeList: [], - success(res) { - // 将 code 发送到服务端 - fetch(`/callback?code=${res.code}`) - .then(response => response.json()) - .then(data => { - console.log("用户信息:", data); +// window.h5sdk.ready(() => { +// tt.requestAccess({ +// appID: "your_app_id", +// scopeList: [], +// success(res) { +// // 将 code 发送到服务端 +// fetch(`/callback?code=${res.code}`) +// .then(response => response.json()) +// .then(data => { +// console.log("用户信息:", data); +// // 在页面上展示用户姓名 +// document.getElementById("username").innerText = data.name; +// }); +// }, +// fail(err) { +// console.error("获取授权码失败:", err); +// } +// }); +// }); +// } +// apiAuth(); + +function apiAuth() { + tt.requestAccess({ + appID: "cli_a70da4f71bf1d00c", + scopeList: [], + success(res) { + // 将 code 发送到服务端 + fetch(`/callback?code=${res.code}`) + .then(response => response.json()) + .then(data => { + // console.log("用户信息:", data); // 在页面上展示用户姓名 - document.getElementById("username").innerText = data.name; + document.getElementById("username").innerText = data.name; }); - }, - fail(err) { - console.error("获取授权码失败:", err); + }, + fail(err) { + console.error("获取授权码失败:", err); } }); - }); -} + }; + apiAuth(); \ No newline at end of file diff --git a/inventory_check/templates/base.html b/inventory_check/templates/base.html index db2d20f..77704a1 100644 --- a/inventory_check/templates/base.html +++ b/inventory_check/templates/base.html @@ -16,7 +16,7 @@ {% block content %}{% endblock %}