shangtang.vue 970 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <template>
  2. <view>
  3. <web-view :src="href"></web-view>
  4. </view>
  5. </template>
  6. <script>
  7. export default {
  8. data() {
  9. return {
  10. href: "",
  11. staff_num:"",
  12. mine_code:""
  13. };
  14. },
  15. onLoad() {
  16. this.staff_num = uni.getStorageSync('user').staff_num
  17. this.mine_code = uni.getStorageSync('mine_code')
  18. this.get_token()
  19. },
  20. methods:{
  21. get_token(){
  22. uni.request({
  23. // 登录 获取token
  24. method:"POST",
  25. url: "http://shangtang.nxjiewei.com:8011/v1/app/token/get",
  26. header:{
  27. "Content-Type": "application/json"
  28. },
  29. data: {
  30. staff_num: this.staff_num,
  31. area_code: this.mine_code
  32. },
  33. success: (res) => {
  34. console.log(res.data.data)
  35. this.href = "http://shangtang.nxjiewei.com:8011/?token=" + res.data.data.access_token
  36. },
  37. fail: (err) => {
  38. uni.showToast({
  39. icon:"none",
  40. title:err
  41. })
  42. }
  43. })
  44. }
  45. }
  46. }
  47. </script>
  48. <style lang="scss">
  49. </style>