Login.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. <template>
  2. <div class="loginPic">
  3. <!-- <div class="login_left">
  4. <p>Welcome!</p>
  5. <p class="title">光耀集中式风电功率预测系统</p>
  6. </div> -->
  7. <div class="login_right">
  8. <img class="titleIcon" src="../assets/loginImage/logo.png" alt="">
  9. <div class="loginCom" style="margin-bottom: 30px">
  10. <img class="userIcon" src="../assets/loginImage/userIcon.png" alt="">
  11. <el-input v-model="inputUser" placeholder="请输入用户名" />
  12. </div>
  13. <div class="loginCom" style="margin-bottom: 16px">
  14. <img class="passwordIcon" src="../assets/loginImage/passwordIcon.png" alt="">
  15. <el-input type="password" v-model="inputMima" placeholder="请输入密码" />
  16. </div>
  17. <div class="remeber">
  18. <el-checkbox v-model="ememberMe" disabled>记住密码</el-checkbox>
  19. </div>
  20. <div class="loginBtn" @click="handleLogin">
  21. <span class="loginSpan">登录</span>
  22. </div>
  23. </div>
  24. <!-- 底部 -->
  25. <!-- <div class="loginFooter">
  26. <span>Copyright © 2021-2022 GuangYaoDianLi All Rights Reserved.</span>
  27. </div> -->
  28. </div>
  29. </template>
  30. <script>
  31. import { setToken } from '@/api/auth'
  32. import { ElMessage } from "element-plus";
  33. import { loginApi } from '../api/api'
  34. export default {
  35. data() {
  36. return {
  37. inputUser:'',
  38. inputMima:'',
  39. codeUrl:'',
  40. ememberMe:false,
  41. loading:false,
  42. loginText: ''
  43. }
  44. },
  45. created() {
  46. },
  47. methods:{
  48. handleLogin() {
  49. if (this.inputUser !== '' && this.inputMima !== '') {
  50. this.getLogin(this.inputUser, this.inputMima)
  51. } else {
  52. ElMessage.error('请输入账号或密码');
  53. }
  54. },
  55. //登录接口
  56. getLogin(userName, password) {
  57. // setToken('userMsg', params)
  58. // loginApi(userName, password).then(datas=>{
  59. // if (datas) {
  60. // setToken('token', datas.access_token)
  61. // this.$router.push({ path: "/home"})
  62. // } else {
  63. // ElMessage.error(datas.msg);
  64. // }
  65. // }).catch(e =>{
  66. // this.loading = false
  67. // })
  68. this.$router.push({ path: "/home"})
  69. }
  70. }
  71. }
  72. </script>
  73. <style lang="scss">
  74. @media screen and (max-width: 1200px) {
  75. .loginPic{
  76. .login_left {
  77. display: none;
  78. }
  79. }
  80. }
  81. .loginPic{
  82. position: relative;
  83. width: 100%;
  84. height:1080px;
  85. background-image: url('../assets/loginImage/loginBak.png');
  86. background-position: 0 0;
  87. background-repeat: no-repeat;
  88. display: flex;
  89. .login_left{
  90. position: fixed;
  91. left: 15%;
  92. top: 35%;
  93. p{
  94. margin-bottom: 0px;
  95. font-size: 32px;
  96. color: #fff;
  97. margin-top: 10px;
  98. }
  99. .title{
  100. letter-spacing: 5px;
  101. }
  102. }
  103. .login_right{
  104. width: 470px;
  105. height:680px;
  106. background: rgba(0,0,0,0.4);
  107. position: fixed;
  108. right: 15%;
  109. top: 15%;
  110. .titleIcon{
  111. margin: 100px 0px 43px 95px;
  112. }
  113. .loginCom{
  114. margin: 0 30px 0px 43px;
  115. width: 384px;
  116. height: 56px;
  117. background: #1B1A1F;
  118. border-radius: 5px;
  119. display: flex;
  120. .userIcon {
  121. width: 24px;
  122. height: 24px;
  123. margin: 16px;
  124. }
  125. .passwordIcon {
  126. width: 24px;
  127. height: 24px;
  128. margin: 16px;
  129. }
  130. .el-input{
  131. border: 0 solid transparent;
  132. .el-input__wrapper{
  133. background: transparent;
  134. box-shadow: none;
  135. .el-input__inner, .el-input__inner:focus{
  136. background: none;
  137. border: none !important;
  138. color: #fff;
  139. height: 30px;
  140. width: 100%;
  141. font-size: 14px;
  142. }
  143. }
  144. }
  145. }
  146. .remeber{
  147. margin: 0 0 0 50px;
  148. .el-checkbox{
  149. .el-checkbox__label{
  150. color: #fff;
  151. font-size: 12px;
  152. padding-left:6px;
  153. }
  154. }
  155. }
  156. .loginBtn{
  157. margin: 48px 0 0 43px;
  158. width: 384px;
  159. height: 56px;
  160. background-image: url('../assets/loginImage/loginBtn.png');
  161. cursor: pointer;
  162. .loginSpan{
  163. position: relative;
  164. top: 27%;
  165. left: 45%;
  166. font-size: 18px;
  167. font-family: Microsoft YaHei;
  168. font-weight: 400;
  169. color: #FFFFFF;
  170. }
  171. }
  172. input::-webkit-input-placeholder{ /*WebKit browsers*/
  173. color: #fff;
  174. }
  175. input::-moz-input-placeholder{ /*Mozilla Firefox*/
  176. color: #fff;
  177. }
  178. input::-ms-input-placeholder{ /*Internet Explorer*/
  179. color: #fff;
  180. }
  181. }
  182. .loginFooter{
  183. height: 40px;
  184. line-height: 40px;
  185. position: fixed;
  186. bottom: 0;
  187. width: 100%;
  188. text-align: center;
  189. color: #fff;
  190. font-family: Arial;
  191. font-size: 12px;
  192. letter-spacing: 1px;
  193. }
  194. }
  195. </style>