云数据库

购买ECS和RDS,应用部署在ECS上,数据库迁移至RDS上.
ECS允许安装数据库客户端管理RDS数据库(DB), 数据库(DB)不允许安装在ECS服务器上
阿里云-hub

授权及安全等级

相关文档链接

  1. 开放平台安全等级说明

API调用方法详解

官方文档

官方SDK使用说明

官方文档

用户授权

拼接授权url

1
2
https://oauth.taobao.com/authorize?response_type=code&client_id=
24747068&redirect_uri=http://wiki.kulchao.com/api/taobao/addcode&state=1212&view=wap

多点共享 token

全局存储,定时刷新

  1. Access_Token全局存储
    1. 服务端保存token到文件
    2. 根据 sellerId 获取相同的授权

sellerid
token
refresh_token

定时任务:

自定义镜像部署

  1. 修改listen端口-service nginx restart
  2. 修改时区

    1
    cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
  3. 安装cron并设置定时任务

    1
    2
    3
    4
    5
    apt-get install cron
    crontab -u www-data -e
    service cron restart
  4. 接口测试

    1
    https://kuchaoyun.ews.m.jaeapp.com/api/taobao/favor/?sellerId=2636801283&storeId=111&saleId=123
  5. 跨域设置

1
2
3
add_header Access-Control-Allow-Origin *;
add_header Access-Control-Allow-Headers X-Requested-With;
add_header Access-Control-Allow-Methods GET,POST;
<script>

(function(){
var bp = document.createElement(‘script’);
var curProtocol = window.location.protocol.split(‘:’)[0];
if (curProtocol === ‘https’) {
bp.src = ‘https://zz.bdstatic.com/linksubmit/push.js‘;
}
else {
bp.src = ‘http://push.zhanzhang.baidu.com/push.js‘;
}
var s = document.getElementsByTagName(“script”)[0];
s.parentNode.insertBefore(bp, s);

var sozzsrc = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?6934e60f0fcbf5f113646cf0c3c61c6a":"https://jspassport.ssl.qhimg.com/11.0.1.js?6934e60f0fcbf5f113646cf0c3c61c6a";
document.write('<script src="' + sozzsrc + '" id="sozz"><\/script>');

})();