Skip to content

按照组件属性的imageUploader的示例出现错误 #1199

Answered by w0oo
w0oo asked this question in Q&A
Discussion options

You must be logged in to vote

解决了,

imageUploader : function(file) {
      const formData = new FormData();
      formData.append('file', file);
      // formData.append('strategy_id', 0); // 可选策略ID
      return fetch('https://域名/api/v1/upload', {
        headers: {
          'Authorization': 'Bearer id|token'
        },
        method: 'POST',
      body: formData
      }).then(resp => resp.json()).then(resp => resp.data.links.url);
    },

是那样的

杜老师那调的 https://dusays.com/456/?keyword=waline

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by w0oo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant