aliyun / aliyun-oss-react-native

MIT License
148 stars 102 forks source link

这个endpoint 该填什么? #2

Closed verzqli closed 6 years ago

verzqli commented 6 years ago

'http://verzqli.oss-cn-beijing.aliyuncs.com'; 比如这样一个链接 我看你的例子 const endPoint = 'oss-cn-beijing.aliyuncs.com';

const familyserver = "http://verzqli"; AliyunOSS.initWithServerSTS(familyserver,endPoint, configuration) 这样写 3blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:84148 Error: Can't get a federation token [ErrorMessage]: Can't get a federation token at createErrorFromErrorData (blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:2043) at blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:1995 at MessageQueue.invokeCallback (blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:2437) at blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:2182 at MessageQueue.guardSafe (blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:2350) at MessageQueue.invokeCallbackAndReturnFlushedQueue (blob:http://localhost:8081/2fd25a6f-097f-4117-a812-6a306372306b:2181) at debuggerWorker.js:70 报这个错,请问什么原因?

luozhang002 commented 6 years ago

@verzqli endpoint 是这种格式 'oss-cn-beijing.aliyuncs.com,但是familiyserver是我demo里的变量,它表示鉴权服务器地址,需要注意的是地址格式是http:// IP:port/。 可以参考script文件目录下node起的本地鉴权服务,你可以参考下。

luozhang002 commented 6 years ago

@verzqli 鉴权server参考这个demo https://github.com/aliyun/aliyun-oss-react-native/tree/master/script/sts-app-server-node config.json 里面 id、 secrete、 role配置成自己。 默认端口9000 ,访问鉴权server出现如下图。

2018-06-26 8 09 43