0.1.1 • Published 2 years ago

umi-plugin-rds v0.1.1

Weekly downloads
-
License
-
Repository
github
Last release
2 years ago

umi-plugin-rds

umijs

Install

# or yarn
$ npm install

Development UI

UI mini start:

$ npm run build --watch
$ npm run start

Usage

直接安装umi-plugin-rds的依赖

// package.json
{
  "dependencies": {
    "umi-plugin-rds": "^0.1.0"
  }
}

在配置路由时,增加RDSId配置,route.ts

[
  {
    path: '/mini/dev',
    component: 'Home/index',
    RDSId: 'openhome_sendACKCode',
  },
  {
    path: '/mini/create',
    component: 'Create/index',
    RDSId: 'openhome_queryUserInfo',
  },
  {
    path: '/mini/sub',
    component: 'Sub/index',
  },
]

获取json_ua

import getUaAsync from 'umi-plugin-rds/es/rds';

export async function getUserInfo(params) {
  const ua = await getUaAsync();
  const result = await get('/api', {
    ...params,
    ua,
  });
};
0.1.1

2 years ago

0.1.0

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago