|
@@ -7,7 +7,7 @@
|
|
style="margin: 0 auto; display: block; margin-bottom: 35px"
|
|
style="margin: 0 auto; display: block; margin-bottom: 35px"
|
|
/>
|
|
/>
|
|
<div class="loginTitle">用 户 登 录</div>
|
|
<div class="loginTitle">用 户 登 录</div>
|
|
- <el-form ref="form" :model="form" style="padding: 0 35px;">
|
|
|
|
|
|
+ <el-form ref="form" :model="form" style="padding: 0 35px">
|
|
<el-input
|
|
<el-input
|
|
style="margin-top: 30px"
|
|
style="margin-top: 30px"
|
|
placeholder="请输入用户名"
|
|
placeholder="请输入用户名"
|
|
@@ -24,7 +24,7 @@
|
|
>
|
|
>
|
|
</el-input>
|
|
</el-input>
|
|
<el-form-item>
|
|
<el-form-item>
|
|
- <!-- background: linear-gradient(-90deg, #23cffd, #1f81e7); -->
|
|
|
|
|
|
+ <!-- background: linear-gradient(-90deg, #23cffd, #1f81e7); -->
|
|
<el-button
|
|
<el-button
|
|
type="primary"
|
|
type="primary"
|
|
round
|
|
round
|
|
@@ -33,7 +33,7 @@
|
|
margin-top: 15px;
|
|
margin-top: 15px;
|
|
display: block;
|
|
display: block;
|
|
width: 100%;
|
|
width: 100%;
|
|
- background: #7CC8F8;
|
|
|
|
|
|
+ background: #7cc8f8;
|
|
border: none;
|
|
border: none;
|
|
"
|
|
"
|
|
>
|
|
>
|
|
@@ -47,8 +47,8 @@
|
|
|
|
|
|
<script>
|
|
<script>
|
|
// @ is an alias to /src
|
|
// @ is an alias to /src
|
|
- let sha256 = require("js-sha256").sha256
|
|
|
|
-import {loginv2} from "@/api/index.js"
|
|
|
|
|
|
+let sha256 = require("js-sha256").sha256;
|
|
|
|
+import { loginv2 } from "@/api/index.js";
|
|
export default {
|
|
export default {
|
|
name: "Login",
|
|
name: "Login",
|
|
data() {
|
|
data() {
|
|
@@ -62,17 +62,19 @@ export default {
|
|
mounted() {},
|
|
mounted() {},
|
|
computed: {},
|
|
computed: {},
|
|
methods: {
|
|
methods: {
|
|
- onSubmit(){
|
|
|
|
- let from = new FormData();
|
|
|
|
- from.append("username", this.form.username)
|
|
|
|
- from.append("sign", sha256(this.form.username+this.form.password).toLowerCase())
|
|
|
|
- console.log(from)
|
|
|
|
- loginv2(from).then(r=>{
|
|
|
|
- localStorage.token = r.token || "";
|
|
|
|
- localStorage.login = this.form.username || "";
|
|
|
|
- this.$router.replace({path: "/main" })
|
|
|
|
- })
|
|
|
|
- }
|
|
|
|
|
|
+ onSubmit() {
|
|
|
|
+ let from = new FormData();
|
|
|
|
+ from.append("username", this.form.username);
|
|
|
|
+ from.append(
|
|
|
|
+ "sign",
|
|
|
|
+ sha256(this.form.username + this.form.password).toLowerCase()
|
|
|
|
+ );
|
|
|
|
+ loginv2(from).then(r => {
|
|
|
|
+ localStorage.token = r.token || "";
|
|
|
|
+ localStorage.login = this.form.username || "";
|
|
|
|
+ this.$router.replace({ path: "/main" });
|
|
|
|
+ });
|
|
|
|
+ },
|
|
},
|
|
},
|
|
components: {},
|
|
components: {},
|
|
};
|
|
};
|
|
@@ -91,7 +93,7 @@ export default {
|
|
padding-top: 22px;
|
|
padding-top: 22px;
|
|
width: 521px;
|
|
width: 521px;
|
|
height: 447px;
|
|
height: 447px;
|
|
- background: rgba(255,255,255, .2);
|
|
|
|
|
|
+ background: rgba(255, 255, 255, 0.2);
|
|
margin-top: 205px;
|
|
margin-top: 205px;
|
|
border-radius: 3px;
|
|
border-radius: 3px;
|
|
margin-right: 103px;
|
|
margin-right: 103px;
|