环卫车小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
517 B

4 months ago
  1. export default {
  2. state: {
  3. token:"",
  4. userInfo : {}, //用户信息
  5. },
  6. mutations: {
  7. onAuth(state){
  8. },
  9. setUserInfo(state,obj){
  10. state.userInfo = obj.userInfo
  11. state.token = obj.token
  12. },
  13. logout(state){
  14. uni.showModal({
  15. title: '确认退出登录吗',
  16. success(r) {
  17. if(r.confirm){
  18. state.userInfo = {}
  19. state.token = ""
  20. uni.removeStorageSync('token')
  21. uni.redirectTo({
  22. url: '/pages/index/index'
  23. })
  24. }
  25. }
  26. })
  27. },
  28. },
  29. actions: {}
  30. }