@dooy
2017-08-14T07:42:55.000000Z
字数 1207
阅读 320
批改网 接口
| 更新时间 | 更新内容 |
|---|---|
| 2016.01.09 | 第一版本 |
| 2016.01.10 | 补充php参数说明 |
可参考其他文献 只要到达 PigaiServer 取到相应的数据即可
php处理程序在 pigaiServer 这断
session_start();$auth['from']= '8'; //类别必须, 做之前先申请下这个from id 不然会跟别人重复$auth['openid']= $openid;#唯一id 也可以是uid$auth['teacher_or_student']= $teacher_or_student=='teacher'?1:2 ; //比较重要: 1位老师 2为学生$auth['token']= $openid ;$auth['name']= $name ;$auth['school'] = '上海开放大学' ;$auth['school_type'] = 0 ;$auth['end_time'] = time()+2*365*24*3600 ;$_SESSION['oauth'] = $auth;$url= '/?a=oauth'; #调转到批改网这个地方 会做相应的处理echo("<script> top.location.href='" . $url . "'</script>");
| 参数 | 必须 | 参数说明 |
|---|---|---|
| from | 必须 | 类别必须, 做之前先申请下这个from id 不然会跟别人重复 |
| openid | 必须 | 当是oAuth的时候 一般是 openid,如果是cas一般是他们的唯一id |
| teacher_or_student | 可选 | 比较重要: 1位老师 2为学生 默认为2 |
| token | 可选 | oAuth的产物,如果cas请用openid代替 |
| name | 可选 | 用户名字 |
| school | 可选 | 用户学校 |
| school_type | 可选 | 用户类型 0:大学,1:中小学强关系,2:高中(旧),4:初中(旧),3:小学(旧),5:高中,6:初中,7:小学 |
| end_time | 可选 | 截止时间 时间截 |
| class | 可选 | 班级 |
| student_number | 可选 | 学号 |
| tel | 可选 | 电话 |
| sex | 可选 | 性别 |
| img | 可选 | 头像 带 img_s |
