From 96df1ee4567d227ff2e045d855e1d8a0a449b107 Mon Sep 17 00:00:00 2001 From: weixin_44463441 Date: Tue, 16 Jan 2024 16:31:43 +0800 Subject: [PATCH] Auto Commit --- src/js/repEs.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/js/repEs.js b/src/js/repEs.js index ce2ed19..2af6971 100644 --- a/src/js/repEs.js +++ b/src/js/repEs.js @@ -8,6 +8,24 @@ class RepEs { this.index_url = config.index_url this.index_name = config.index_name this.token = process.env?.INSCODE_API_KEY??'default' + this.loadToken() + } + + loadToken () { + axios.get('/token.json', { + headers: { + 'Accept': 'application/json' + } + }).then(res => { + debugger + const token = res?.data??'' + if (token) { + this.token = token.trim() + console.info('get token from env [' + this.token + ']') + + } + + }) } query (keyword) { -- GitLab