UNPKG

nsn-util

Version:

NSN工具辅助组件

33 lines (32 loc) 1.11 kB
/// <reference types="node" /> import { MappingURI, RequestCxt } from 'nsn-enum'; /** * 获取当前 url 中的所有查询参数 */ declare const getPageQuery: () => import("querystring").ParsedUrlQuery; /** * 获取当前 url 中指定的查询参数 * @param name */ declare const getParam: (name: string) => string | string[] | undefined; /** 获取 /api/nsn/${ctx}/${uri} 或 /api/${ctx}/${uri}*/ declare const getUrl: (ctx: RequestCxt, uri: MappingURI | string, nonPrefix?: boolean) => string; /** * 设置 数据返回是 二进制数据的 api * @param urls 如:/api/nsn/files/download */ declare const setBlobUrl: (urls: Array<string>) => void; /** * 判断 url 是否 */ declare const isBlobUrl: (url: string) => boolean; /** * 设置 请求后端时,不需要前端检查token的api * @param urls 如:/api/nsn/auth/login */ declare const setIgnoreUrl: (urls: Array<string>) => void; /** * 判断 url 是否在鉴权忽略列表中 */ declare const isIgnoreUrl: (url: string) => boolean; export { getPageQuery, setBlobUrl, isBlobUrl, getParam, setIgnoreUrl, isIgnoreUrl, getUrl, };