123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- ////发布的时候,全部置为空
- 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 = ""//"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;
- //console.log(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("<div class=\"indexpad-page indexpad-current\" id=\"" + setID + "\"><iframe id=\"iframe_" + setID + "\" src=\"" + src + "\" width=\"100%\" height=\"100%\" frameborder=\"0\" scrolling=\"auto\"></iframe></div>");
- //$("#" + 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.userId = $.cookie("GlWorkPlatform-userid")//userid;
- self.userCName = $.cookie("GlWorkPlatform-chineseName")//username;
- self.get_AccessToken = localStorage.getItem("GlWorkPlatform-AccessToken")//oatoken;
- //self.outToken = maintoken;
- var postCfg = {
- headers: {
- 'Content-Type': 'application/json',
- 'Authorization': "Bearer " + self.get_AccessToken
- }
- };
- 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;
- })
- };
- getUploadFormat()
- //获取大平台token
- self.getMainToken = function () {
- $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);
- self.outToken = res.data;
- })
- }
- self.getMainToken()
- $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);
- self.outToken = res.data;
- }
- })
- }, 21600000)
- }]);
|