SchoolPhysicalExamination/application/admin/controller/Login.php

42 lines
1.3 KiB
PHP

<?php
namespace app\admin\controller;
use think\Controller;
use think\Db;
use app\bj\controller\Common;
use think\helper\hash\Md5;
use think\Log;
use \think\Validate;
class Login extends Controller{
public function login(){
// $this->assign('domain',$a);
// dump(md5('123'));
return $this->fetch();
}
public function login_action(){
$data = input();
$key_word1='教育';
$key_word2='体测';
// $data['name'] = md5($key_word1.$data['name'].$key_word2)
if($data['name'] == 'a' && md5($key_word1.$data['password'].$key_word2) == '871365cc2db43a8f2c7544798b36ed78'){
return $this->msg(10000,'success');
}else{
return $this->msg(10001,'error');
}
}
################################################################other################################################################
################################################################other################################################################
################################################################other################################################################
public function msg($code,$msg='',$data=[]){
return json(['code'=>$code,'msg'=>$msg,'data'=>$data]);
}
}