您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

functions.web.js 824B

123456789101112131415161718192021222324252627282930313233343536
  1. // @flow
  2. import { toState } from '../base/redux';
  3. import { getServerURL } from '../base/settings';
  4. export * from './functions.any';
  5. declare var interfaceConfig: Object;
  6. /**
  7. * Retrieves the default URL for the app. This can either come from a prop to
  8. * the root App component or be configured in the settings.
  9. *
  10. * @param {Function|Object} stateful - The redux store or {@code getState}
  11. * function.
  12. * @returns {string} - Default URL for the app.
  13. */
  14. export function getDefaultURL(stateful: Function | Object) {
  15. const state = toState(stateful);
  16. const { href } = window.location;
  17. if (href) {
  18. return href;
  19. }
  20. return getServerURL(state);
  21. }
  22. /**
  23. * Returns application name.
  24. *
  25. * @returns {string} The application name.
  26. */
  27. export function getName() {
  28. return interfaceConfig.APP_NAME;
  29. }