| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566 |
- <!DOCTYPE html>
- <html lang="zh-CN">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <title>双汇售后服务平台</title>
- <!-- 引入飞书 JS SDK -->
- <link rel="shortcut icon" href="img/32.ico" />
- <script src="Script/Common/huayi.load.js"></script>
- <script src="Script/Common/huayi.config.js"></script>
- <script src="Script/Common/huayi.http.js"></script>
- <script type= "text/javascript" src= "https://lf-scm-cn.feishucdn.com/lark/op/h5-js-sdk-1.5.35.js"></script>
- </head>
- <body>
- <script>
- var wid = helper.request.queryString("wid");
- // 确保在 SDK 加载完成后再使用 window.tt
- document.addEventListener('DOMContentLoaded', function () {
- if (window.tt) {
- // 在这里可以使用 window.tt 进行后续操作
- window.tt.requestAccess({
- scopeList: ["contact:contact.base:readonly"],
- appID: "cli_a7242e417af7900c", // 网页应用必传
- success(res) {
- /*请求后台*/
- if (res.code) {
- $.ajax({
- type: "post",
- url: huayi.config.callcenter_url + "/Login/FeiShuilogin",
- dataType: 'json',
- async: true,
- data: {
- code: res.code
- },
- success: function (data) {
- /*验证请求*/
- if (data.state == "success") {
- $.cookie("token", data.data.token, { expires: 7 });
- window.location.href = "index.html";
- // console.log(wid)
- // if(wid){
- // window.location.href = "./WorkOrder/WorkOrderDetails.html?id="+wid
- // } else {
- // window.location.href = "index.html";
- // }
-
- } else {
- layer.msg("登录失败");
- }
- }
- });
- }
-
- },
- fail(res) {
- alert(`requestAccess fail: ${JSON.stringify(res)}`);
- },
- });
-
- } else {
- alert('飞书 JS SDK 未正确加载');
- }
- });
- </script>
- </body>
- </html>
|