@dooy
2022-09-12T00:23:46.000000Z
字数 3574
阅读 228
PHP
DR
文档
修改日志
日期 | 说明 |
---|---|
2017-05-10 | 刚刚建立初步的思想,把答题的框架设计出来 |
2017-10-29 | 增加登录反弹说明 |
PCweb http://sui.taobao.org/sui/docs/index.html
PC端是快,好看、标准 ,缺点ie6、ie7不支持
sui.taobao.org 已经挂掉了
PC端帮助文档 请使用 看里面的doc
https://github.com/sdc-alibaba/sui/archive/build.zip
手机端
考虑上传到公有云上
公有:头像、图片、mp3
私有:资料 下载的图片
key | 类型 | 说明 |
---|---|---|
uid | int | 用户id |
time | int | 登录时间截 |
name | string | 名字 |
school | string | 学校名字 |
head | string | 头像目录 |
ts | int | 身份 |
sign | string | 签名 |
字段 | 类型 | 说明 |
---|---|---|
user_id | int | 用户id |
name | string | 显示名字 |
school | string | 学校 |
head | string | 头像路径 |
psw | string | 32位md5密码 = md5(md5(用户未加密psw).slat) |
slat | string | 随机4位 |
string | 未做索引 | |
tel | string | 手机号码不是必须不是唯一 |
ctime | int | 注册时间 |
last_time | int | 最后登录时间 |
login_cnt | int | 登录次数 |
ts | int | 身份 1为老师,2为学生 扩展3为家长 |
is_del | int | 1为注销 |
user_id from openid索引
字段 | 类型 | 说明 |
---|---|---|
id | int | 自增 无实际意义 |
user_id | int | 用户id 关联user |
from | int | 1为email 2为tel 3qq 4为微博 5位微信 |
openid | string | email、tel、第三方opend |
token | string | |
ctime | int | 建立时间 |
参数 | 说明 |
---|---|
openid | 账号 邮箱/手机号码 |
psw | 密码 |
loginback | 需要登陆反弹的url |
错误应答体: loginback?error=123&error_des=密码错误
正确应答体:loginback?haoce_info=base64_encode_数据&time=服务器时间&sign=签名
签名验证: sign= md5( haoce_info + key + time)
haoce_info 后的数据说明
字段 | 类型 | 说明 |
---|---|---|
user_id | int | 用ID |
name | string | 用户名称 |
school | string | 学校 |
ts | int | 身份 1 一般老师 2学生 3认证老师 |
number | string | 学号 |
last_time | int | 最后登录时间 |
login_cnt | int | 登录次数 |
sex | int | 性别 1男 2女 0未定义 |
head | string | 头像 可以在前面加上 http://cdn.haoce.com |
<?php
if(isset($_REQUEST['haoce_info'])){
$key = '-It is a key-';
$sign= md5($_REQUEST['haoce_info'].$key. $_REQUEST['time'] );
if( $sign == $_REQUEST['sign'] ){
echo"签名正确\n<br>";
}else{
echo"签名失败得干些失败的活\n<br>";
}
echo"数据:<br>\n";
print_r( json_decode ( base64_decode( $_REQUEST['haoce_info'] ) ) );
exit();
}
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>登录</title>
</head>
<body>
<div style="color:red">
<?php
if( isset($_GET['error'])){
echo "错误代码:".$_GET['error'] ;
echo "\n<br>错误:".$_GET['error_des'] ;
}
?></div>
<form method="post" action="https://www.haoce.com/index/login/post">
账号: <input type="text" id="openid" name="openid" placeholder="邮箱/手机号码" > <br>
密码: <input type="password" name="psw" placeholder="密码6到12位" ><br>
<input type="hidden" name="loginback" value="http://lab.pigai.org/hello3/login.php?d=good">
<button type="submit" >登录</button>
</form>
</body>
</html>
忘记密码 跟注册 带着 loginback过来 当取回密码后 或者注册好 也会随着 loginback将用户属性带过来
忘记密码
https://www.haoce.com/forgot?loginback=http://lab.pigai.org/hello3/login.php注册
https://www.haoce.com/reg?loginback=http://lab.pigai.org/hello3/login.php
Nginx dr.penly.cn.conf 配置
server
{
listen 80;
server_name dr.penly.cn ;
index index.html index.php index.shtml index.htm ;
root D:\yangdaorong\yunbi\penly2\phpWebApp\webroot;
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php/$1 last;
}
break;
}
#include nginx_haoce.conf;
location ~ \.php(/|$)
{
if ( $fastcgi_script_name != "/index.php" ) {
return 403;
}
#include fastcgi_72;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
fastcgi_split_path_info ^((?U).+\.php)(/?.+)$;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
include fastcgi_params;
fastcgi_param SERVER_ONLINE debug;
}
location ~ ^(.*)\/\.svn\/{
return 403;
}
location ~* .(jpg|gif|png|js|css|ico)$ {
if (-f $request_filename) {
expires max;
break;
}
}
}