qs#stringify JavaScript Examples

The following examples show how to use qs#stringify. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: utils.js    From acy-dex-interface with MIT License 6 votes vote down vote up
export function getQueryPath(path = '', query = {}) {
  const search = stringify(query);
  if (search.length) {
    return `${path}?${search}`;
  }
  return path;
}
Example #2
Source File: api.js    From online-test-platform with Apache License 2.0 6 votes vote down vote up
export async function updateRule(params = {}) {
  return request(`/api/rule?${stringify(params.query)}`, {
    method: 'POST',
    data: {
      ...params.body,
      method: 'update',
    },
  });
}
Example #3
Source File: service.js    From juno with Apache License 2.0 6 votes vote down vote up
// 获取资源列表
export async function getAdminResource(params) {
  return request(`/api/admin/confgo/global/list/user`, {
    method: 'POST',
    body: JSON.stringify(params),
    headers: {
      'Content-Type': 'application/json; charset=utf-8',
    },
  });
}
Example #4
Source File: query.js    From egoshop with Apache License 2.0 6 votes vote down vote up
/**
     * 为了列表类型的接口调用方便
     * @param path
     * @param params
     * @param delCondition
     * @returns {*}
     */
    static path(path, params = {}, delCondition = []) {
        const QueryClass = new Query();
        if (count(params) > 0) {
            QueryClass.setParams(params);
        }
        QueryClass.delEmptyParams().withPageParams().delParams(delCondition);
        const search = stringify(QueryClass.params,{ arrayFormat: 'brackets'});
        if (count(search) > 0) {
            return `${path}?${search}`;
        }
        return path;
    }
Example #5
Source File: dashboard.js    From camel-store-admin with Apache License 2.0 6 votes vote down vote up
export async function getTotalCount(params) {
   return request(
    `/api/count/count?${stringify(params)}`,
    {
      method: 'GET',
      headers: {
        'Authorization': getLocalStorage("token"),
      }
    },
  );
}
Example #6
Source File: api.js    From youdidao-unmanned-shop with MIT License 6 votes vote down vote up
export async function updateRule(params = {}) {
  return request(`/api/rule?${stringify(params.query)}`, {
    method: 'POST',
    body: {
      ...params.body,
      method: 'update',
    },
  });
}
Example #7
Source File: index.js    From hzero-front with Apache License 2.0 6 votes vote down vote up
// #region no used

  /**
   * redirectCreate - 跳转创建角色页面
   * @param {object} [params={}] - 查询参数
   * @param {number} params.copy_from - 复制并创建角色ID
   * @param {number} params.inherit_from - 继承自角色ID
   * @param {string} params.name - 继承自角色名称
   */
  redirectCreate(params = {}) {
    const { dispatch } = this.props;
    dispatch(routerRedux.push({ pathname: '/hiam/role/create', search: stringify(params) }));
  }
Example #8
Source File: api.js    From ant-back with MIT License 6 votes vote down vote up
export async function updateRule(params = {}) {
  return request(`/api/rule?${stringify(params.query)}`, {
    method: 'POST',
    data: {
      ...params.body,
      method: 'update',
    },
  });
}
Example #9
Source File: api.js    From acy-dex-interface with MIT License 5 votes vote down vote up
export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}
Example #10
Source File: api.js    From online-test-platform with Apache License 2.0 5 votes vote down vote up
export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}
Example #11
Source File: service.js    From juno with Apache License 2.0 5 votes vote down vote up
// 获取应用列表
export async function reqSelect(param) {
  return request(`/api/admin/analysis/topology/select?${stringify(param)}`);
}
Example #12
Source File: index.js    From egoshop with Apache License 2.0 5 votes vote down vote up
function getQueryPath(path = "", query = {}) {
    const search = stringify(query, { arrayFormat: 'brackets' });
    if (search.length) {
        return `${path}?${search}`;
    }
    return path;
}
Example #13
Source File: api.js    From camel-store-admin with Apache License 2.0 5 votes vote down vote up
export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}
Example #14
Source File: api.js    From youdidao-unmanned-shop with MIT License 5 votes vote down vote up
export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}
Example #15
Source File: menuService.js    From hzero-front with Apache License 2.0 5 votes vote down vote up
export async function saveMenuTree(params, level) {
  return request(`${HZERO_IAM}/v1/menus/tree?${stringify({ level })}`, {
    method: 'POST',
    body: params,
  });
}
Example #16
Source File: api.js    From ant-back with MIT License 5 votes vote down vote up
export async function queryRule(params) {
  return request(`/api/rule?${stringify(params)}`);
}
Example #17
Source File: index.js    From the-eye-knows-the-garbage with MIT License 5 votes vote down vote up
genCopySettingJson = function genCopySettingJson(settingState) {
  return JSON.stringify(omit(Object.assign(Object.assign({}, settingState), {
    primaryColor: genStringToTheme(settingState.primaryColor)
  }), ['colorWeak']), null, 2);
}