本帖最后由 sfzx584 于 2018-7-30 09:47 编辑
安装参考
天猫精灵接入homeassistant本地版环境搭建
天猫精灵接入HA
数据库修改 user_data 添加字段user_pass
采用MD5 加密 到网站 http://www.cmd5.com/ 去加密一段自己的密码 放到这个字段
修改 index.php
<form name="LoginForm" method="post" action="login.php">
<div class="weui_cells weui_cells_form">
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">用户名:</label></div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" name="username" type="text" v-model="email" placeholder="请输入用户名"/>
</div>
</div>
<div class="weui_cell">
<div class="weui_cell_hd"><label class="weui_label">密码:</label></div>
<div class="weui_cell_bd weui_cell_primary">
<input class="weui_input" name="userpass" type="password" v-model="homeassistantPASS" placeholder="请输入密码"/>
</div>
</div>
<div class="weui_btn_area">
<!--<a href="<?php echo '/callback.php'?>" target="_parent" class="weui_btn weui_btn bg-blue">登陆</a>-->
<input type="submit" name="submit" value=" 登陆 " class="weui_btn weui_btn bg-blue" />
</div>
</div>
</form>
修改callback.php (应该不修改也可以 没仔细研究代码,还是修改了吧)
注释掉session
添加文件login.php
代码如下
对了 加个注销 information.php
<div class="weui_btn_area">
<a href="discovery.php" target="_parent" class="weui_btn weui_btn bg-blue">返回设备列表</a>
</div>
<div class="weui_btn_area">
<a href="login.php?action=logout" target="_parent" class="weui_btn weui_btn bg-blue">注销</a>
</div>
|