index.js 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. let userid = "2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf";
  2. let username = "潘明";
  3. let oatoken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyYTdjYmRlZS05MzkxLWNkOGItY2Q4ZC03Y2M3OGU4OGU5YmYiLCJjbGllbnRpZCI6ImFuZHJvaWRjbGllbnQiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIFJlZmluZUFQSSIsImV4cCI6MTY5MzcwMDg3MCwiY29uZmlnIjoiMjAyMC0yMDk5In0.y676CAVOX2P1EmwxXGN8QW7ihfZUsNXfxpNRVmCT-P0";
  4. let avatar = "http://10.233.22.205:8088/fs/avatar/show/2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf";
  5. let maintoken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI4YTY5OTY2NDg3NDllMzRiMDE4N2IwYzk1YmU2NzNiYyIsImFwcE5hbWUiOiLlubPlj7Dpl6jmiLflkI7lj7DnrqHnkIYiLCJhcHBDb2RlIjoiemh6ZnpscHQiLCJ0eXBlIjoiVVNFUl9QQVNTV09SRCIsInVzZXJOYW1lIjoi5r2Y5piOIiwidXNlcklkIjoiOGE2OTk2NjQ4NzQ5ZTM0YjAxODdiMGM5NWJlNjczYmMiLCJzZWNyZXRMZXZlbCI6MCwicmFuZG9tIjoiTEMwMmlBIiwibG9naW5OYW1lIjoicGFubWluZyIsImFwcElkIjoiOGE2OTk2NjQ4NmU0ODQ3ODAxODZlZDI4YWUxNTA0NzYiLCJEc3BUb2tlbiI6ImNhNDM4OGI3NTU5OTQ1NGNlYjU2NjM4OGVkNDU4M2ZhZDExZmY3MzY4ODhhNmMwMmNmZWI1YjdkYmM0ZDJkZWM4Mzk2ZWRkM2JhNmE5Yzk2IiwiZXhwIjoxNjkwMTA0Mzg4LCJpYXQiOjE2OTAxMDA3ODh9.As_kz7yCOVprvHtG0FwyipyVX2ojisToy59DVgRey9c"
  6. // let userid = "";
  7. // let username = "";
  8. // let oatoken = "";
  9. // let avatar = ""
  10. window.addEventListener("flutterInAppWebViewPlatformReady", function () {
  11. window.flutter_inappwebview
  12. .callHandler("getuserinfo", "")
  13. .then(function (res) {
  14. userid = res.username;
  15. username = res.name;
  16. oatoken = res.oatoken;
  17. avatar = res.avatar;
  18. })
  19. });
  20. console.log(oatoken)
  21. setTimeout(function () {
  22. let indexVue = new Vue({
  23. el: "#indexBox",
  24. data: {
  25. apiurl: apiurl,//基础的页面请求地址
  26. userId: userid, //用户id
  27. userName: username, //用户中文名
  28. token: oatoken,
  29. avatar: avatar,
  30. maintoken: maintoken
  31. },
  32. methods: {
  33. selectFunc: (index) => {
  34. if (_this.token != "" && _this.token != undefined && _this.token != null) {
  35. if (index == 1) {
  36. location.href = "tpl/shouwenbg/list.html";
  37. }
  38. if (index == 2) {
  39. location.href = "tpl/fawenbg/list.html";
  40. }
  41. if (index == 3) {
  42. location.href = "tpl/fawendw/list.html";
  43. }
  44. if (index == 4) {
  45. location.href = "tpl/shixiangdb/list.html";
  46. }
  47. if (index == 5) {
  48. location.href = "tpl/wenjianshow/list.html";
  49. }
  50. if (index == 6) {
  51. location.href = "tpl/tongzhibg/list.html";
  52. }
  53. if (index == 7) {
  54. location.href = "http://10.233.22.218/jyzzjzdt/#/outSearchData?token=" + _this.maintoken;
  55. }
  56. if (index == 8) {
  57. location.href = "http://10.233.22.220/stockAPictureCollect?token=" + _this.maintoken;
  58. }
  59. if (index == 9) {
  60. location.href = "http://10.233.22.220/stockAPictureCollect?token=" + _this.maintoken;
  61. }
  62. if (index == 10) {
  63. location.href = "http://10.233.22.220/stockAPictureCollect?token=" + _this.maintoken;
  64. }
  65. if (index == 11) {
  66. location.href = "http://10.233.22.220/stockAPictureCollect?token=" + _this.maintoken;
  67. }
  68. if (index == 12) {
  69. location.href = "tpl/kaoqin/index.html";
  70. }
  71. if (index == 13) {
  72. location.href = "tpl/jiaban/index.html";
  73. }
  74. if (index == 14) {
  75. location.href = "http://10.233.22.204:8088/glworkweb/tpl/deskunit/sqgs.html?type=phone&token=" + _this.token;
  76. }
  77. if (index == 15) {
  78. location.href = "http://10.233.22.204:8088/glworkweb/tpl/deskunit/szjc.html?type=phone&token=" + _this.token;
  79. }
  80. if (index == 16) {
  81. location.href = "http://10.233.22.204:8088/glworkweb/tpl/deskunit/shjd.html?token=" + _this.token;
  82. }
  83. if (index == 17) {
  84. location.href = "http://10.233.22.204:8088/glworkweb/tpl/deskunit/bjtx.html?token=" + _this.token;
  85. }
  86. if (index == 18) {
  87. location.href = "http://10.233.22.204:8088/glworkweb/tpl/deskunit/gcsy.html?type=phone&token=" + _this.token;
  88. }
  89. if (index == 19) {
  90. location.href = "tpl/huiyishibg/list.html";
  91. }
  92. } else {
  93. _this.$nextTick(() => {
  94. $.toast.prototype.defaults.duration = 1000;
  95. $.toast("暂无授权", 'cancel', function () {
  96. });
  97. })
  98. }
  99. }
  100. },
  101. created: function () {
  102. _this = this;
  103. localStorage.setItem("mobile-token", _this.token);
  104. localStorage.setItem("mobile-userName", _this.userName);
  105. localStorage.setItem("mobile-userId", _this.userId);
  106. localStorage.setItem("mobile-avatar", _this.avatar);
  107. }
  108. ,
  109. mounted: function () {
  110. }
  111. })
  112. }, 500)