index1.js 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. let userid = "2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf";
  2. let username = "潘明";
  3. let oatoken = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIyYTdjYmRlZS05MzkxLWNkOGItY2Q4ZC03Y2M3OGU4OGU5YmYiLCJjbGllbnRpZCI6ImFuZHJvaWRjbGllbnQiLCJncmFudF90eXBlIjoicGFzc3dvcmQiLCJzY29wZSI6Im9wZW5pZCBwcm9maWxlIGVtYWlsIFJlZmluZUFQSSIsImV4cCI6MTY4NTgxNTIwMSwiY29uZmlnIjoiMjAyMC0yMDk5In0.ws-CyJ-qS-8A4cQg4wGLnshNzO0YgR-tsG2TB-owmuc";
  4. let avatar = "http://10.233.22.205:8088/fs/avatar/show/2a7cbdee-9391-cd8b-cd8d-7cc78e88e9bf";
  5. let maintoken = "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJVMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwOSIsImFwcE5hbWUiOiJPQeWKnuWFrOeuoeeQhiIsImFwcENvZGUiOiJvYWJnZ2wiLCJ0eXBlIjoiVVNFUl9QQVNTV09SRCIsInVzZXJOYW1lIjoi6LaF57qn566h55CG5ZGYIiwidXNlcklkIjoiVTAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDkiLCJzZWNyZXRMZXZlbCI6MCwicmFuZG9tIjoiNjllV0ZYIiwibG9naW5OYW1lIjoidGVzdCIsImFwcElkIjoiOGE1MDJjOGU4NWY2MWQ2YjAxODYyYWJkNzg3MjI1M2EiLCJEc3BUb2tlbiI6ImU4YmZhMjBmYTA5Njg1MjJiODkyZTUxODQ1MjdlNDA0NDk0ZThiMzY2ZGQ5YTQ1NmI3NjI4YjIyMTdlZWMyNjYiLCJleHAiOjE2ODUwODk1OTMsImlhdCI6MTY4NTA4NTk5M30.d1DizLEusr8eEw1wHU1JXTBzYMORe0cIFvAVBvDszfY"
  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. } else {
  69. _this.$nextTick(() => {
  70. $.toast.prototype.defaults.duration = 1000;
  71. $.toast("暂无授权", 'cancel', function () {
  72. });
  73. })
  74. }
  75. }
  76. },
  77. created: function () {
  78. _this = this;
  79. localStorage.setItem("mobile-token", _this.token);
  80. localStorage.setItem("mobile-userName", _this.userName);
  81. localStorage.setItem("mobile-userId", _this.userId);
  82. localStorage.setItem("mobile-avatar", _this.avatar);
  83. }
  84. ,
  85. mounted: function () {
  86. }
  87. })
  88. }, 500)