mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2025-12-18 17:05:54 +08:00
v4.2.5
This commit is contained in:
@@ -2,38 +2,66 @@
|
||||
<div class="login" @click="$refs.verify.show = false">
|
||||
<Row type="flex" @keydown.enter.native="submitLogin">
|
||||
<Col style="width: 368px">
|
||||
<Header />
|
||||
<Row style="flex-direction: column;">
|
||||
<Form ref="usernameLoginForm" :model="form" :rules="rules" class="form">
|
||||
<FormItem prop="username">
|
||||
<Input v-model="form.username" prefix="ios-contact" size="large" clearable placeholder="请输入用户名"
|
||||
autocomplete="off" />
|
||||
</FormItem>
|
||||
<FormItem prop="password">
|
||||
<Input type="password" v-model="form.password" prefix="ios-lock" size="large" password placeholder="请输入密码"
|
||||
autocomplete="off" />
|
||||
</FormItem>
|
||||
</Form>
|
||||
<Header />
|
||||
<Row style="flex-direction: column">
|
||||
<Form
|
||||
ref="usernameLoginForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
class="form"
|
||||
>
|
||||
<FormItem prop="username">
|
||||
<Input
|
||||
v-model="form.username"
|
||||
prefix="ios-contact"
|
||||
size="large"
|
||||
clearable
|
||||
placeholder="请输入用户名"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</FormItem>
|
||||
<FormItem prop="password">
|
||||
<Input
|
||||
type="password"
|
||||
v-model="form.password"
|
||||
prefix="ios-lock"
|
||||
size="large"
|
||||
password
|
||||
placeholder="请输入密码"
|
||||
autocomplete="off"
|
||||
/>
|
||||
</FormItem>
|
||||
</Form>
|
||||
|
||||
<Row>
|
||||
<div class="login-btn" type="primary" size="large" :loading="loading" @click="submitLogin" long>
|
||||
<span v-if="!loading">登录</span>
|
||||
<span v-else>登录中</span>
|
||||
</div>
|
||||
<Row>
|
||||
<div
|
||||
class="login-btn"
|
||||
type="primary"
|
||||
size="large"
|
||||
:loading="loading"
|
||||
@click="submitLogin"
|
||||
long
|
||||
>
|
||||
<span v-if="!loading">登录</span>
|
||||
<span v-else>登录中</span>
|
||||
</div>
|
||||
</Row>
|
||||
</Row>
|
||||
|
||||
</Row>
|
||||
<Footer />
|
||||
<!-- 拼图验证码 -->
|
||||
<verify ref="verify" class="verify-con" verifyType="LOGIN" @change="verifyChange"></verify>
|
||||
<Footer />
|
||||
<!-- 拼图验证码 -->
|
||||
<verify
|
||||
ref="verify"
|
||||
class="verify-con"
|
||||
verifyType="LOGIN"
|
||||
@change="verifyChange"
|
||||
></verify>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getCurrentPermissionList } from "@/api/index";
|
||||
import { login, userMsg } from "@/api/index";
|
||||
import Cookies from "js-cookie";
|
||||
import Header from "@/views/main-components/header";
|
||||
@@ -76,6 +104,10 @@ export default {
|
||||
},
|
||||
};
|
||||
},
|
||||
created() {
|
||||
window.localStorage.setItem("menuData", "");
|
||||
},
|
||||
|
||||
methods: {
|
||||
afterLogin(res) {
|
||||
let accessToken = res.result.accessToken;
|
||||
@@ -85,6 +117,10 @@ export default {
|
||||
// 获取用户信息
|
||||
userMsg().then((res) => {
|
||||
if (res.success) {
|
||||
// location.reload();
|
||||
// this.$router.go(0);
|
||||
|
||||
console.log("Huoqu ");
|
||||
this.setStore("saveLogin", this.saveLogin);
|
||||
if (this.saveLogin) {
|
||||
// 保存7天
|
||||
@@ -94,9 +130,10 @@ export default {
|
||||
} else {
|
||||
Cookies.set("userInfoSeller", JSON.stringify(res.result));
|
||||
}
|
||||
|
||||
util.initRouter(this);
|
||||
this.$store.commit("setAvatarPath", res.result.storeLogo);
|
||||
// 加载菜单
|
||||
util.initRouter(this);
|
||||
this.$router.push({
|
||||
name: "home_index",
|
||||
});
|
||||
@@ -120,8 +157,8 @@ export default {
|
||||
this.loading = true;
|
||||
|
||||
let fd = new FormData();
|
||||
fd.append('username',this.form.username)
|
||||
fd.append('password',this.md5(this.form.password))
|
||||
fd.append("username", this.form.username);
|
||||
fd.append("password", this.md5(this.form.password));
|
||||
login(fd)
|
||||
.then((res) => {
|
||||
this.loading = false;
|
||||
@@ -138,7 +175,6 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.login {
|
||||
height: 100%;
|
||||
background: url("../assets/background.png") no-repeat;
|
||||
@@ -148,8 +184,6 @@ export default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
|
||||
.verify-con {
|
||||
position: absolute;
|
||||
top: 126px;
|
||||
@@ -175,9 +209,8 @@ export default {
|
||||
transition: 0.35s;
|
||||
}
|
||||
.login-btn:hover {
|
||||
opacity: .9;
|
||||
opacity: 0.9;
|
||||
border-radius: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user