corgi/doc/partner.md

80 lines
2.1 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 金蚕游戏管理后台相关说明
## 修改记录
## 说明
1. 所有请求参数中带*号的不能为空
2. 接口签名字段说明
```
# 1. 将参与签名的参数按照key=value的格式并按照参数名ASCII字典序升序排序, 例如:
var signStr = 'name=一品漫城&sid=65AB7856FE&timestamp=1624332778169'
# 2. 把我们提供的 secretKey(37284c327e10d8b73cf4325f33a3de4b34032e3e) 作为key, 使用HMAC-SHA256得到签名
var sign = HmacSHA256(signStr, secretKey)
```
3. 如无特殊说明, 所有接口返回json, 顶级结构如下, 接口Response的数据结构说明只包含data部分
``` JSON
{
"code": 0, //0:成功 2: 缺少必要参数(accountid, sessionid) 4: 帐号被封, 5: 帐号未找到 100: 所有未定义的错误
"msg": "", //错误描述, 一般在code=0时, 该字段为空
"data": {}, // 数据
}
```
4. 页面列表
> 所有的页面均可单独调用, url: https://puzzle-admin.kingsome.cn/页面url?token=token&mini=1
> token为 1号接口获取
| 页面名称 | 页面url |
| ---------- | ----------------- |
| 店铺管理员 | /#/shop/shopadmin |
| 游戏设置 | /#/shop/setting |
| 活动列表 | /#/shop/activity_list |
| 挑战活动列表 | /#/shop/exam_list |
| 抽奖转盘 | /#/shop/lottery_setting |
| 分享设置 | /#/shop/share_setting |
| 优惠券设置 | /#/marketing/coupon |
| 题库设置 | /#/question/setting |
| 自定义题库 | /#/question/shoppuzzles |
| 邮件 | 暂不开放 |
| 公告 | 暂不开放 |
## 接口列表
### 1. 获取token
1. Method: POST
2. URI: /api/partner/login
> POST参数
| 字段 | 说明 |
| -------- | -------------------------------------- |
| name | *店铺完整名称 |
| sname | 店铺显示的短名称(如果该字段为空的话, 取name字段) |
| sid | *唯一的店铺id, 接口根据此字段判断该次上报是否是同一家店铺 |
| logo | 店铺的logo, 一个可以外网访问的url地址 |
| timestamp | *10或13位均可 |
| sign | *签名 |
> 签名字段: name, sid, timestamp
3. Response: JSON
```js
{
token: '1231231aasa'
}
```