diff --git a/src/js/repEs.js b/src/js/repEs.js index ce2ed19b1692a2bdad4b7bb3f6b695f173013ccd..2af69711d3be4b3ccf67ddce3605a0d335e99643 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) {