f587b9a9 by yangwei

根据子系统code获取子系统详细信息

1 parent 7bdc3051
......@@ -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,
};
......@@ -39,9 +39,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 +55,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 +120,15 @@ export default {
});
},
},
computed: {
productName() {
return this.$store.state.products.products.name;
},
},
components: {},
};
</script>
<style scoped lang="scss">
<style scoped lang="scss">
.bg {
width: 100%;
height: 100%;
......@@ -120,7 +150,7 @@ export default {
.login .user_style {
margin: 40px 20px 0;
h3{
h3 {
color: #fff;
font-weight: normal;
text-align: center;
......@@ -174,5 +204,4 @@ export default {
color: #fff;
}
</style>
<style>
</style>
<style></style>
......