iOS上https://uac.easyar.com/token/v2/接口报错403

0 投票
最新提问 3月 19 用户: gogomonkey (120 分)
奇怪的是,安卓上没有问题,只有在iOS上才会出现这个问题

    /**

     * 生成token

     */

    queryToken() {

        if (this.token) {

            return Promise.resolve(this.token);

        }

        const obj = {

            apiKey: this.config.apiKey,

            expires: 86400,

            timestamp: Date.now(),

            acl: `[{"service":"ecs:crs","effect":"Allow","resource":["${this.config.crsAppId}"],"permission":["READ","WRITE"]}]`

        };

        const str = Object.keys(obj)

            .sort()

            .map((k) => k + obj[k])

            .join('');

        obj.signature = CryptoJS.SHA256(`${str}${this.config.apiSecret}`, '').toString();

// console.log(obj);

        return new Promise((resolve, reject) => {

            fetch('https://uac.easyar.com/token/v2/', {

                method: 'POST',

                body: JSON.stringify(obj),

credentials: 'include',

                headers: {

                    'content-type': 'application/json',

'Accept': 'application/json',

                }}).then(response => {

//handle response            

return response.json();

}).then(data => {

//handle data

console.log(data)

this.token = data.result.token;

resolve(this.token);

}).catch(error => {

//handle error

reject(error)

});

        });

    }

登录 或者 注册 后回答这个问题。

欢迎来到 EasyAR Q&A ,有什么不懂的可以尽管在这里提问,你将会收到社区其他成员的回答。
...