Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

street参数确定是可选项吗? #2

Closed
ChiuJun opened this issue Aug 11, 2020 · 8 comments
Closed

street参数确定是可选项吗? #2

ChiuJun opened this issue Aug 11, 2020 · 8 comments

Comments

@ChiuJun
Copy link
Contributor

ChiuJun commented Aug 11, 2020

我之前street空着没填,但是今天看了下签到记录显示只到区了,不知道学校那边后台看到算不算有问题。
我们老师说签到页面不要自己改地址,这个自己改了地址的话对应的是啥参数呢?有抓过手动改地址的包吗?

@ChiuJun
Copy link
Contributor Author

ChiuJun commented Aug 11, 2020

我查看了签到页的JavaScript代码,他的参数列表是有 street 参数的。

var param={
            province:province,
            city:city,
            district:district,
            street:street,
            xszt:xszt,
            jkzk:jkzk,
            jkzkxq:jkzkxq,
            sfgl:sfgl,
            gldd:gldd,
            mqtw: mqtw,
            mqtwxq: mqtwxq,
            /*sffs:sffs,
            sftlhb:sftlhb,
            sfjchz:sfjchz,*/
            zddlwz:zddlwz,
            sddlwz:sddlwz,
            bprovince:bprovince,
            bcity:bcity,
            bdistrict:bdistrict,
            bstreet:bstreet,
            sprovince:sprovince,
            scity:scity,
            sdistrict:sdistrict,
            lng:lng,
            lat:lat,
            //sfzx:sfzx,
            sfby:sfby
        };

另外 zddlwz 视调用的函数选择是否将 street 拼接上去的,自己改地址的话是 sddlwz

var zddlwz =address.province+address.city+address.district+address.street;
zddlwz = zddlwz.replace("[]","");
address.zddlwz = zddlwz;

var addressStr = address.province + address.city + address.district;
address.zddlwz = addressStr;

@PrintNow
Copy link
Owner

PrintNow commented Aug 11, 2020

@ChiuJun street 确定是可选的(bstreet 参数是昨天的签到时请求的 street 参数)
你可以访问 https://fxgl.jx.edu.cn/学校标识码/user/qdbp 用 Chrome 开发者工具 -> network 查看签到请求

@ChiuJun
Copy link
Contributor Author

ChiuJun commented Aug 12, 2020

再次浏览了代码,定位数据分为三个环境。

  1. 支付宝环境
    支付宝环境需要 street 参数,参考支付宝H5开放文档
    street 参数由返回结果的 pois[0].addresspois[0].name 拼接而成,最后再拼接成 address.zddlwz

    address.street = result.pois[0].address + result.pois[0].name;
    //...
    var zddlwz =address.province+address.city+address.district+address.street;

    Singleton.php$street 为空,并且没有将 $street 拼接至 zddlwz ,所以造成了签到记录中缺失具体的街道信息
    考虑到大部分人的环境都是支付宝,建议将具体的街道信息加入到POST参数中

  2. 微信环境
    微信环境中同样需要 street 参数,并且不同于支付宝环境,微信环境中 street 参数不包含 streetNumber 信息,拼接地理位置时 zddlwz 同样需要详细到街道号。
    至于 street 参数中具体填什么,建议自行查看微信小程序开发者文档。

    address.street = addComp.street;
    //...
    address.zddlwz = addComp.province+addComp.city+addComp.district+addComp.street+addComp.streetNumber;
  3. H5环境
    H5环境不需要 street 参数,对于H5环境的同学,不需要对 Singleton.php 做额外更改。

    var addressStr = address.province + address.city + address.district;

@ChiuJun
Copy link
Contributor Author

ChiuJun commented Aug 12, 2020

@ChiuJun street 确定是可选的(bstreet 参数是昨天的签到时请求的 street 参数)
你可以访问 https://fxgl.jx.edu.cn/学校标识码/user/qdbp 用 Chrome 开发者工具 -> network 查看签到请求

见上,建议将环境相关描述添加至README中

@ChiuJun ChiuJun closed this as completed Aug 12, 2020
@PrintNow
Copy link
Owner

@ChiuJun street 确定是可选的(bstreet 参数是昨天的签到时请求的 street 参数)
你可以访问 https://fxgl.jx.edu.cn/学校标识码/user/qdbp 用 Chrome 开发者工具 -> network 查看签到请求

见上,建议将环境相关描述添加至README中

非常感谢你的分析,已 Merge pull request

@PrintNow
Copy link
Owner

@ChiuJun 已经将 $street 拼接至 zddlwz 参数,并精简了签到输出

@PrintNow
Copy link
Owner

@ChiuJun 对了,你现在查看某天签到记录,地图会显示出来吗,我这里是空白的
byJzO.jpg

@ChiuJun
Copy link
Contributor Author

ChiuJun commented Aug 12, 2020

@ChiuJun 对了,你现在查看某天签到记录,地图会显示出来吗,我这里是空白的
byJzO.jpg

问了下同学支付宝中显示也有问题,可能只是单纯出了BUG。在Chrome中看了下没问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants