actions.js 656 B

1234567891011121314151617181920212223242526272829
  1. import { changestatus, sysuserstatus } from 'api/api.js'
  2. export const increment = ({commit}) => {
  3. commit('INCREMENT')
  4. }
  5. export const decrement = ({commit}) => {
  6. commit('DECREMENT')
  7. }
  8. // 修改用户在线状态
  9. export const setOnlineStatus = ({commit},params)=>{
  10. changestatus(params).then(res=>{
  11. if(res.Ret == 200){
  12. commit('SET_ONLINE_STATUS',params.Status)
  13. }
  14. })
  15. }
  16. //获取用户在线状态
  17. export const getOnlineStatus = ({commit},params={})=>{
  18. sysuserstatus(params).then(res=>{
  19. console.log(res)
  20. if(res.Ret == 200){
  21. commit('GET_ONLINE_STATUS',res.Status)
  22. }
  23. })
  24. }