From 354c021037df61e4ea6a78d7c0ecf7daa9586c78 Mon Sep 17 00:00:00 2001 From: v_zjxzzheng Date: Tue, 23 Nov 2021 17:30:37 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=96=B0=E5=A2=9E=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/api/content/read-genparamscheme.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 packages/discuz-sdk/src/api/content/read-genparamscheme.js diff --git a/packages/discuz-sdk/src/api/content/read-genparamscheme.js b/packages/discuz-sdk/src/api/content/read-genparamscheme.js new file mode 100644 index 00000000..639c47ff --- /dev/null +++ b/packages/discuz-sdk/src/api/content/read-genparamscheme.js @@ -0,0 +1,43 @@ +/** + * 描述:获取携带参数的scheme + */ +import { handleError } from '../utils/handle-error'; +import request from '../_example'; + +/** + * 入参验证规则,具体配置请看:https://github.com/yiminghe/async-validator + * + * @example + * const validateRules = { + * name: { + * type: 'number', + * required: true, + * }, + * }; + */ +const validateRules = {}; + +/** + * 描述:获取携带参数的scheme + * 请求方式:GET + * @param {axios config} opt 请求配置信息 + * @returns {promise} + */ +export async function readGenParamScheme(opt = {}) { + try { + const { params = {}, data = {}, ...others } = opt; + const options = { + url: '/api/v3/users/mobilebrowser/wechat/miniprogram.genparamscheme', // 请求地址 + method: 'GET', + params, + data, + ...others, + validateRules, + }; + const result = await request.dispatcher(options); + return result; + } catch (error) { + return handleError(error); + } +}; + -- Gitee