前端调用AddItem失败

前端调用AddItem失败,无效的token
已邀请:

许丹石

赞同来自:

【解决办法】:
通过接口请求token时,用户指定的APPURL错误。应该使用window.location.href读取本网页的URL.进行请求,token才有效。                
request.post(portalUrl + generateToken, {
                    data: {
                        ''username'': portalUsername,
                        ''password'': portalPassword,
                        ''client'': ''referer'',
                        ''ip'': '''',
                        ''referer'': window.location.href,
                        ''expiration'': 60,
                        ''f'': ''json''
                    },
                    handleAs: json,
                    headers: {
                        X-Requested-With: null
                    }
                }).then(function (text) {
                    console.log(The server returned: , text);
                    addFileItem(text[token]);
                });

菠萝仔

赞同来自:

请问一下前端调用Additem时,本地文件的路径应该怎样传参??

要回复问题请先登录注册