bigDataLogin.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644
  1. <template>
  2. <div class="login-page scrollbar-box">
  3. <img class="logo-img" src="@/assets/ZDimages/login/logo.png">
  4. <div class="title-img-box">
  5. <div>
  6. <img class="title-img" src="@/assets/ZDimages/login/title_icon.png">
  7. <!--<p>v 2.0</p>-->
  8. </div>
  9. </div>
  10. <div class="form-box">
  11. <p class="form-title-p">登录</p>
  12. <el-form ref="loginForm" :model="loginForm" :rules="loginRules" class="login-form">
  13. <div class="username-input-box">
  14. <img src="@/assets/ZDimages/login/icon_dl_zh.png" alt="">
  15. <input type="text" v-model="loginForm.username" placeholder="请输入账号" maxlength="20" @keyup.enter="handleLogin">
  16. </div>
  17. <div class="password-input-box">
  18. <img src="@/assets/ZDimages/login/icon_dl_mm.png" alt="">
  19. <input type="password" v-model="loginForm.password" placeholder="请输入密码" maxlength="20" @keyup.enter="handleLogin">
  20. </div>
  21. <p class="text-p">{{text}}</p>
  22. <div class="code-input-box">
  23. <div class="code-input-left-box">
  24. <img src="@/assets/ZDimages/login/icon_dl_yzm.png" alt="">
  25. <input type="text" v-model="loginForm.code" placeholder="请输入验证码" maxlength="4" @keyup.enter="handleLogin">
  26. </div>
  27. <div class="login-code">
  28. <img :src="codeUrl" @click="getCode" class="login-code-img"/>
  29. </div>
  30. </div>
  31. <el-form-item>
  32. <el-button
  33. class="form-button-p"
  34. :loading="loading"
  35. size="medium"
  36. height="50"
  37. @click.native.prevent="handleLogin"
  38. >
  39. <span v-if="!loading">登 录</span>
  40. <span v-else>登 录 中...</span>
  41. </el-button>
  42. <div style="float: right;" v-if="register">
  43. <router-link class="link-type" :to="'/register'">立即注册</router-link>
  44. </div>
  45. </el-form-item>
  46. </el-form>
  47. </div>
  48. <p class="introduction-p">技术支持:江苏忠江智能科技有限公司</p>
  49. </div>
  50. </template>
  51. <script>
  52. import { getCodeImg } from "@/api/login";
  53. import Cookies from "js-cookie";
  54. import { encrypt, decrypt } from '@/utils/jsencrypt'
  55. export default {
  56. name: "bigDataLogin",
  57. data() {
  58. return {
  59. codeUrl: "",
  60. cookiePassword: "",
  61. type:1,
  62. loginForm: {
  63. // username: "admin",
  64. // password: "admin123",
  65. username: "",
  66. password: "",
  67. rememberMe: false,
  68. code: "",
  69. uuid: "",
  70. // userType:""
  71. },
  72. loginRules: {
  73. // username: [
  74. // { required: true, trigger: "blur", message: "请输入您的账号" }
  75. // ],
  76. // password: [
  77. // { required: true, trigger: "blur", message: "请输入您的密码" }
  78. // ],
  79. // code: [{ required: true, trigger: "change", message: "请输入验证码" }]
  80. },
  81. loading: false,
  82. // 验证码开关
  83. captchaOnOff: true,
  84. // 注册开关
  85. register: false,
  86. redirect: undefined,
  87. text:"",
  88. };
  89. },
  90. watch: {
  91. $route: {
  92. handler: function(route) {
  93. this.redirect = route.query && route.query.redirect;
  94. },
  95. immediate: true
  96. }
  97. },
  98. created() {
  99. localStorage.setItem('windowHref',window.location.href)
  100. this.getCode();
  101. this.getCookie();
  102. this.exitFullscreen();
  103. },
  104. methods: {
  105. getCode() {
  106. getCodeImg().then(res => {
  107. this.captchaOnOff = res.captchaOnOff === undefined ? true : res.captchaOnOff;
  108. if (this.captchaOnOff) {
  109. this.codeUrl = "data:image/gif;base64," + res.img;
  110. this.loginForm.uuid = res.uuid;
  111. }
  112. });
  113. },
  114. getCookie() {
  115. const username = Cookies.get("username");
  116. const password = Cookies.get("password");
  117. const rememberMe = Cookies.get('rememberMe')
  118. this.loginForm = {
  119. username: username === undefined ? this.loginForm.username : username,
  120. password: password === undefined ? this.loginForm.password : decrypt(password),
  121. rememberMe: rememberMe === undefined ? false : Boolean(rememberMe)
  122. };
  123. },
  124. handleLogin() {
  125. if(this.loginForm.username.length<1){
  126. this.text = "*请输入账号";
  127. return
  128. }else if(this.loginForm.password.length<1){
  129. this.text = "*请输入密码";
  130. return
  131. }else if(!this.loginForm.code||this.loginForm.code.length<1){
  132. this.text = "*请输入验证码";
  133. return
  134. }
  135. this.text = "";
  136. this.$refs.loginForm.validate(valid => {
  137. if (valid) {
  138. this.loading = true;
  139. this.$store.dispatch("Login", this.loginForm).then((res) => {
  140. if(res.data.type){
  141. window.location.href = localStorage.getItem('screenUrl') + '?identity=' + res.data.screen_token;
  142. this.fullScreen();
  143. }
  144. }).catch(() => {
  145. this.loading = false;
  146. if (this.captchaOnOff) {
  147. this.getCode();
  148. }
  149. });
  150. }
  151. });
  152. },
  153. //全屏
  154. fullScreen() {
  155. var element = document.documentElement;
  156. if (element.requestFullscreen) {
  157. element.requestFullscreen();
  158. } else if (element.msRequestFullscreen) {
  159. element.msRequestFullscreen();
  160. } else if (element.mozRequestFullScreen) {
  161. element.mozRequestFullScreen();
  162. } else if (element.webkitRequestFullscreen) {
  163. element.webkitRequestFullscreen();
  164. }
  165. },
  166. //退出全屏
  167. exitFullscreen() {
  168. if (document.exitFullscreen) {
  169. document.exitFullscreen();
  170. } else if (document.msExitFullscreen) {
  171. document.msExitFullscreen();
  172. } else if (document.mozCancelFullScreen) {
  173. document.mozCancelFullScreen();
  174. } else if (document.webkitExitFullscreen) {
  175. document.webkitExitFullscreen();
  176. }
  177. },
  178. }
  179. };
  180. </script>
  181. <style rel="stylesheet/scss" lang="scss">
  182. .login-page{
  183. height: 100%;
  184. width:100%;
  185. background-image: url("../assets/ZDimages/login/icon_dl_bbg.png");
  186. background-repeat:no-repeat;
  187. background-size: cover;
  188. -webkit-background-size: cover;
  189. -o-background-size: cover;
  190. position: relative;
  191. *{
  192. margin:0;
  193. }
  194. .logo-img{
  195. position: absolute;
  196. top:29px;
  197. left:52px;
  198. width:220px;
  199. height:55px;
  200. }
  201. .title-img-box{
  202. position: absolute;
  203. top:74px;
  204. left:50%;
  205. margin-left:-580px;
  206. width:1180px;
  207. height:230px;
  208. div{
  209. position: relative;
  210. img{
  211. width:1180px;
  212. height:230px;
  213. }
  214. p{
  215. position: absolute;
  216. top:72px;
  217. right:300px;
  218. width:50px;
  219. height:26px;
  220. line-height:26px;
  221. text-align: center;
  222. background: #0045AF;
  223. color:#fff;
  224. font-size:14px;
  225. border-radius:70px;
  226. }
  227. }
  228. }
  229. .form-box{
  230. width:680px;
  231. height:520px;
  232. background-image: url("../assets/ZDimages/login/img_dlk_bg.png");
  233. position: absolute;
  234. top:290px;
  235. left:50%;
  236. margin-left:-340px;
  237. .form-title-p{
  238. line-height:52px;
  239. font-size:24px;
  240. text-align: center;
  241. color:#fff;
  242. font-weight:700;
  243. }
  244. .username-input-box:hover{
  245. box-shadow: 0 0 4px 1px rgba(0, 255, 252, 1);
  246. }
  247. .username-input-box{
  248. width:480px;
  249. height:60px;
  250. border: 1px solid #00FFFC;
  251. border-radius: 10px;
  252. background: rgba(0, 13, 41, 0.2);
  253. margin: 40px auto 32px;
  254. display: flex;
  255. overflow: hidden;
  256. img{
  257. height:20px;
  258. width:20px;
  259. margin:20px;
  260. }
  261. input:-webkit-autofill {
  262. //input 背景色 #0C2034根据自己需要替换
  263. -webkit-box-shadow : 0 0 0px 1000px rgba(1,25,67,1) inset !important;
  264. //input字体颜色 颜色根据自己要求替换
  265. -webkit-text-fill-color: #FFFFFF !important;
  266. }
  267. input{
  268. flex:1;
  269. border:none;
  270. outline:none;
  271. background-color: transparent !important;
  272. color: #dedede;
  273. font-size:16px;
  274. }
  275. ::placeholder{
  276. color:#999999 ;
  277. font-size:16px;
  278. }
  279. }
  280. .password-input-box:hover{
  281. box-shadow: 0 0 4px 1px rgba(0, 255, 252, 1);
  282. }
  283. .password-input-box{
  284. width:480px;
  285. height:60px;
  286. border: 1px solid #00FFFC;
  287. border-radius: 10px;
  288. background: rgba(0, 13, 41, 0.2);
  289. margin: 0 auto;
  290. display: flex;
  291. overflow: hidden;
  292. img{
  293. height:20px;
  294. width:20px;
  295. margin:20px;
  296. }
  297. input:-webkit-autofill {
  298. //input 背景色 #0C2034根据自己需要替换
  299. -webkit-box-shadow : 0 0 0px 1000px rgba(1,25,67,1) inset !important;
  300. //input字体颜色 颜色根据自己要求替换
  301. -webkit-text-fill-color: #FFFFFF !important;
  302. }
  303. input{
  304. flex:1;
  305. border:none;
  306. outline:none;
  307. background-color: transparent !important;
  308. color: #dedede;
  309. font-size:16px;
  310. }
  311. ::placeholder{
  312. color:#999999 ;
  313. font-size:16px;
  314. }
  315. }
  316. .text-p{
  317. width:480px;
  318. height:59px;
  319. line-height: 59px;
  320. margin: 0 auto;
  321. font-size: 14px;
  322. font-family: Microsoft YaHei;
  323. color: #DC1616;
  324. }
  325. .code-input-box{
  326. width:480px;
  327. height:60px;
  328. display: flex;
  329. margin: 0 auto;
  330. .code-input-left-box:hover{
  331. box-shadow: 0 0 4px 1px rgba(0, 255, 252, 1);
  332. }
  333. .code-input-left-box{
  334. width:330px;
  335. height:60px;
  336. border: 1px solid #00FFFC;
  337. border-radius: 10px;
  338. background: rgba(0, 13, 41, 0.2);
  339. display: flex;
  340. overflow: hidden;
  341. img{
  342. height:20px;
  343. width:20px;
  344. margin:20px;
  345. }
  346. input:-webkit-autofill {
  347. -webkit-box-shadow: 0 0 0 1000px white inset !important;
  348. }
  349. input{
  350. flex:1;
  351. border:none;
  352. outline:none;
  353. background-color: transparent !important;
  354. color: #dedede;
  355. font-size:16px;
  356. }
  357. ::placeholder{
  358. color:#999999 ;
  359. font-size:16px;
  360. }
  361. }
  362. .login-code{
  363. width:124px;
  364. height:50px;
  365. margin:6px 0 0 25px;
  366. img {
  367. width:124px;
  368. height:50px;
  369. cursor: pointer;
  370. vertical-align: middle;
  371. }
  372. }
  373. }
  374. .form-button-p{
  375. font-size:16px;
  376. display: block;
  377. width:480px;
  378. height: 60px;
  379. background: #0045AF;
  380. color:#fff;
  381. border:none;
  382. border-radius: 10px;
  383. margin:34px auto 0;
  384. }
  385. }
  386. .introduction-p{
  387. width:100%;
  388. text-align: center;
  389. color:#fff;
  390. font-size:16px;
  391. line-height:44px;
  392. position: absolute;
  393. left:0;
  394. bottom:0;
  395. }
  396. }
  397. .login {
  398. /*display: flex;*/
  399. /*justify-content: right;*/
  400. /*padding-right:220px;*/
  401. /*align-items: center;*/
  402. height: 100%;
  403. width:100%;
  404. background-image: url("../assets/ZDimages/img_dl_bg.png");
  405. background-size: 100%;
  406. position: relative;
  407. .login-max-box{
  408. position: absolute;
  409. height:800px;
  410. width:1600px;
  411. background: #FFFFFF;
  412. border-radius: 30px;
  413. top:50%;
  414. left:50%;
  415. margin-top:-400px;
  416. margin-left:-800px;
  417. display: flex;
  418. .left-box{
  419. width:591px;
  420. height:500px;
  421. background-image: url("../assets/ZDimages/img_dl_sy.png");
  422. background-size: 100%;
  423. margin:172px 0 178px 140px;
  424. }
  425. .right-box{
  426. flex:1;
  427. .title {
  428. margin:91px 0 40px 0;
  429. text-align: center;
  430. padding:0;
  431. font-size: 50px;
  432. font-family: Microsoft YaHei;
  433. font-weight: bold;
  434. color: #0045AF;
  435. /*
  436. position: absolute;
  437. margin:0;
  438. top: -100px;
  439. right:-120px;
  440. font-size:60px;
  441. width:770px;
  442. text-align: center;
  443. font-weight:700;
  444. */
  445. -webkit-touch-callout: none; /* iOS Safari */
  446. -webkit-user-select: none; /* Chrome/Safari/Opera */
  447. -khtml-user-select: none; /* Konqueror */
  448. -moz-user-select: none; /* Firefox */
  449. -ms-user-select: none; /* Internet Explorer/Edge */
  450. user-select: none; /* Non-prefixed version, currently not supported by any browser */
  451. }
  452. .login-form {
  453. border-radius: 6px;
  454. background: #ffffff;
  455. width: 500px;
  456. margin:0 auto;
  457. padding: 25px 25px 5px 25px;
  458. .el-input {
  459. height: 38px;
  460. input {
  461. height: 38px;
  462. }
  463. }
  464. .input-icon {
  465. height: 39px;
  466. width: 14px;
  467. margin-left: 2px;
  468. }
  469. .username-input-box{
  470. width:448px;
  471. height:48px;
  472. background: #f8f8f8;
  473. border: 1px solid #E0E0E0;
  474. border-radius:10px;
  475. display: flex;
  476. margin-bottom:30px;
  477. img{
  478. width:20px;
  479. height:20px;
  480. margin:14px 16px 0 16px;
  481. }
  482. input{
  483. height:46px;
  484. flex:1;
  485. background: #f8f8f8;
  486. outline: none;
  487. border:none;
  488. margin-right:20px;
  489. color:#333;
  490. }
  491. input::placeholder{
  492. color:#ccc;
  493. }
  494. }
  495. .password-input-box{
  496. width:448px;
  497. height:48px;
  498. background: #f8f8f8;
  499. border: 1px solid #E0E0E0;
  500. border-radius:10px;
  501. display: flex;
  502. img{
  503. width:20px;
  504. height:20px;
  505. margin:14px 16px 0 16px;
  506. }
  507. input{
  508. height:46px;
  509. flex:1;
  510. background: #f8f8f8;
  511. outline: none;
  512. border:none;
  513. margin-right:20px;
  514. color:#333;
  515. }
  516. input::placeholder{
  517. color:#ccc;
  518. }
  519. }
  520. .code-input-box{
  521. width:450px;
  522. height:50px;
  523. display: flex;
  524. margin-bottom:60px;
  525. .code-input-left-box{
  526. width:274px;
  527. height:48px;
  528. background: #f8f8f8;
  529. border: 1px solid #E0E0E0;
  530. border-radius:10px;
  531. img{
  532. width:20px;
  533. height:20px;
  534. margin:14px 16px 0 16px;
  535. }
  536. input{
  537. height:46px;
  538. flex:1;
  539. background: #f8f8f8;
  540. outline: none;
  541. border:none;
  542. margin-right:20px;
  543. color:#333;
  544. }
  545. input::placeholder{
  546. color:#ccc;
  547. }
  548. display: flex;
  549. }
  550. .login-code {
  551. margin-left:24px;
  552. width: 150px;
  553. height: 48px;
  554. img {
  555. width: 150px;
  556. height: 48px;
  557. cursor: pointer;
  558. vertical-align: middle;
  559. }
  560. }
  561. }
  562. }
  563. .login-tip {
  564. font-size: 13px;
  565. text-align: center;
  566. color: #bfbfbf;
  567. }
  568. .el-login-footer {
  569. height: 40px;
  570. line-height: 40px;
  571. position: fixed;
  572. bottom: 0;
  573. width: 100%;
  574. text-align: center;
  575. color: #fff;
  576. font-family: Arial;
  577. font-size: 12px;
  578. letter-spacing: 1px;
  579. }
  580. .login-code-img {
  581. height: 38px;
  582. }
  583. .type-max-box{
  584. display: flex;
  585. margin-bottom:58px;
  586. width:450px;
  587. /*border-bottom:1px solid #e0e0e0;*/
  588. p{
  589. font-size:18px;
  590. text-align: center;
  591. line-height:56px;
  592. margin:0;
  593. color:#666666;
  594. cursor:pointer;
  595. }
  596. p:nth-child(1){
  597. width:90px;
  598. margin-right:30px;
  599. }
  600. p:nth-child(2){
  601. width:126px;
  602. }
  603. .typeColorA{
  604. color:#0045af;
  605. border-bottom:2px solid #0045af;
  606. }
  607. }
  608. .text-p{
  609. margin:0;
  610. width: 172px;
  611. height: 50px;
  612. font-size: 14px;
  613. font-family: Microsoft YaHei;
  614. color: #DC1616;
  615. line-height: 50px;
  616. }
  617. }
  618. .logo-img{
  619. position: absolute;
  620. left:20px;
  621. top:20px;
  622. width:267px;
  623. height:66px;
  624. }
  625. }
  626. .position-p{
  627. position: absolute;
  628. right:0;
  629. bottom:20px;
  630. width: 638px;
  631. height: 15px;
  632. font-size: 14px;
  633. color: #AAE1FF;
  634. line-height: 15px;
  635. padding:0;
  636. margin:0;
  637. }
  638. }
  639. </style>