| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <!DOCTYPE html>
- <html lang="zh_CN">
- <head>
- <title>账户登录 - U企云服</title>
- <link rel="icon" href="./images/icon.ico" type="image/x-icon">
- <style>
- body {
- margin: 0;
- overflow: hidden;
- }
- iframe {
- border: 0;
- }
- .loading-wrap {
- position: absolute;
- background-color: #fff;
- width: 100%;
- height: 100%;
- text-align: center;
- z-index: 1;
- }
- .loading{
- display: inline-block;
- width: 150px;
- height: 15px;
- margin: 0 auto;
- margin-top: 150px;
- }
- .loading span{
- display: inline-block;
- width: 15px;
- height: 100%;
- margin-right: 5px;
- border-radius: 50%;
- background: #34baf6;
- -webkit-animation: load 1.04s ease infinite;
- }
- .loading span:last-child{
- margin-right: 0px;
- }
- @-webkit-keyframes load{
- 0%{
- opacity: 1;
- -webkit-transform: scale(1.3);
- }
- 100%{
- opacity: 0.2;
- -webkit-transform: scale(.3);
- }
- }
- .loading span:nth-child(1){
- -webkit-animation-delay:0.13s;
- }
- .loading span:nth-child(2){
- -webkit-animation-delay:0.26s;
- }
- .loading span:nth-child(3){
- -webkit-animation-delay:0.39s;
- }
- .loading span:nth-child(4){
- -webkit-animation-delay:0.52s;
- }
- .loading span:nth-child(5){
- -webkit-animation-delay:0.65s;
- }
- .message {
- position: absolute;
- bottom: 150px;
- left: 0;
- width: 100%;
- text-align: center;
- color: #9c9c9c;
- }
- </style>
- <script src="./lib/sockjs.min.js"></script>
- <script src="./lib/stomp.min.js"></script>
- <script>
- var Socket = (function(){
- return {
- subscribe: function(clientId, dest) {
- return new Promise((resolve, reject) => {
- const socket = new SockJS('https://saas-api.usoftchina.com/ws');
- stompClient = Stomp.over(socket);
- stompClient.connect({}, function (frame) {
- stompClient.subscribe('/clients/' + clientId + dest, function (message) {
- stompClient.disconnect(function () {
- resolve(JSON.parse(message.body));
- });
- });
- });
- })
- },
- disconnect: function(resolve) {
- if (stompClient) {
- stompClient.disconnect(resolve);
- } else {
- resolve();
- }
- }
- }
- })();
- </script>
- </head>
- <body>
- <div class="loading-wrap">
- <div class="loading">
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- <span></span>
- </div>
- <div class="message">
- 正在读取网络文件,请稍等
- </div>
- </div>
- <script>
- const ipc = require('electron').ipcRenderer;
- var clientId = Math.random().toString(36).substr(2);
- Socket.subscribe(clientId, '/sso/callback').then(function(data){
- var session = data.token, account = data.account;
- account.companies = account.companies || [];
- session.account = account;
- ipc.send('session.change', JSON.stringify(session));
- });
- var loading = document.querySelector('.loading-wrap'), frame = document.createElement("iframe");
- frame.setAttribute("src", "https://sso.ubtob.com/sassLogin?appId=sp&baseUrl=" +
- encodeURIComponent('https://saas-api.usoftchina.com/api/auth/sso/callback/' + clientId));
- frame.setAttribute("width", "430");
- frame.setAttribute("height", "539");
- document.body.appendChild(frame);
- frame.onload = function() {
- loading.style.display = 'none';
- };
- </script>
- </body>
- </html>
|