main
校文 3 years ago
parent f2262e056d
commit 3274ce0704

@ -24,3 +24,12 @@ export function quit(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) {
Vue.mixin({
computed: {
...mapGetters(['getToken','getCommunityCode','getSelectedKeys', 'getOpenKeys','getCity'])
...mapGetters(['getToken','getCommunityCode','getSelectedKeys', 'getOpenKeys','getCity','getUserInfo'])
},
methods: {
...mapActions(['setToken','setCommunityCode','setSelectedKeys', 'setOpenKeys','setCity'])
...mapActions(['setToken','setCommunityCode','setSelectedKeys', 'setOpenKeys','setCity','setUserInfo'])
}
})
}

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

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

@ -27,6 +27,11 @@ const mutations = {
},
setCity (state, 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')) || [],
token: sessionStorage.getItem('token') || "",
communityCode: sessionStorage.getItem('communityCode') || "",
cityList:[]
cityList:[],
userInfo: JSON.parse(sessionStorage.getItem('userInfo')) || {},
}
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" type="alert" />
<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>
</a-layout-header>
<div class="l-h-d1">
@ -85,11 +85,7 @@ export default {
{
label: "运营管理",
value: "operation"
},
// {
// label: "",
// value: "setting"
// }
}
],
};
},

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

Loading…
Cancel
Save