SchoolPhysicalExamination/application/KitchenScale/controller/admin/Login.php

40 lines
1.3 KiB
PHP
Raw Normal View History

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