DESKTOP-812G6RA\PROW_006
9 days ago ee0581277156325f60fe3a1edfd8ac1645a77ec6
commit | author | age
2f1bb0 1 <template>
C 2   <div class="login">
3     <div class="top">
4       <div class="top-title">
5         <div class="left">
6           <h2>小牛集卡</h2>
7         </div>
8         <div class="right">
9           <span>入驻平台</span>
10           <span class="middle-right">|</span>
11           <span>关于我们</span>
12         </div>
13       </div>
14     </div>
15     <div class="mddile">
16       <div class="login-main">
17         <div class="login-top">
18           <div class="log-avtar">
19             <img src="../../../public/img/login/u1357.svg" alt="" />
20           </div>
21         </div>
22         <div class="register">
23           <div class="login-input">
24             <div class="login-user">
25               <el-input
26                 placeholder="请输入用户名"
27                 prefix-icon="el-icon-s-custom"
28                 v-model="userName" clearable
29               >
30               </el-input>
31             </div>
32
33             <el-input
34               placeholder="请输入密码"
35               prefix-icon="el-icon-lock" 
36               v-model="password" clearable type="password"
37             >
38             </el-input>
39           </div>
40           <div class="login-remember">
41             <div class="remember">
42               <el-checkbox v-model="checked">记住密码</el-checkbox>
43             </div>
44             <div class="forget">
45                 <router-link to="/home">忘记密码?</router-link>
46             </div>
47           </div>
48           <div class="login-btn">
49               <!-- <button> 登 录 </button> -->
50                <el-button type="danger" @click="register">登 录</el-button>
51           </div>
52         </div>
53       </div>
54     </div>
55   </div>
56 </template>
57 <script>
58 export default {
59         data(){
60             return{
61                 checked:false,
62                 password:"",
63                 userName:"",
64
65             }
66         },
67         methods:{
68              register(){
69
ee0581 70                  this.$axios.post("api/Account/LoginApi",this.$qs.stringify({"userName":this.userName,"password":this.password,"type":0})).then(res=>{
D 71                   if(res.data.IsSuccess){
72                    
73                     this.$message({message:res.data.Content,type:"success"});
74                     this.$emit("acceptlogin",false);
75                       // window.sessionStorage.setItem('token',res.data.SystemUserId)
76                     this.$store.commit('set_token',res.data.Extra.SessionId);
77                     this.$store.commit('get_user',res.data.Extra.DisplayName);
78                     this.$router.push("/home");
79                   }else{
80                     this.$message.error(res.data.Content);
81                   }
82                 }).catch(err=>{
83                   console.log(err);
84                 })
2f1bb0 85             },
C 86         }
87
88 };
89 </script>
90 <style lang="postcss" scoped>
91 .remember .el-checkbox{
92     font-size: 14px;
93     color: #fff;
94 }
95 .forget a{
96     font-size: 14px;
97     color: #000;
98 }
99 .login-remember{
100     display: flex;
101     justify-content: space-between;
102     padding: 15px 0px;
103 }
104  .login-btn button{
105      width: 100%;
106      padding: 10px;
107      background-color: #A30014;
108      outline: none;
109      border: none;
110      cursor: pointer;
111  }
112 .top {
113   width: 100%;
114   background-color: #f59a24;
115   height: 60px;
116   min-width: 1158px;
117 }
118 .top-title {
119   width: 1158px;
120   display: flex;
121   justify-content: space-between;
122   margin: 0 auto;
123 }
124 .left h2 {
125   color: #fff;
126 }
127 .left,
128 .right {
129   line-height: 60px;
130 }
131 .right span {
132   color: #fff;
133 }
134 .middle-right {
135   margin: 0 15px;
136 }
137 .mddile {
138   width: 1158px;
139   height: 600px;
140   background-image: url("../../../public/img/login/login.png");
141   background-repeat: no-repeat;
142   margin: 0 auto;
143   margin-top: 100px;
144 }
145 .login-main {
146   width: 320px;
147   height: 490px;
148   background-color: #d26443;
149   margin: 0 auto;
150   position: absolute;
151   left: 800px;
152   right: 0px; 
153   
154 }
155 .log-avtar {
156   height: 90px;
157   width: 90px;
158   background-color: #fff;
159   border-radius: 50%;
160   display: flex;
161   justify-content: center;
162   align-items: center;
163 }
164 .login-top {
165   align-content: center;
166   display: flex;
167   justify-content: center;
168   padding-top: 40px;
169 }
170 .register {
171   padding: 15px;
172 }
173 .login-user {
174   margin-bottom: 15px;
175 }
176 </style>