How to use the umi-request.get function in umi-request

To help you get started, we’ve selected a few umi-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github webclipper / web-clipper / src / service / config / browser / configService.ts View on Github external
load = async () => {
    try {
      if (process.env.NODE_ENV !== 'development') {
        this.config = await request.get(`${config.resourceHost}/config.json`);
      }
      runInAction(() => {
        this.isLatestVersion = !hasUpdate(this.config.chromeWebStoreVersion, this.localVersion);
      });
      const iconsFile = await request.get(this.config.iconfont);
      const matchResult: string[] = iconsFile.match(/id="([A-Za-z]+)"/g) || [];
      const remoteIcons = matchResult.map(o => o.match(/id="([A-Za-z]+)"/)![1]);
      runInAction(() => {
        remoteIcons.forEach(icon => {
          this.remoteIconSet.add(icon);
        });
      });
    } catch (_error) {
      console.log('Load Config Error');
    }
  };
github webclipper / web-clipper / src / service / config / browser / configService.ts View on Github external
load = async () => {
    try {
      if (process.env.NODE_ENV !== 'development') {
        this.config = await request.get(`${config.resourceHost}/config.json`);
      }
      runInAction(() => {
        this.isLatestVersion = !hasUpdate(this.config.chromeWebStoreVersion, this.localVersion);
      });
      const iconsFile = await request.get(this.config.iconfont);
      const matchResult: string[] = iconsFile.match(/id="([A-Za-z]+)"/g) || [];
      const remoteIcons = matchResult.map(o => o.match(/id="([A-Za-z]+)"/)![1]);
      runInAction(() => {
        remoteIcons.forEach(icon => {
          this.remoteIconSet.add(icon);
        });
      });
    } catch (_error) {
      console.log('Load Config Error');
    }
  };
github webclipper / web-clipper / src / pages / preference / changelog / index.tsx View on Github external
    () => request.get(`${config.resourceHost}/changelog/CHANGELOG.${workLocale}.md`),
    []
github webclipper / web-clipper / src / pages / preference / privacy / index.tsx View on Github external
    () => request.get(`${config.resourceHost}/privacy/PRIVACY.${workLocale}.md`),
    []

umi-request

A request tool based on fetch.

MIT
Latest version published 3 years ago

Package Health Score

56 / 100
Full package analysis

Popular umi-request functions

Similar packages