| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119 |
- <template>
- <div class="about">
- <img class="lupian" src="../assets/bag.jpg" alt=""/>
- <!-- <el-image class="lupian" src="../assets/bag.jpg" alt=""></el-image> -->
- <div class="dengluk">
- <h3 style="margin-bottom: 20px;">{{$t('loding.cte')}}</h3>
- <div style="display: flex;align-items: center;font-size: 13px;justify-content: space-between;width: 325px;">
- <div>{{$t('loding.lang')}}</div>
- <i18n-select></i18n-select>
- </div>
- <div class="shulank">
- <div class="hengxk">
- <i class="el-icon-user" style="color: #505050; margin-right: 10px;"></i>
- <el-input v-model="name" :placeholder="$t('loding.username')" style="width: 300px;"></el-input>
- </div>
- <div class="hengxk" style="margin-top: 20px;">
- <i class="el-icon-unlock" style="color: #505050; margin-right: 10px;"></i>
- <el-input v-model="pad" :placeholder="$t('loding.pasd')" show-password style="width: 300px;"></el-input>
- </div>
- </div>
- <el-button type="primary" style="margin-top: 10px; width: 300px;height: 40px;" @click="gotiaozhuan">{{$t('loding.logng')}}</el-button>
- </div>
- </div>
- </template>
- <script>
- import {loding,getuser} from '@/api/loding';
- import { encrypt,decrypt } from '@/router/jsencrypt';
- import i18nSelect from "../components/i18n.vue"
- export default{
- components: { i18nSelect },
- name:"AboutView",
- data(){
- return {
- name:'',
- pad:''
- }
- },
- created() {
- this.getloduser();
- i18nSelect.created()
- },
- methods:{
- getloduser(){
- getuser().then(response => {
- // console.log("获取用户",response);
- if(response.code==200){
- localStorage.setItem('user', JSON.stringify(response.data));
- this.$router.push('/index');
- }
- });
- },
- gotiaozhuan(){
- if(this.name==''){
- this.$message({
- message:this.$t('loding.txuse'),
- type: 'warning'
- });
- return
- }
- if(this.pad==''){
- this.$message({
- message: this.$t('loding.txpad'),
- type: 'warning'
- });
- return
- }
- loding({
- userName:this.name,
- password:encrypt(this.pad),
- cid:''
- }).then(response => {
- console.log("请求数据",response);
- if(response.code==200){
- localStorage.setItem('token', response.token);
- localStorage.setItem('user', JSON.stringify(response.data));
- this.$router.push('/index');
- }else{
- this.$message.error(response.msg);
- }
- });
- }
- }
- }
- </script>
- <style>
- .about{
- display: flex;
- align-items: center;
- justify-content: center;
- width: 100vw;
- height: 100vh;
- }
- .shulank{
- margin: 20px 0;
- }
- .hengxk{
- display: flex;
- align-items: center;
- }
- .dengluk{
- position: absolute;
- z-index: 999;
- width: 400px;
- background-color: rgba(255, 255, 255, 0.8);
- border-radius: 10px;
- padding: 30px;
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- }
- .lupian{
- width: 100vw;
- height: 100vh;
- object-fit: cover;
- /* Sobject-position: 20% 20%; */
- }
- </style>
|