////发布的时候,全部置为空 var userid = ""//"10876168-b21d-481e-9a02-1edb5af9853f"; var username = ""//"蔺雪峰"; var oatoken = ""//"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMDg3NjE2OC1iMjFkLTQ4MWUtOWEwMi0xZWRiNWFmOTg1M2YiLCJjbGllbnRpZCI6ImFuZHJvaWRjbGllbnQiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIFJlZmluZUFQSSIsImV4cCI6MTcwMzk2MDAxMiwiY29uZmlnIjoiMjAyMC0yMDk5In0.9z4RMfCPldMBXaaBuLB_1FEy5VQX2hQt1smTI86nqAM"; var avatar = ""//"http://192.168.3.101:8088/fs/avatar/show/2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf"; var maintoken = "" var postCfg; //"eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4YTY5OTY2NDg4ODUyMmFhMDE4OGEwMGNjNjA3NjY1MyIsImFwcE5hbWUiOiJPQeWKnuWFrOeuoeeQhiIsImFwcENvZGUiOiJvYWJnZ2wiLCJ0eXBlIjoiVVNFUl9QQVNTV09SRCIsInVzZXJOYW1lIjoi6JS66Zuq5bOwIiwidXNlcklkIjoiOGE2OTk2NjQ4ODg1MjJhYTAxODhhMDBjYzYwNzY2NTMiLCJzZWNyZXRMZXZlbCI6MCwicmFuZG9tIjoiZkJYOGwzIiwibG9naW5OYW1lIjoibGlueHVlZmVuZyIsImFwcElkIjoiOGE1MDJjOGU4NWY2MWQ2YjAxODYyYWJkNzg3MjI1M2EiLCJEc3BUb2tlbiI6Ijc3N2U3YWJiNjUxMmIyZjExZjlkMjBiMWRjZTMwOWQwMTIyYjNkN2IzNmFjNjAxMTExN2Y2OWNlNjcxMDAxMGU1YzNhMWY2NWM3NjgwN2EwIiwiZXhwIjoxNzAwMzYzNjk3LCJpYXQiOjE3MDAzNjAwOTd9.8SIbHoBe-7hiwhzJVWbjTJ9ecEJmWYh9igrjXIVgfTo" window.addEventListener("flutterInAppWebViewPlatformReady", function () { window.flutter_inappwebview .callHandler("getuserinfo", "") .then(function (res) { userid = res.username; username = res.name; oatoken = res.oatoken; avatar = res.avatar; $.cookie("GlWorkPlatform-userid", userid); $.cookie("GlWorkPlatform-chineseName", username); $.cookie("GlWorkPlatform-photo", "AFrontEnd/css/icons/photo/02.jpg", { path: '/', expires: 1 }); localStorage.setItem("GlWorkPlatform-AccessToken", oatoken); self.userId = $.cookie("GlWorkPlatform-userid")//userid; self.userCName = $.cookie("GlWorkPlatform-chineseName")//username; self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken")//oatoken; postCfg = { headers: { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.get_AccessToken } }; angular.element(document.getElementById('app')).scope().initMainToken(); console.log("getuserinfo==self.get_AccessToken=" + self.get_AccessToken + "=apiurljs.login=" + apiurljs.login + "======self.userId=" + self.userId + "=======" + JSON.stringify(res)); }) }); function jumpPageParent(id, title, src) { var setID = "indexpad_page_" + id; if ($("#iframePart").find("#" + setID).length < 1) { //$(".sp-wrapper-tabs-box-col").hide(); $("#iframePart .indexpad-page").removeClass("indexpad-current"); $("#iframePart").append("
"); //$("#" + setID).show(); sp.fitHeight("#iframe_" + setID + "", 0); //设置iframe的高度 } else { //$(".sp-wrapper-tabs-box-current").hide(); $(".indexpad-page").removeClass("indexpad-current"); var get_oldurl = $("#iframe_" + setID + "").attr("src"); if (get_oldurl != src) { $("#" + setID).addClass("indexpad-current"); //$("#" + setID).show(); $("#" + setID + " iframe").attr("src", src); ////然后让里面的iframe重新加载点击后的页面 } else { $("#" + setID).addClass("indexpad-current"); } sp.fitHeight("#iframe_" + setID + "", 0); //设置iframe的高度 } //setTimeout(function () { // var WindowHeight = $(window).height(); // var WindownWidth = $(window).width(); // alert("得到屏幕宽度:" + WindownWidth + ", 屏幕高度:" + WindowHeight); //}, 1000); } setTimeout(function () { /*postCfg = { headers: { 'Content-Type': 'application/json', 'Authorization': "Bearer " + self.get_AccessToken } }; $.cookie("GlWorkPlatform-userid", userid, { path: '/', expires: 1 }); $.cookie("GlWorkPlatform-chineseName", username, { path: '/', expires: 1 }); $.cookie("GlWorkPlatform-photo", "AFrontEnd/css/icons/photo/02.jpg", { path: '/', expires: 1 }); localStorage.setItem("GlWorkPlatform-AccessToken", oatoken); */ //localStorage.setItem("main-token", maintoken); jumpPageParent("FZ0", "桌面", "tpl/_indexgmtpad/index_2.html"); }, 200); ///增加设备标识 localStorage.setItem("tjJxtGoldenlinkWork-deviceType", "pad"); //左侧的动态新动态菜单采用angularJS的方式渲染 var app = angular.module('app', []); app.controller("leftPartCtrl", ["$scope", "$http", "$interval", "$timeout", function ($scope, $http, $interval, $timeout) { var self = this; var s4 = new SM4Util(); self.goBackHome = function () { jumpPageParent("FZ0", "桌面", "tpl/_indexgmtpad/index_2.html"); } //获取上传附件文件格式限制----20230517 uploadformat = []; function getUploadFormat() { var data = { tablename: "CODE_UPLOADFORMAT" } $http.post(apiurljs.login + "g2app/DangAn/queryCodeData", { data: s4.encryptData_CBC(JSON.stringify(data)) }, postCfg) .success(function (obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); uploadformat = res.data; }) }; //获取大平台token self.getMainToken = function () { //self.userId="10876168-b21d-481e-9a02-1edb5af9853f"; $http.post(apiurljs.login + "g2app/usercertification/querySSOToken", { data: s4.encryptData_CBC(JSON.stringify({ userid: self.userId })) }, postCfg) .success(function (obj) { var res = strToJson(s4.decryptData_CBC(obj.data)) localStorage.setItem("main-token", res.data); console.log("getMainToken()===postCfg=" + JSON.stringify(postCfg) + "====new1==userid====" + self.userId + "==main-token======" + localStorage.getItem("main-token")); self.outToken = res.data; }) } $interval(function () { var data = { token: self.outToken } $http.post(apiurljs.login + "g2app/usercertification/loginToken", JSON.stringify(data), postCfg) .success(function (obj) { var res = strToJson(s4.decryptData_CBC(obj.data)); if (res.success == true) { localStorage.setItem("main-token", res.data); console.log("main-token=======new2=========" + localStorage.getItem("main-token")); self.outToken = res.data; } }) }, 21600000) $scope.initMainToken = function () { self.userId = $.cookie("GlWorkPlatform-userid") self.userCName = $.cookie("GlWorkPlatform-chineseName") self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken") getUploadFormat() self.getMainToken() } }]);