其他人无法正常使用小程序?
小程序只有登录页面和一个首页。。使用开发者的微信号可以正常登录。可是其他微信号只能打开登录页面,点击登录无法跳转到首页!请问下各位大神这个是在哪里设置有问题呀?
JS代码:
login: function() {
var that = this;
wx.showLoading({
title: '服务器连接中',
}),
wx.request({
url: 'https://www.ailaiyun.com/login.php',
method: "post",
header: {
"Content-Type": "application/x-www-form-urlencoded"
},
data: {
name: that.data.name,
password: that.data.password,
},
success(res) {
wx.hideLoading();
if (res.data != null) {
wx.setStorage({
key:"user_info",
data:res.data
});
wx.navigateTo({
url: '../index/index',
});
} else {
wx.showToast({
title: "用户名或密码错误",
icon: 'none',
})
}
}
})
}
后端代码:
<?php
$db = mysqli_connect("xx.xx.xx.xx","xx","xx",'xx','3306') or die("数据库连接失败");//连接数据库
mysqli_query($db,"set names utf8");
$name =$_POST["name"];
$password= $_POST["password"];
$hash_password = hash("sha256", $password );
$sql="SELECT * from user where email='$name' and pass='$hash_password'";
$result= mysqli_query($db,$sql);
while ($row = mysqli_fetch_array($result)) {
$res[] = $row;
}
echo json_encode($res);
?>