40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace app\KitchenScale\controller\admin;
|
|
|
|
use think\Db;
|
|
|
|
class Login extends Base{
|
|
|
|
// protected $login_hours_out = 24;
|
|
|
|
// 加 bcadd(,,20)
|
|
// 减 bcsub(,,20)
|
|
// 乘 bcmul(,,20)
|
|
// 除 bcdiv(,,20)
|
|
################################################################接口################################################################
|
|
################################################################接口################################################################
|
|
################################################################接口################################################################
|
|
|
|
// 登录
|
|
public function login(){
|
|
return $this->fetch();
|
|
|
|
}
|
|
// 检测登录信息是否超时
|
|
public function login_action(){
|
|
$data = input();
|
|
// 验证数据项是否完整
|
|
if(!array_key_exists('username', $data) || !array_key_exists('password', $data)){
|
|
return $this->msg(10001);
|
|
}
|
|
$cfc = Db::connect('cfc_db');
|
|
$account = $cfc->table('admin_user_account_number')->where(['account_num'=>$data['username'],'password'=>$data['password']])->count();
|
|
if($account>0){
|
|
return $this->msg([]);
|
|
}else{
|
|
return $this->msg(10003);
|
|
}
|
|
}
|
|
|
|
} |