获取用户信息接口更换

ui1
Joel 3 years ago
parent 62947f6b0c
commit 5e99bfb0fc
  1. 9
      src/api/index.js
  2. 7
      src/layouts/header/index.vue
  3. 4
      src/pages/account/login/index.vue
  4. 12
      src/store/modules/user.js

@ -1,3 +1,11 @@
/*
* @Author: your name
* @Date: 2021-11-03 14:33:21
* @LastEditTime: 2021-11-08 15:20:25
* @LastEditors: your name
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \questionnaired:\code\FE_huoran_data\src\api\index.js
*/
import Setting from '@/setting'
let host1 = 'http://192.168.31.125:9000'//林
let host2 = 'http://192.168.31.137:9000'// 陈赓
@ -37,6 +45,7 @@ export default {
sendPhoneOrEmailCode: `/users/users/userAccount/sendPhoneOrEmailCode`,
bindPhoneOrEmail: `/users/users/userAccount/bindPhoneOrEmail`,
examinePassword: `/users/users/userAccount/examinePassword`,
isClient: `/users/users/user/isClient`,
userTemplate: `http://39.108.250.202/template/%E6%95%B0%E6%8D%AE%E5%B9%B3%E5%8F%B0%E7%94%A8%E6%88%B7%E5%AF%BC%E5%85%A5%E6%A8%A1%E6%9D%BF.xlsx`,
// 角色管理

@ -113,9 +113,8 @@ export default {
let customer = atob(decodeURI(this.customer)) == 'false' ? false : true
this.setCustomer(customer)
}
// ,
this.token && this.getUserInfo()
// ,
this.token && this.isCustomer && this.getUserInfo()
},
methods: {
...mapActions('user', [
@ -125,7 +124,7 @@ export default {
this.$get(this.api.userInfo).then(res => {
let userInfo = res.userInfo ? res.userInfo : {}
let userAccount = res.userAccount
let isManager = userAccount.roleId != '0'
let isManager = userAccount.roleId != '0' //
this.isUser = isManager
let mg = this.$route.query.mg
//

@ -188,7 +188,9 @@ export default {
this.form.phone = this.phone
this.phoneVisible = false
this.setCustomer(res.customer)
this.$get(this.api.isClient).then(res => {
this.setCustomer(res.customer)
}).catch(res => {})
util.local.set(Setting.tokenKey,res.token,43200000)
util.successMsg('登录成功')
setTimeout(() => {

@ -1,3 +1,11 @@
/*
* @Author: your name
* @Date: 2021-11-03 14:33:21
* @LastEditTime: 2021-11-08 15:26:33
* @LastEditors: Please set LastEditors
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \questionnaired:\code\FE_huoran_data\src\store\modules\user.js
*/
import Setting from '@/setting'
import util from '@/libs/util'
@ -44,9 +52,11 @@ export default {
platform: Setting.platformId, // 所属平台id(1.职站 2.数据平台 3.中台)
}).then(res => {
if(res.status == 200){
commit('SET_CUSTOMER',res.data.customer)
util.local.set(Setting.tokenKey,res.data.token,43200000)
util.successMsg('登录成功')
get(api.isClient).then(res => {
commit('SET_CUSTOMER',res.customer)
}).catch(res => {})
setTimeout(() => {
// 登录次数+1
post(api.saveRecord,{

Loading…
Cancel
Save