Files
yycea/application/api/controller/wdsxh/ScreenValidate.php
2026-03-17 09:56:06 +08:00

81 lines
2.5 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
// +----------------------------------------------------------------------
// | 麦沃德科技赋能开发者,助力商协会发展
// +----------------------------------------------------------------------
// | Copyright (c) 20172024 www.wdsxh.cn All rights reserved.
// +----------------------------------------------------------------------
// | 沃德商协会系统并不是自由软件,不加密,并不代表开源,未经许可不可自由转售和商用
// +----------------------------------------------------------------------
// | Author: MY WORLD Team <bd@maiwd.cn> www.maiwd.cn
// +----------------------------------------------------------------------
/**
* Class Screen
* Desc 数据大屏
* Create on 2024/7/2 9:55
* Create by wangyafang
*/
namespace app\api\controller\wdsxh;
use app\common\controller\Api;
class ScreenValidate extends Api
{
protected $noNeedLogin = ['*'];
protected $noNeedRight = ['*'];
public function _initialize()
{
parent::_initialize();
}
/**
* Desc 头部信息
* Create on 2024/7/2 10:08
* Create by wangyafang
*/
public function header()
{
if(!$this->request->isGet()) {
$this->error('请求类型错误');
}
$data = (new \app\api\model\wdsxh\business\Association())->where('id',1)
->field('logo')
->find();
$data['name'] = (new \app\admin\model\wdsxh\Config())->where('id',1)->value('data_screen_title');
$config = (new \app\admin\model\wdsxh\Config())->where('id',1)->find();
$data_screen_password_switch = $config['data_screen_password_switch'] ?? '2';
$data['data_screen_password_switch'] = $data_screen_password_switch;
$this->success('请求成功',$data);
}
/**
* Desc 校验开屏密码
* Create on 2025/10/29 下午3:26
* Create by wangyafang
*/
public function checkPassword() {
if(!$this->request->isGet()) {
$this->error('请求类型错误');
}
$password = $this->request->get('password');
if(!$password) {
$this->error('密码不能为空');
}
$data_screen_password = (new \app\admin\model\wdsxh\Config())
->where('id',1)
->value('data_screen_password');
if($password == $data_screen_password) {
$this->success('校验成功');
} else {
$this->error('校验失败');
}
}
}