From cc73ade71a13f06a26694e513eb2d199f0e2c432 Mon Sep 17 00:00:00 2001 From: mengyxu Date: Tue, 12 Nov 2024 15:30:45 +0800 Subject: [PATCH] Update config.ts --- plugs/api/config.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/plugs/api/config.ts b/plugs/api/config.ts index fb761d2..593f1f0 100644 --- a/plugs/api/config.ts +++ b/plugs/api/config.ts @@ -1,4 +1,5 @@ import { queryPage, update } from './base'; +import { get } from '../http/axios'; const root = 'config'; export const list = (example) => { return queryPage(root, example); @@ -7,3 +8,16 @@ export const list = (example) => { export const set = (config) => { return update(root, config); }; + +export const getValue = (key) => { + return new Promise((resolve, reject) => { + get(root + '/' + key, null, true, true).then( + (rsp: any) => { + resolve(rsp); + }, + (err) => { + resolve(null); + } + ); + }); +};