AboutView.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="about">
  3. <img class="lupian" src="../assets/bag.jpg" alt=""/>
  4. <!-- <el-image class="lupian" src="../assets/bag.jpg" alt=""></el-image> -->
  5. <div class="dengluk">
  6. <h3 style="margin-bottom: 20px;">{{$t('loding.cte')}}</h3>
  7. <div style="display: flex;align-items: center;font-size: 13px;justify-content: space-between;width: 325px;">
  8. <div>{{$t('loding.lang')}}</div>
  9. <i18n-select></i18n-select>
  10. </div>
  11. <div class="shulank">
  12. <div class="hengxk">
  13. <i class="el-icon-user" style="color: #505050; margin-right: 10px;"></i>
  14. <el-input v-model="name" :placeholder="$t('loding.username')" style="width: 300px;"></el-input>
  15. </div>
  16. <div class="hengxk" style="margin-top: 20px;">
  17. <i class="el-icon-unlock" style="color: #505050; margin-right: 10px;"></i>
  18. <el-input v-model="pad" :placeholder="$t('loding.pasd')" show-password style="width: 300px;"></el-input>
  19. </div>
  20. </div>
  21. <el-button type="primary" style="margin-top: 10px; width: 300px;height: 40px;" @click="gotiaozhuan">{{$t('loding.logng')}}</el-button>
  22. </div>
  23. </div>
  24. </template>
  25. <script>
  26. import {loding,getuser} from '@/api/loding';
  27. import { encrypt,decrypt } from '@/router/jsencrypt';
  28. import i18nSelect from "../components/i18n.vue"
  29. export default{
  30. components: { i18nSelect },
  31. name:"AboutView",
  32. data(){
  33. return {
  34. name:'',
  35. pad:''
  36. }
  37. },
  38. created() {
  39. this.getloduser();
  40. i18nSelect.created()
  41. },
  42. methods:{
  43. getloduser(){
  44. getuser().then(response => {
  45. // console.log("获取用户",response);
  46. if(response.code==200){
  47. localStorage.setItem('user', JSON.stringify(response.data));
  48. this.$router.push('/index');
  49. }
  50. });
  51. },
  52. gotiaozhuan(){
  53. if(this.name==''){
  54. this.$message({
  55. message:this.$t('loding.txuse'),
  56. type: 'warning'
  57. });
  58. return
  59. }
  60. if(this.pad==''){
  61. this.$message({
  62. message: this.$t('loding.txpad'),
  63. type: 'warning'
  64. });
  65. return
  66. }
  67. loding({
  68. userName:this.name,
  69. password:encrypt(this.pad),
  70. cid:''
  71. }).then(response => {
  72. console.log("请求数据",response);
  73. if(response.code==200){
  74. localStorage.setItem('token', response.token);
  75. localStorage.setItem('user', JSON.stringify(response.data));
  76. this.$router.push('/index');
  77. }else{
  78. this.$message.error(response.msg);
  79. }
  80. });
  81. }
  82. }
  83. }
  84. </script>
  85. <style>
  86. .about{
  87. display: flex;
  88. align-items: center;
  89. justify-content: center;
  90. width: 100vw;
  91. height: 100vh;
  92. }
  93. .shulank{
  94. margin: 20px 0;
  95. }
  96. .hengxk{
  97. display: flex;
  98. align-items: center;
  99. }
  100. .dengluk{
  101. position: absolute;
  102. z-index: 999;
  103. width: 400px;
  104. background-color: rgba(255, 255, 255, 0.8);
  105. border-radius: 10px;
  106. padding: 30px;
  107. display: flex;
  108. flex-direction: column;
  109. align-items: center;
  110. justify-content: center;
  111. }
  112. .lupian{
  113. width: 100vw;
  114. height: 100vh;
  115. object-fit: cover;
  116. /* Sobject-position: 20% 20%; */
  117. }
  118. </style>