提交 c2223113 编写于 作者: W weixin_44463441

Thu Jan 11 16:50:00 CST 2024 inscode

上级 f0cfb5b8
...@@ -42,16 +42,24 @@ class RepEs { ...@@ -42,16 +42,24 @@ class RepEs {
} }
add (content) { add (content) {
const name = '/' + this.index_name
const url = this.index_url + '/' + this.index_name const url = this.index_url + '/' + this.index_name
const token = this.token const token = this.token
const instance = axios.create({
baseURL: this.index_url,
timeout: 5000,
withCredentials: true, // 允许跨域请求
});
return new Promise(function(resolve,rejcet){ return new Promise(function(resolve,rejcet){
axios.put(url, instance.put(name,
{ {
user_token: token, user_token: token,
content: content, content: content,
}, },
{ {
withCredentials: true,
headers: { headers: {
'Content-Type': 'application/json' 'Content-Type': 'application/json'
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册