auth.js 988 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. const auth = {
  2. setId(id){
  3. uni.setStorageSync("id",id)
  4. },
  5. getId(){
  6. return uni.getStorageSync("id")
  7. },
  8. setName(name){
  9. uni.setStorageSync("name",name)
  10. },
  11. getName(){
  12. return uni.getStorageSync("name")
  13. },
  14. setToken(token){
  15. uni.setStorageSync("token",token)
  16. },
  17. getToken(){
  18. return uni.getStorageSync("token")
  19. },
  20. removeToken(){
  21. uni.removeStorageSync("token")
  22. },
  23. setNick(nick){
  24. uni.setStorageSync("nick",nick)
  25. },
  26. getNick(){
  27. return uni.getStorageSync("nick")
  28. },
  29. setAccount(account){
  30. uni.setStorageSync("account",account)
  31. },
  32. getAccount(){
  33. return uni.getStorageSync("account")
  34. },
  35. setPhone(phone){
  36. uni.setStorageSync("phone",phone)
  37. },
  38. getPhone(){
  39. return uni.getStorageSync("phone")
  40. },
  41. setEmail(email){
  42. uni.setStorageSync("email",email)
  43. },
  44. getEmail(){
  45. return uni.getStorageSync("email")
  46. },
  47. setAvatar(avatar){
  48. uni.setStorageSync("avatar",avatar)
  49. },
  50. getAvatar(){
  51. return uni.getStorageSync("avatar")
  52. },
  53. }
  54. export default auth