今日校园的文件上传以及获取文件名称信息
获取oss相关参数以及文件名称
post https://xdkjtyut.campusphere.net/wec-counselor-sign-apps/stu/oss/getUploadPolicy
header cookie需要MOD_AUTH_CAS Content-Type为application/json
请求体为
{"fileType":1}
返回相应体为
{
"code": "0",
"datas": {
"accessid": "",
"dir": "",
"host": "",
"policy": "",
"signature": "",
"fileName": ""
},
"message": "SUCCESS"
}
文件上传
host为getUploadPolicy获取到的host 请求为 post
header cookie为MOD_AUTH_CAS
请求体为from表单
key: 上一步获取到的fileName+.png
policy: 上一步获取到的 policy
OSSAccessKeyId: 上一步获取到的accessid
success_action_status: 200
signature: 上一步获取到的signature
file: 文件
返回: 什么都不返回
获取文件路径
post https://xdkjtyut.campusphere.net/wec-counselor-sign-apps/stu/sign/previewAttachment
header 需要 cookie为MOD_AUTH_CAS
请求体
{
"ossKey": 上一步的key 上上一步的fileName+.png
}
虽然道路是曲折的,但前途是光明的。