Nessuna descrizione

DDindex.html 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. // console.log(wid)
  41. // if(wid){
  42. // window.location.href = "./WorkOrder/WorkOrderDetails.html?id="+wid
  43. // } else {
  44. // window.location.href = "index.html";
  45. // }
  46. } else {
  47. layer.msg("登录失败");
  48. }
  49. }
  50. });
  51. }
  52. },
  53. fail(res) {
  54. alert(`requestAccess fail: ${JSON.stringify(res)}`);
  55. },
  56. });
  57. } else {
  58. alert('飞书 JS SDK 未正确加载');
  59. }
  60. });
  61. </script>
  62. </body>
  63. </html>