getUrl.js 344 B

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