getUrl.js 325 B

12345678910111213141516
  1. const getUrl = function() {
  2. const pages = getCurrentPages()
  3. const url = pages[pages.length - 1].route
  4. const _arr = url.split('/')
  5. const _name = _arr[_arr.length - 1]
  6. my.setStorageSync({
  7. key: '_pageMsg',
  8. data: {
  9. pageName: _name,
  10. pagePath: url,
  11. },
  12. })
  13. return url
  14. }
  15. module.exports = getUrl