Commit c1f08ee4 authored by 罗超's avatar 罗超

1

parent bcdf5134
// import { ResultType } from '@/@types/enumHelper'
// import router from '@/router'
// import { UserActionsType } from '@/store/modules/user/actions'
// import { UserGetter } from '@/store/modules/user/getters'
// import { dispatchAction, getStoreGetter, setStoreState } from '@/store/utils'
import { ResultType } from '@/@types/enumHelper'
import router from '@/router'
import { UserActionsType } from '@/store/modules/user/actions'
import { UserGetter } from '@/store/modules/user/getters'
import { dispatchAction, getStoreGetter, setStoreState } from '@/store/utils'
import message from '@/utils/message'
import { reactive, ref } from 'vue'
import UserService from '@/api/user'
......@@ -40,46 +41,29 @@ const userUserLoginModule = () => {
message.warnMsg('请完善登录信息')
stateManager.subLogin = false
} else {
setTimeout(async () => {
//#region 测试使用
const param = {
Account: userModel.username,
Password: userModel.password
}
// dispatchAction<UserActionsType>('user', 'userLogin', param)
const param = {
Account: userModel.username,
Password: userModel.password
}
// const menu:any = {
// menuId: 1,
// menuName: '首页',
// menuUrl: '/index'
// }
// const menu2:any = {
// menuId: 2,
// menuName: '首页',
// menuUrl: '/'
// }
// const menus: Array<any> = []
// const auths = getStoreGetter<UserGetter>('user', 'getUserAllAuth')
dispatchAction<UserActionsType>('user', 'userLogin', param)
UserService.login(param).then(res => {
// let menus: Array<any> = []
const auths = getStoreGetter<UserGetter>('user', 'getUserAllAuth')
console.log(70, auths, ResultType.EmptyArray)
// if (auths != ResultType.EmptyArray) {
// Object.assign(menus, ...auths)
// }
// menus.push(menu)
// menus.push(menu2)
//-------------
UserService.login(param).then(res => {
console.log(72, res)
console.log(72, res.data.Data.MenuList)
setStoreState('user', 'menuList', res.data.Data.MenuList)
router.push({
path: '/index'
})
// setStoreState('user', 'menuList', menus)
// message.successMsg('登录成功')
// stateManager.subLogin = false
// router.push({
// path: '/index'
// })
//#endregion
}, 2000)
message.successMsg('登录成功')
stateManager.subLogin = false
})
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment