login_VSees.html 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  5. <meta name="viewport" content="width=device-width">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
  7. <title>VSees Login</title>
  8. <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
  9. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/all.min.css" integrity="sha512-..." crossorigin="anonymous" />
  10. <!-- 引入 axios 的 JS 文件 -->
  11. <script src="https://unpkg.com/axios/dist/axios.min.js"></script>
  12. </head>
  13. <style type="text/css">
  14. html,body{
  15. width: 100%;
  16. height: 100%;
  17. margin: 0px;
  18. }
  19. *{
  20. margin: 0px;
  21. padding: 0px;
  22. box-sizing: border-box;
  23. }
  24. #t_div{
  25. width: 100%;
  26. /*height: 200px;*/
  27. height: 25%;
  28. background-color:#66677C;
  29. margin-top: 0px;
  30. margin-bottom: -20px;
  31. /*border-bottom: solid 1px red;*/
  32. }
  33. #c_div{
  34. width: 100%;
  35. /*height: 430px ;*/
  36. height: 50%;
  37. margin-top: 0px;
  38. margin-bottom: 0px;
  39. border-top: solid 1px #66677C;
  40. position: relative;
  41. background-color: yellow;
  42. }
  43. #c_leftdiv{
  44. width: 50%;
  45. /*height: 430px;*/
  46. height: 100%;
  47. margin: 0px;
  48. background-color: #7ab6b6;
  49. float: left;
  50. /*position: relative;*/
  51. /*left: 50px;
  52. top: 100px;*/
  53. }
  54. #c_rightdiv{
  55. width: 50%;
  56. /*height: 430px;*/
  57. height: 100%;
  58. margin: 0px;
  59. background-color: #e5cfaa;
  60. float: left;
  61. }
  62. /*阴影部分*/
  63. /*#c_centerdiv-shadow{
  64. width: 350px;
  65. height: 390px;
  66. background-color: #a09177;
  67. position: absolute;
  68. left: 0;
  69. right: 0;
  70. margin-left: 37.3%;
  71. margin-top: 3.5%;
  72. z-index: 1;
  73. }*/
  74. #c_centerdiv > p{
  75. font-size: 20px;
  76. font-weight: 100;
  77. margin-left: 100px;
  78. margin: 10px auto;
  79. text-align: center;
  80. }
  81. #c_centerdiv > img{
  82. margin-left: 10px;
  83. }
  84. #password_text{
  85. width: 90%;
  86. height: 50px;
  87. line-height: 30px;
  88. /*background-color: red;*/
  89. font-size: 40px;
  90. }
  91. #c_centerdiv > img{
  92. display: block;
  93. position: relative;
  94. left: 0px;
  95. top: 10px;
  96. padding: 0px;
  97. }
  98. #c_centerdiv{
  99. background-color: #fff;
  100. position: absolute;
  101. left: 0;
  102. right: 0;
  103. margin-left: auto;
  104. margin-right: auto;
  105. top: 50%;
  106. margin-top: -193px;
  107. /*margin-top: -15.1%;*/
  108. z-index: 10;
  109. }
  110. #c_centerdiv{
  111. width: 350px;
  112. height: 390px;
  113. padding: 50px 30px;
  114. }
  115. #c_center_title{
  116. width: 100%;
  117. height: 19%;
  118. /*height: 55px;*/
  119. color: #555;
  120. font-size: 30px;
  121. font-weight: 600;
  122. font-family: 'Arimo', sans-serif;
  123. text-align: center;
  124. /*background-color: red;*/
  125. }
  126. #c_center_div1{
  127. width: 100%;
  128. height: 19%;
  129. /*height: 55px;*/
  130. color: #555;
  131. font-size: 10px;
  132. font-weight: 600;
  133. font-family: 'Arimo', sans-serif;
  134. text-align: center;
  135. /*background-color: red;*/
  136. }
  137. #c_center_div2{
  138. width: 100%;
  139. height: 13.8%;
  140. text-align: center;
  141. padding: 0px;
  142. position: relative;
  143. /*background-color: yellow;*/
  144. margin-top: 0px;
  145. margin-top: 30px;
  146. }
  147. /*图片*/
  148. #c_center_div2 > img{
  149. position: absolute;
  150. left: 0px;
  151. top: 0px;
  152. }
  153. #user_text{
  154. width: 100%;
  155. /*width: 80%;*/
  156. height: 40px;
  157. float: right;
  158. background-color: #fff;
  159. font-size: 17px;
  160. letter-spacing: 1px;
  161. box-shadow: 0 0 0 0 transparent;
  162. border: none;
  163. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  164. border-radius: 0;
  165. display: inline-block;
  166. font-family: "微软雅黑";
  167. }
  168. #password_text{
  169. width: 100%;
  170. /*width: 80%;*/
  171. height: 40px;
  172. float: right;
  173. background-color: #fff;
  174. font-size: 17px;
  175. letter-spacing: 1px;
  176. box-shadow: 0 0 0 0 transparent;
  177. border: none;
  178. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  179. border-radius: 0;
  180. display: inline-block;
  181. font-family: "微软雅黑";
  182. }
  183. #password_icon {
  184. position: absolute;
  185. top: 8px;
  186. right: 10px;
  187. cursor: pointer;
  188. }
  189. #c_center_div4{
  190. display: flex;
  191. align-items: center;
  192. justify-content: center;
  193. width: 100%;
  194. height: 16%;
  195. text-align: center;
  196. padding: 0px;
  197. position: relative;
  198. /* background-color: yellow;*/
  199. margin-top: 0px;
  200. margin-top: 30px;
  201. }
  202. #login_button{
  203. width: 50.7%;
  204. height: 100%;
  205. /*background-image: url(img/按钮初始界面.png);*/
  206. outline:none;
  207. border:none;
  208. background-color: #7ab6b6;
  209. border-radius:30px;
  210. font-size: large;
  211. color: white;
  212. font-family: Arial;
  213. }
  214. #login_button:hover{
  215. cursor: pointer;
  216. }
  217. #login_button:disabled {
  218. background-color: #ccc; /* 灰色背景 */
  219. cursor: not-allowed; /* 禁用指针样式 */
  220. }
  221. #b_div{
  222. width: 100%;
  223. /*height: 120px;*/
  224. height: 27.2%;
  225. background-color:#66677C;
  226. }
  227. #loading_icon{
  228. position: absolute;
  229. right: 89px;
  230. color: #fff;
  231. }
  232. .loading-icon {
  233. display: none;
  234. }
  235. .loading-icon.visible {
  236. display: inline-block;
  237. }
  238. </style>
  239. <body marginheight="0px" marginwidth="0px">
  240. <div id="t_div">
  241. </div>
  242. <div id="c_div">
  243. <div id="c_leftdiv"></div>
  244. <div id="c_rightdiv"></div>
  245. <div id="c_centerdiv">
  246. <div id="c_center_title">
  247. VSees
  248. </div>
  249. <div id="c_center_div1">
  250. Please enter your VSees account for association
  251. </div>
  252. <div id="c_center_div2">
  253. <!--<img src="img/用户.png"/>-->
  254. <input id="user_text" type="text" placeholder="Account"/>
  255. </div>
  256. <div id="c_center_div2">
  257. <!--<img src="img/密码.png"/>-->
  258. <input id="password_text" type="password" placeholder="Password"/>
  259. <i
  260. id="password_icon"
  261. class="far fa-eye-slash"
  262. onclick="togglePasswordVisibility()"
  263. ></i>
  264. </div>
  265. <div id="c_center_div4">
  266. <input type="button" id="login_button" value="LOGIN" onclick="Login();return false"/>
  267. <i id="loading_icon" class="fas fa-spinner fa-spin loading-icon"></i>
  268. </div>
  269. </div>
  270. <!--阴影部分-->
  271. <!-- <div id="c_centerdiv-shadow">-->
  272. </div>
  273. </div>
  274. <div id="b_div">
  275. </div>
  276. <script type="text/javascript">
  277. function showLoadingIcon() {
  278. var loginButton = document.getElementById("login_button");
  279. var loadingIcon = document.getElementById("loading_icon");
  280. loginButton.disabled = true;
  281. loadingIcon.classList.add("visible");
  282. }
  283. function hideLoadingIcon() {
  284. var loginButton = document.getElementById("login_button");
  285. var loadingIcon = document.getElementById("loading_icon");
  286. loginButton.disabled = false;
  287. loadingIcon.classList.remove("visible");
  288. }
  289. function togglePasswordVisibility() {
  290. var passwordInput = document.getElementById("password_text");
  291. var passwordIcon = document.getElementById("password_icon");
  292. if (passwordInput.type === "password") {
  293. passwordInput.type = "text";
  294. passwordIcon.classList.remove("fa-eye-slash");
  295. passwordIcon.classList.add("fa-eye");
  296. } else {
  297. passwordInput.type = "password";
  298. passwordIcon.classList.remove("fa-eye");
  299. passwordIcon.classList.add("fa-eye-slash");
  300. }
  301. }
  302. function Login() {
  303. var user = document.getElementById("user_text");
  304. var pwd = document.getElementById("password_text");
  305. if (user.value.length > 0) {
  306. const params = {
  307. user: user.value,
  308. pwd: pwd.value,
  309. state: '{{ state }}',
  310. client_id: '{{ client_id }}',
  311. response_type: '{{ response_type }}',
  312. scope: '{{ scope }}',
  313. redirect_uri: '{{ redirect_uri }}',
  314. skill_name: '{{ skill_name }}'
  315. };
  316. showLoadingIcon();
  317. axios.get('/oa2/login', { params: params })
  318. .then(response => {
  319. // 请求成功处理
  320. hideLoadingIcon();
  321. const data = response.data;
  322. if (data['code'] === 0) {
  323. console.log('request start');
  324. window.location = data['res'];
  325. } else {
  326. alert(data['msg']);
  327. }
  328. })
  329. .catch(error => {
  330. // 请求失败处理
  331. hideLoadingIcon();
  332. alert(error);
  333. });
  334. } else {
  335. alert("please input user and password");
  336. }
  337. }
  338. </script>
  339. </body>
  340. </html>