parent
e522ad8f3d
commit
2cb5932a7b
@ -1,19 +1,20 @@
|
|||||||
const getters = {
|
const getters = {
|
||||||
sidebar: state => state.app.sidebar,
|
sidebar: (state) => state.app.sidebar,
|
||||||
size: state => state.app.size,
|
size: (state) => state.app.size,
|
||||||
device: state => state.app.device,
|
device: (state) => state.app.device,
|
||||||
dict: state => state.dict.dict,
|
dict: (state) => state.dict.dict,
|
||||||
visitedViews: state => state.tagsView.visitedViews,
|
visitedViews: (state) => state.tagsView.visitedViews,
|
||||||
cachedViews: state => state.tagsView.cachedViews,
|
cachedViews: (state) => state.tagsView.cachedViews,
|
||||||
token: state => state.user.token,
|
token: (state) => state.user.token,
|
||||||
avatar: state => state.user.avatar,
|
avatar: (state) => state.user.avatar,
|
||||||
name: state => state.user.name,
|
name: (state) => state.user.name,
|
||||||
introduction: state => state.user.introduction,
|
introduction: (state) => state.user.introduction,
|
||||||
roles: state => state.user.roles,
|
roles: (state) => state.user.roles,
|
||||||
permissions: state => state.user.permissions,
|
permissions: (state) => state.user.permissions,
|
||||||
permission_routes: state => state.permission.routes,
|
permission_routes: (state) => state.permission.routes,
|
||||||
topbarRouters:state => state.permission.topbarRouters,
|
topbarRouters: (state) => state.permission.topbarRouters,
|
||||||
defaultRoutes:state => state.permission.defaultRoutes,
|
defaultRoutes: (state) => state.permission.defaultRoutes,
|
||||||
sidebarRouters:state => state.permission.sidebarRouters,
|
sidebarRouters: (state) => state.permission.sidebarRouters,
|
||||||
}
|
isorgpwd: (state) => state.user.isorgpwd,
|
||||||
export default getters
|
};
|
||||||
|
export default getters;
|
||||||
|
@ -1,135 +0,0 @@
|
|||||||
<template>
|
|
||||||
<div></div>
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
import { getCodeImg, getlists } from "@/api/login";
|
|
||||||
import { getInfo } from "@/api/login";
|
|
||||||
import Cookies from "js-cookie";
|
|
||||||
import { encrypt, decrypt } from "@/utils/jsencrypt";
|
|
||||||
export default {
|
|
||||||
name: "Login",
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
codeUrl: "",
|
|
||||||
cookiePassword: "",
|
|
||||||
loginForm: {
|
|
||||||
username: "admin",
|
|
||||||
password: "admin@123Jichuang",
|
|
||||||
rememberMe: false,
|
|
||||||
code: "",
|
|
||||||
uuid: "",
|
|
||||||
},
|
|
||||||
loginRules: {
|
|
||||||
username: [
|
|
||||||
{ required: true, trigger: "blur", message: "请输入您的账号" },
|
|
||||||
],
|
|
||||||
password: [
|
|
||||||
{ required: true, trigger: "blur", message: "请输入您的密码" },
|
|
||||||
],
|
|
||||||
code: [{ required: true, trigger: "change", message: "请输入验证码" }],
|
|
||||||
},
|
|
||||||
loading: false,
|
|
||||||
// 验证码开关
|
|
||||||
captchaOnOff: false,
|
|
||||||
// 注册开关
|
|
||||||
register: true,
|
|
||||||
redirect: undefined,
|
|
||||||
form: "",
|
|
||||||
queryParams: {
|
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 10,
|
|
||||||
landUseRights: null,
|
|
||||||
type: null,
|
|
||||||
unifiedSocialCreditCode: null,
|
|
||||||
actualBusinessAddress: null,
|
|
||||||
industry: null,
|
|
||||||
belongRegion: null,
|
|
||||||
fireRating: null,
|
|
||||||
acompEvalGrade: null,
|
|
||||||
businessLicenseImg: null,
|
|
||||||
certificateImg: null,
|
|
||||||
ownershipImg: null,
|
|
||||||
fireImg: null,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
watch: {
|
|
||||||
$route: {
|
|
||||||
handler: function (route) {
|
|
||||||
this.redirect = route.query && route.query.redirect;
|
|
||||||
},
|
|
||||||
immediate: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
created() {
|
|
||||||
// this.getCode();
|
|
||||||
this.getCookie();
|
|
||||||
this.handleLogin();
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
getCode() {
|
|
||||||
getCodeImg().then((res) => {
|
|
||||||
this.captchaOnOff =
|
|
||||||
res.captchaOnOff === undefined ? true : res.captchaOnOff;
|
|
||||||
if (this.captchaOnOff) {
|
|
||||||
this.codeUrl = "data:image/gif;base64," + res.img;
|
|
||||||
this.loginForm.uuid = res.uuid;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
getCookie() {
|
|
||||||
const username = Cookies.get("username");
|
|
||||||
const password = Cookies.get("password");
|
|
||||||
const rememberMe = Cookies.get("rememberMe");
|
|
||||||
this.loginForm = {
|
|
||||||
username: username === undefined ? this.loginForm.username : username,
|
|
||||||
password:
|
|
||||||
password === undefined ? this.loginForm.password : decrypt(password),
|
|
||||||
rememberMe: rememberMe === undefined ? false : Boolean(rememberMe),
|
|
||||||
};
|
|
||||||
},
|
|
||||||
|
|
||||||
handleLogin() {
|
|
||||||
const loading = this.$loading({
|
|
||||||
lock: true,
|
|
||||||
text: "Loading",
|
|
||||||
spinner: "el-icon-loading",
|
|
||||||
background: "rgba(0, 0, 0, 0.7)",
|
|
||||||
});
|
|
||||||
this.$store.dispatch("login2", this.loginForm).then((res) => {
|
|
||||||
getInfo().then((res) => {
|
|
||||||
this.$router
|
|
||||||
.replace({
|
|
||||||
path: "/profile",
|
|
||||||
query: { routerPath: this.redirect },
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
loading.close();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style rel="stylesheet/scss" lang="scss">
|
|
||||||
.login-code {
|
|
||||||
width: 33%;
|
|
||||||
height: 38px;
|
|
||||||
float: right;
|
|
||||||
img {
|
|
||||||
cursor: pointer;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.login-code-img {
|
|
||||||
height: 38px;
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.registration {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
</style>
|
|
Loading…
Reference in new issue