No Description

DDindex.html 2.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <!DOCTYPE html>
  2. <html lang="zh-CN">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>双汇售后服务平台</title>
  7. <!-- 引入飞书 JS SDK -->
  8. <link rel="shortcut icon" href="img/32.ico" />
  9. <script src="Script/Common/huayi.load.js"></script>
  10. <script src="Script/Common/huayi.config.js"></script>
  11. <script src="Script/Common/huayi.http.js"></script>
  12. <script type= "text/javascript" src= "https://lf-scm-cn.feishucdn.com/lark/op/h5-js-sdk-1.5.35.js"></script>
  13. </head>
  14. <body>
  15. <script>
  16. var wid = helper.request.queryString("wid");
  17. // 确保在 SDK 加载完成后再使用 window.tt
  18. document.addEventListener('DOMContentLoaded', function () {
  19. if (window.tt) {
  20. // 在这里可以使用 window.tt 进行后续操作
  21. window.tt.requestAccess({
  22. scopeList: ["contact:contact.base:readonly"],
  23. appID: "cli_a7242e417af7900c", // 网页应用必传
  24. success(res) {
  25. /*请求后台*/
  26. if (res.code) {
  27. $.ajax({
  28. type: "post",
  29. url: huayi.config.callcenter_url + "/Login/FeiShuilogin",
  30. dataType: 'json',
  31. async: true,
  32. data: {
  33. code: res.code
  34. },
  35. success: function (data) {
  36. /*验证请求*/
  37. if (data.state == "success") {
  38. $.cookie("token", data.data.token, { expires: 7 });
  39. window.location.href = "index.html";
  40. } else {
  41. layer.msg("登录失败");
  42. }
  43. }
  44. });
  45. }
  46. },
  47. fail(res) {
  48. alert(`requestAccess fail: ${JSON.stringify(res)}`);
  49. },
  50. });
  51. } else {
  52. alert('飞书 JS SDK 未正确加载');
  53. }
  54. });
  55. </script>
  56. </body>
  57. </html>