bbe4fd80 by xiaomiao
2 parents fe37ae55 7ce6cf1a
......@@ -6,10 +6,6 @@ module.exports = {
"@vue/app",
{
"useBuiltIns": "entry",
polyfills: [
'es6.promise',
'es6.symbol'
]
}
]
],
......
......@@ -5,7 +5,7 @@
{{ dicData["sysCode"] && dicData["sysCode"][0].DNAME }}
</div>
<div class="user">
欢迎进入系统 {{ name }}
欢迎进入系统 {{ userInfo.name }}
<span @click="onCancel">
<svg-icon icon-class="close" class="closeStyle" />退出系统</span
>
......@@ -30,13 +30,14 @@ export default {
sidebarRight,
},
computed: {
...mapGetters(["sidebar", "dicData", "name"]),
...mapGetters(["sidebar", "dicData", "userInfo"]),
},
methods: {
onCancel() {
logout()
.then((res) => {
sessionStorage.removeItem("token");
this.$store.dispatch("user/resetState");
this.$router.replace({
path: "/login",
query: {
......
......@@ -17,7 +17,7 @@ let mixin = {
...mapGetters(['dicData'])
},
created () {
// this.featchData()
this.handleSearch()
},
methods: {
// 表格索引得问题
......
......@@ -37,8 +37,6 @@ router.beforeEach(async (to, from, next) => {
"permission/generateRoutes",
getMenuData
);
// 获取用户信息
await store.dispatch("user/getUserInfo");
router.addRoutes([
...accessRoutes,
{ path: "*", redirect: "/404", hidden: true },
......
......@@ -5,13 +5,13 @@ const getters = {
visitedViews: state => state.tagsView.visitedViews,
cachedViews: state => state.tagsView.cachedViews,
avatar: state => state.user.avatar,
name: state => state.user.name,
userInfo: state => state.user.userInfo,
permission_routes: state => state.permission.routes,
addRoutes: state => state.permission.addRoutes,
// business
rules: state => state.business.rules,
dicData: state => state.dict.dicData,
Edit: state => state.business.Edit,
businessInfo: state => state.dictionaries.businessInfo
businessInfo: state => state.dictionaries.businessInfo,
products: state => state.products.products
}
export default getters
......
const state = {
products: null,
};
const mutations = {
SET_PRODUCTS: (state,data) => {
state.products = data;
},
};
const actions = {
setData({ commit },data) {
commit("SET_PRODUCTS",data);
},
};
export default {
namespaced: true,
state,
mutations,
actions,
};
import { getUserInfo } from "@/api/user";
const state = {
hasUser: false,
name: "",
avatar: "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
userInfo: null,
};
const mutations = {
SET_USERINFO: (state, data) => {
state.hasUser = true;
state.userInfo = data;
state.name = data.loginName;
},
RESET_USER: (state) => {
state.hasUser = false;
state.userInfo = null;
},
};
const actions = {
getUserInfo({ commit }) {
if (!state.hasUser) {
return new Promise(async (resolve) => {
let { result: res } = await getUserInfo();
commit("SET_USERINFO", res);
resolve(true);
});
}else{
return
}
return new Promise(async (resolve) => {
let { result: res } = await getUserInfo();
commit("SET_USERINFO", res);
resolve(true);
});
},
resetdict({ commit }) {
resetState({ commit }) {
commit("RESET_USER");
},
};
......
......@@ -9,7 +9,7 @@
<div class="d-flex">
<dv-decoration-8 class="dv-dec-8" :color="decorationColor" />
<div class="title">
<span class="title-text">汉中市不动产监管大屏</span>
<span class="title-text">{{ products.name }}}</span>
<dv-decoration-5
:dur="1"
class="dv-dec-5"
......@@ -60,6 +60,9 @@ export default {
}, 500);
},
},
computed: {
...mapGetters(["products"]),
},
};
</script>
......
......@@ -11,11 +11,16 @@
class="demo-ruleForm"
>
<el-form-item prop="account">
<el-input v-model="user.account" placeholder="用户名"></el-input>
<el-input
class="username"
v-model="user.account"
placeholder="用户名"
></el-input>
</el-form-item>
<el-form-item prop="password">
<el-input
type="password"
class="password"
v-model="user.password"
placeholder="登录密码"
></el-input>
......@@ -39,9 +44,10 @@
<script>
import { loginIn } from "@/api/login.js";
import { api, getAction } from "@/api/manageApi";
export default {
name: "Login",
data: function () {
data() {
return {
user: {
account: "",
......@@ -54,7 +60,31 @@ export default {
},
};
},
mounted: function () {
created() {
const params = {};
const queryOptions = {
conditionGroup: {
conditions: [
{
property: "code",
value: "BDCJGPT",
operator: "EQ",
},
],
queryRelation: "AND",
},
};
params.queryOptions = JSON.stringify(queryOptions);
//根据子系统code获取子系统详细信息
getAction(api.subsystem, params).then((res) => {
if (res.status === 1) {
this.$store.dispatch("products/setData", res.content[0]);
} else {
this.$message.error({ message: res.message, showClose: true });
}
});
},
mounted() {
// this.checkUserName();
},
methods: {
......@@ -95,10 +125,22 @@ export default {
});
},
},
computed: {
productName() {
return this.$store.state.products.products.name;
},
},
components: {},
};
</script>
<style scoped lang="scss">
<style scoped lang="scss">
.username,
.password {
/deep/ .el-input__inner {
border: 1px solid #6bc1fc;
background-color: transparent !important;
}
}
.bg {
width: 100%;
height: 100%;
......@@ -120,14 +162,13 @@ export default {
.login .user_style {
margin: 40px 20px 0;
h3{
h3 {
color: #fff;
font-weight: normal;
text-align: center;
margin-bottom: 20px;
}
}
.login .btn {
width: 100%;
height: 6vh;
......@@ -158,21 +199,9 @@ export default {
#loginform .el-input__inner {
width: 100% !important;
caret-color: #000 !important;
color: #606266 !important;
border-radius: 4px !important;
border: 1px solid #67c23a !important;
background: #fff !important;
opacity: 1 !important;
}
#loginform .el-input__inner::-webkit-input-placeholder {
/* WebKit browsers */
color: #80807f !important;
}
.el-checkbox__label {
color: #fff;
}
</style>
<style>
</style>
......
......@@ -291,7 +291,7 @@ export default {
handleSubmit () {
editDictNode({
dictid: this.details.rowData.dictid,
typeid: this.details.rowData.typeid,
typeid: this.details.rowData.TYPEID,
children: this.tableData,
}).then((res) => {
if (res.code === 200) {
......