| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307 |
- <!DOCTYPE html>
- <html xml:lang="zh-CN" style="height: 100%;">
- <head lang="en">
- <meta http-equiv="X-UA-Compatible" content="IE=edge" />
- <meta charset="UTF-8">
- <title></title>
- <link rel="stylesheet" type="text/css" href="css/style.css" charset="UTF-8" />
- <link rel="stylesheet" href="css/mBoxNotice.css" charset="UTF-8" />
- <link rel="stylesheet" href="css/mBoxTooltip.css" charset="UTF-8" />
- <!-- <script src="res/framework/mootools/mootools-core-1.4.5-full-nocompat.js"></script>-->
- <!-- <script src="res/framework/mootools/mootools-more-1.4.0.1-all_2.js"></script>-->
- <script src="../o2_core/o2.min.js"></script>
- <script src="../o2_lib/Decimal.js"></script>
- <script src="js/base_simple_anonymous.js"></script>
- <script>
- layout.addReady(function(){
- (function(layout){
- var uri = new URI(window.location.href);
- var locate = window.location;
- var protocol = locate.protocol;
- var href = locate.href;
- //var uri = new URI(href);
- var oauth = uri.getData("oauth");
- var redirect = uri.getData("redirect");
- var code = uri.getData("code");
- var method = uri.getData("method");
- var _load = function(){
- if (code) {
- layout.loginOauth();
- } else if (oauth) {
- layout.loadOauth();
- }
- };
- layout.loginOauth = function () {
- var r = protocol + "//" + location.host + location.pathname;
- r = r + "?oauth=" + oauth;
- if (redirect) r = r + "&redirect=" + redirect;
- var action = MWF.Actions.get("x_organization_assemble_authentication");
- //企业微信单点登录
- if (layout.isQywx()) {
- action["loginOauthQywxServer"](code, function () {
- if (redirect) {
- window.location = redirect;
- } else {
- window.location = "/";
- }
- }.bind(this));
- } else if (layout.isDingding()) {
- action["loginOauthDingdingServer"](code, function () {
- if (redirect) {
- window.location = redirect;
- } else {
- window.location = "/";
- }
- }.bind(this));
- } else {
- var logMethod = method || "loginOauthServer";
- action[logMethod](oauth, code, encodeURIComponent(r), function () {
- if (method === "oauthBind") {
- alert("用户绑定已成功!");
- window.close();
- } else {
- if (redirect) {
- window.location = redirect;
- } else {
- window.location = "/";
- }
- }
- }.bind(this));
- }
- };
- layout.loadOauth = function () {
- var action = MWF.Actions.get("x_organization_assemble_authentication");
- //企业微信单点登录
- if (layout.isQywx()) {
- action.qywxOauthServer(function (json) {
- var qywxConfig = json.data || {};
- var url = "https://open.work.weixin.qq.com/wwopen/sso/qrConnect?state=STATE";
- var corpId = qywxConfig.corpId;
- if (corpId) {
- url += "&appid=" + corpId;
- }
- var agentId = qywxConfig.agentId;
- if (agentId) {
- url += "&agentid=" + agentId;
- }
- var r = protocol + "//" + location.host + location.pathname;
- r = r + "?oauth=" + oauth + "&qywx=true";
- url += "&redirect_uri=" + encodeURIComponent(r);
- window.location = url;
- }.bind(this));
- } else if (layout.isDingding()) { //钉钉单点登录
- action.dingdingOauthServer(function (json) {
- var dingdingConfig = json.data || {};
- var url = "https://oapi.dingtalk.com/connect/qrconnect?response_type=code&scope=snsapi_login&state=STATE";
- var appId = dingdingConfig.scanLoginAppId;
- if (appId) {
- url += "&appid=" + appId;
- }
- var r = protocol + "//" + location.host + location.pathname;
- r = r + "?oauth=" + oauth + "&dingding=true";
- url += "&redirect_uri=" + encodeURIComponent(r);
- window.location = url;
- }.bind(this));
- } else {
- action.getOauthServer(oauth, function (json) {
- var url = json.data.authAddress;
- var p = json.data.authParameter;
- var r = protocol + "//" + location.host + location.pathname;
- r = r + "?oauth=" + oauth;
- if (method) r = r + "&method=" + method;
- if (redirect) r = r + "&redirect=" + redirect;
- p = (p) ? p + "&redirect_uri=" + encodeURIComponent(r) : "&redirect_uri=" + encodeURIComponent(r);
- url = (url.indexOf("?" === -1)) ? url + "?" + p : url + "&" + p;
- window.location = url;
- }.bind(this));
- }
- };
- layout.isQywx = function () {
- var qywx = uri.getData("qywx");
- if (qywx) {
- return true;
- } else {
- return false;
- }
- };
- layout.isDingding = function () {
- var dingding = uri.getData("dingding");
- if (dingding) {
- return true;
- } else {
- return false;
- }
- };
- _load();
- })(layout);
- });
- // o2.addReady(function () {
- // layout = window.layout || {};
- // layout.desktop = layout;
- // o2.xDesktop = o2.xDesktop || {};
- //
- // var locate = window.location;
- // var protocol = locate.protocol;
- // var href = locate.href;
- //
- // var uri = new URI(href);
- // var oauth = uri.getData("oauth");
- // var redirect = uri.getData("redirect");
- // var code = uri.getData("code");
- // var method = uri.getData("method");
- //
- // layout.load = function () {
- // if (code) {
- // layout.loginOauth();
- // } else if (oauth) {
- // layout.loadOauth();
- // }
- //
- // };
- // layout.loginOauth = function () {
- // var r = protocol + "//" + location.host + location.pathname;
- // r = r + "?oauth=" + oauth;
- // if (redirect) r = r + "&redirect=" + redirect;
- //
- // var action = MWF.Actions.get("x_organization_assemble_authentication");
- // //企业微信单点登录
- // if (layout.isQywx()) {
- // action["loginOauthQywxServer"](code, function () {
- // if (redirect) {
- // window.location = redirect;
- // } else {
- // window.location = "/";
- // }
- // }.bind(this));
- // } else if (layout.isDingding()) {
- // action["loginOauthDingdingServer"](code, function () {
- // if (redirect) {
- // window.location = redirect;
- // } else {
- // window.location = "/";
- // }
- // }.bind(this));
- // } else {
- //
- // var logMethod = method || "loginOauthServer";
- // action[logMethod](oauth, code, encodeURIComponent(r), function () {
- // if (method === "oauthBind") {
- // alert("用户绑定已成功!");
- // window.close();
- // } else {
- // if (redirect) {
- // window.location = redirect;
- // } else {
- // window.location = "/";
- // }
- // }
- //
- // }.bind(this));
- // }
- //
- // };
- // layout.loadOauth = function () {
- // var action = MWF.Actions.get("x_organization_assemble_authentication");
- // //企业微信单点登录
- // if (layout.isQywx()) {
- // action.qywxOauthServer(function (json) {
- // var qywxConfig = json.data || {};
- // var url = "https://open.work.weixin.qq.com/wwopen/sso/qrConnect?state=STATE";
- // var corpId = qywxConfig.corpId;
- // if (corpId) {
- // url += "&appid=" + corpId;
- // }
- // var agentId = qywxConfig.agentId;
- // if (agentId) {
- // url += "&agentid=" + agentId;
- // }
- // var r = protocol + "//" + location.host + location.pathname;
- // r = r + "?oauth=" + oauth + "&qywx=true";
- // url += "&redirect_uri=" + encodeURIComponent(r);
- //
- // window.location = url;
- // }.bind(this));
- // } else if (layout.isDingding()) { //钉钉单点登录
- // action.dingdingOauthServer(function (json) {
- // var dingdingConfig = json.data || {};
- // var url = "https://oapi.dingtalk.com/connect/qrconnect?response_type=code&scope=snsapi_login&state=STATE";
- // var appId = dingdingConfig.scanLoginAppId;
- // if (appId) {
- // url += "&appid=" + appId;
- // }
- // var r = protocol + "//" + location.host + location.pathname;
- // r = r + "?oauth=" + oauth + "&dingding=true";
- // url += "&redirect_uri=" + encodeURIComponent(r);
- // window.location = url;
- // }.bind(this));
- // } else {
- // action.getOauthServer(oauth, function (json) {
- // var url = json.data.authAddress;
- // var p = json.data.authParameter;
- // var r = protocol + "//" + location.host + location.pathname;
- // r = r + "?oauth=" + oauth;
- // if (method) r = r + "&method=" + method;
- // if (redirect) r = r + "&redirect=" + redirect;
- // p = (p) ? p + "&redirect_uri=" + encodeURIComponent(r) : "&redirect_uri=" + encodeURIComponent(r);
- // url = (url.indexOf("?" === -1)) ? url + "?" + p : url + "&" + p;
- // window.location = url;
- // }.bind(this));
- // }
- // };
- // layout.isQywx = function () {
- // var qywx = uri.getData("qywx");
- // if (qywx) {
- // return true;
- // } else {
- // return false;
- // }
- // };
- // layout.isDingding = function () {
- // var dingding = uri.getData("dingding");
- // if (dingding) {
- // return true;
- // } else {
- // return false;
- // }
- // };
- //
- // MWF.loadLP("zh-cn");
- // MWF.require("MWF.xDesktop.Common", null, false);
- // MWF.require("MWF.xAction.RestActions", null, false);
- //
- // o2.load(["../o2_lib/mootools/plugin/mBox.Notice.js", "../o2_lib/mootools/plugin/mBox.Tooltip.js"], { "sequence": true }, function () {
- // o2.JSON.get("res/config/config.json", function (config) {
- // layout.config = config;
- // MWF.xDesktop.getServiceAddress(config, function (service, center) {
- // layout.serviceAddressList = service;
- // layout.centerServer = center;
- // layout.load();
- // }.bind(this));
- // }.bind(this));
- // });
- // //});
- // });
- </script>
- <script src="../o2_lib/mootools/mootools-1.6.0.min.js"></script>
- </head>
- <body>
- <!--<body bgcolor="#faebd7" bgcolor="#ffc0cb" style="height: 100%; overflow: auto; margin:0px; background-size: cover; background-image: url(res/mwf4/package/xDesktop/$Layout/default/desktop.jpg);">-->
- <!--<div id="layout" style="overflow: auto; height:100%"></div>-->
- </body>
- </html>
|