main
校文 3 years ago
parent f2262e056d
commit 3274ce0704

@ -24,3 +24,12 @@ export function quit(params) {
data: params, data: params,
}) })
} }
// 获取用户信息
export function userInfo(params) {
return httpService({
url: `/user/manageUser/userInfo`,
method: 'post',
data: params,
})
}

@ -12,10 +12,10 @@ export default {
install(Vue) { install(Vue) {
Vue.mixin({ Vue.mixin({
computed: { computed: {
...mapGetters(['getToken','getCommunityCode','getSelectedKeys', 'getOpenKeys','getCity']) ...mapGetters(['getToken','getCommunityCode','getSelectedKeys', 'getOpenKeys','getCity','getUserInfo'])
}, },
methods: { methods: {
...mapActions(['setToken','setCommunityCode','setSelectedKeys', 'setOpenKeys','setCity']) ...mapActions(['setToken','setCommunityCode','setSelectedKeys', 'setOpenKeys','setCity','setUserInfo'])
} }
}) })
} }

@ -22,6 +22,9 @@ const actions = {
setCity: ({commit}, log) => { setCity: ({commit}, log) => {
commit('setCity', log) commit('setCity', log)
}, },
setUserInfo: ({commit}, log) => {
commit('setUserInfo', log)
},
} }
export default actions export default actions

@ -22,6 +22,9 @@ const getters = {
getCity(state) { getCity(state) {
return state.cityList return state.cityList
}, },
getUserInfo(state) {
return state.userInfo
}
} }
export default getters export default getters

@ -27,6 +27,11 @@ const mutations = {
}, },
setCity (state, data) { // 设置参数 setCity (state, data) { // 设置参数
state.cityList = data state.cityList = data
},
setUserInfo (state, log) {
state.userInfo = log
let str = JSON.stringify(log);
sessionStorage.setItem('userInfo', str);
} }
} }

@ -11,6 +11,7 @@ const state = {
openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [], openKeys: JSON.parse(sessionStorage.getItem('openKeys')) || [],
token: sessionStorage.getItem('token') || "", token: sessionStorage.getItem('token') || "",
communityCode: sessionStorage.getItem('communityCode') || "", communityCode: sessionStorage.getItem('communityCode') || "",
cityList:[] cityList:[],
userInfo: JSON.parse(sessionStorage.getItem('userInfo')) || {},
} }
export default state export default state

@ -22,7 +22,7 @@
<a-icon class="h-d2-c" style="color: #b7b7b7" type="question-circle" /> <a-icon class="h-d2-c" style="color: #b7b7b7" type="question-circle" />
<a-icon class="h-d2-c" type="alert" /> <a-icon class="h-d2-c" type="alert" />
<a-icon class="h-d2-c" style="color: #979a96;margin-right: 7px;" type="user" /> <a-icon class="h-d2-c" style="color: #979a96;margin-right: 7px;" type="user" />
<span class="h-d2-s">admin</span> <span class="h-d2-s">{{getUserInfo.actualName}}</span>
</div> </div>
</a-layout-header> </a-layout-header>
<div class="l-h-d1"> <div class="l-h-d1">
@ -85,11 +85,7 @@ export default {
{ {
label: "运营管理", label: "运营管理",
value: "operation" value: "operation"
}, }
// {
// label: "",
// value: "setting"
// }
], ],
}; };
}, },

@ -227,7 +227,7 @@
</template> </template>
<script> <script>
import { loginTel, sendTelCode } from "../../api/public/login"; import { loginTel, sendTelCode, userInfo } from "../../api/public/login";
export default { export default {
name: "Login", name: "Login",
data() { data() {
@ -350,7 +350,10 @@ export default {
this.$message.success(res.msg); this.$message.success(res.msg);
// token // token
this.setToken(res.data); this.setToken(res.data);
userInfo().then(result => {
this.setUserInfo(result.data);
this.$router.push("/"); this.$router.push("/");
})
} else { } else {
this.$message.error(res.msg); this.$message.error(res.msg);
} }

Loading…
Cancel
Save