start.vue 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <view class="statr">
  3. <image src="../../static/statr.png" mode="" class="img"></image>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. }
  11. },
  12. methods: {
  13. async getlistinfo() {
  14. const res = await this.$myRequest({
  15. url: '/api/api_gateway?method=sysmenage.usermanager.user_info',
  16. })
  17. console.log(res)
  18. this.app = res.children.filter((item) => {
  19. return item.purview_name == "APP"
  20. })
  21. // console.log(this.app)
  22. if (this.app.length == 0) {
  23. uni.setTabBarItem({
  24. index: 0,
  25. visible: false
  26. });
  27. uni.setTabBarItem({
  28. index: 1,
  29. visible: false
  30. });
  31. uni.switchTab({
  32. url: "../response/index"
  33. })
  34. } else {
  35. var renwu = this.app[0].children.some((item) => {
  36. // console.log(item)
  37. return item.purview_name == "我的任务"
  38. })
  39. var jiandu = this.app[0].children.some((item) => {
  40. // console.log(item)
  41. return item.purview_name == "监督"
  42. })
  43. if (renwu) {
  44. uni.setTabBarItem({
  45. index: 0,
  46. visible: true
  47. });
  48. } else {
  49. uni.setTabBarItem({
  50. index: 0,
  51. visible: false
  52. });
  53. }
  54. if (jiandu) {
  55. uni.setTabBarItem({
  56. index: 1,
  57. visible: true
  58. });
  59. } else {
  60. uni.setTabBarItem({
  61. index: 1,
  62. visible: false
  63. });
  64. }
  65. if(renwu){
  66. uni.switchTab({
  67. url: "../index/index"
  68. })
  69. }else{
  70. uni.switchTab({
  71. url: "../supervise/index"
  72. })
  73. }
  74. }
  75. // console.log(this.app)
  76. },
  77. },
  78. onLoad() {
  79. uni.getStorage({
  80. key: 'session_key',
  81. success: (res) => {
  82. console.log(res)
  83. console.log(555555555)
  84. if (res.data == "") {
  85. uni.navigateTo({
  86. url: "../login/login"
  87. })
  88. } else {
  89. this.getlistinfo()
  90. }
  91. },
  92. fail:()=> {
  93. console.log(111999)
  94. uni.navigateTo({
  95. url: "../login/login",
  96. })
  97. }
  98. })
  99. }
  100. }
  101. </script>
  102. <style lang="less" scoped>
  103. .statr{
  104. width: 100%;
  105. height: 100vh;
  106. .img{
  107. width: 100%;
  108. height: 100%;
  109. }
  110. }
  111. </style>