From 972773ac5313a982bd9cfe7065fe98709847d04a Mon Sep 17 00:00:00 2001
From: tsf <460834639@qq.com>
Date: Wed, 3 Apr 2024 18:15:07 +0800
Subject: [PATCH] =?UTF-8?q?=E9=83=A8=E5=88=86=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
application/admin/view/index/index.html | 29 +++-----------------
application/admin/view/login/login.html | 7 +++--
application/app/controller/Card.php | 34 +++++++++++++++++++++++-
application/app/controller/Login.php | 1 +
application/config.php | 2 +-
application/route.php | 35 ++++++++++++++++++-------
6 files changed, 69 insertions(+), 39 deletions(-)
diff --git a/application/admin/view/index/index.html b/application/admin/view/index/index.html
index ef9c521..8bd0969 100644
--- a/application/admin/view/index/index.html
+++ b/application/admin/view/index/index.html
@@ -52,38 +52,15 @@
@@ -327,7 +304,7 @@
diff --git a/application/admin/view/login/login.html b/application/admin/view/login/login.html
index b1b7bf5..a6957af 100644
--- a/application/admin/view/login/login.html
+++ b/application/admin/view/login/login.html
@@ -50,9 +50,10 @@
type:"POST", //请求方式
success:function(req){
//请求成功时处理
+
if(req.code == 10000){
layer.msg('登录成功,准备跳转',function(){
- location.href='/admin/index/index'
+ location.href='/admin/index'
});
}else{
layer.msg('登录失败',function(){
@@ -62,7 +63,9 @@
},
error:function(){
//请求出错处理
- }});
+ pd = true
+ }
+ });
}
return false;
});
diff --git a/application/app/controller/Card.php b/application/app/controller/Card.php
index a6ea9d9..21ba9bb 100644
--- a/application/app/controller/Card.php
+++ b/application/app/controller/Card.php
@@ -19,7 +19,7 @@ class Card extends Controller{
// $data = ['user_token'=>'xxxxxxxxxxxxxxx','order_list'=>[1,2,3,4,5]]
public function save_card_order(){
$data = input();
- if(!array_key_exists('order_list', $data) || !array_key_exists('user_token', $data)){
+ if(!array_key_exists('order_list', $data) || !array_key_exists('user_token', $data)){
return $this->msg(10001,'数据格式错误');
}
if(!$this->isNumericArray($data['order_list'])){
@@ -34,6 +34,22 @@ class Card extends Controller{
}
}
+ // 获取卡片列表
+ // $data = ['id'=>'2','time'=>'1991-04-20',content=>'15个']
+ public function get_card_list(){
+ $data = input();
+ if(!array_key_exists('ann_id', $data) || !array_key_exists('time', $data) || !array_key_exists('content', $data)){
+ return $this->msg(10001,'数据格式错误');
+ }
+
+ $result = Db::table('app_card_data_log')->insert(['aud_id'=>$data['id'],'log_time'=>$data['time'],'content'=>$data['content'],'create_time'=>date('Y-m-d H:i:s')]);
+ if($result){
+ return $this->msg(0,'success');
+ }else{
+ return $this->msg(10003,'添加失败');
+ }
+ }
+
// 添加卡片规则
// $data = ['user_token'=>'xxxxxxxxxxxxxxx','order_list'=>[1,2,3,4,5]]
public function add_card_rule(){
@@ -53,6 +69,22 @@ class Card extends Controller{
}
}
+ // 添加卡片记录
+ // $data = ['id'=>'2','time'=>'1991-04-20',content=>'15个']
+ public function add_card_data(){
+ $data = input();
+ if(!array_key_exists('ann_id', $data) || !array_key_exists('time', $data) || !array_key_exists('content', $data)){
+ return $this->msg(10001,'数据格式错误');
+ }
+
+ $result = Db::table('app_card_data_log')->insert(['aud_id'=>$data['id'],'log_time'=>$data['time'],'content'=>$data['content'],'create_time'=>date('Y-m-d H:i:s')]);
+ if($result){
+ return $this->msg(0,'success');
+ }else{
+ return $this->msg(10003,'添加失败');
+ }
+ }
+
diff --git a/application/app/controller/Login.php b/application/app/controller/Login.php
index b7ee57c..7638bf2 100644
--- a/application/app/controller/Login.php
+++ b/application/app/controller/Login.php
@@ -37,6 +37,7 @@ class Login extends Controller{
// 登录
public function login_action(){
+
$data = input();
$verify_result = $this->verify_parameters($data,'login');
if(!is_array($verify_result)){
diff --git a/application/config.php b/application/config.php
index 25d573c..53fc153 100644
--- a/application/config.php
+++ b/application/config.php
@@ -95,7 +95,7 @@ return [
// 是否开启路由解析缓存
'route_check_cache' => false,
// 是否强制使用路由
- 'url_route_must' => false,
+ 'url_route_must' => true,
// 域名部署
'url_domain_deploy' => false,
// 域名根,如thinkphp.cn
diff --git a/application/route.php b/application/route.php
index 591e2c3..050d732 100644
--- a/application/route.php
+++ b/application/route.php
@@ -9,13 +9,30 @@
// | Author: liu21st
// +----------------------------------------------------------------------
-return [
- '__pattern__' => [
- 'name' => '\w+',
- ],
- '[hello]' => [
- ':id' => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
- ':name' => ['index/hello', ['method' => 'post']],
- ],
-];
+use think\Route;
+
+################################################################管理后台################################################################
+################################################################管理后台################################################################
+
+// 管理后台登录
+Route::get('/admin/login', 'admin/login/login');
+Route::post('/admin/login_action', 'admin/login/login_action');
+// 管理后台首页
+Route::get('/admin/index', 'admin/index/index');
+Route::get('/admin/welcome', 'admin/index/welcome');
+// APP账号角色管理
+// APP账号数据列表
+Route::get('/admin/member_list', 'admin/member/member_list');
+Route::get('/admin/user_list', 'admin/member/user_list');
+
+
+
+################################################################APP接口################################################################
+################################################################APP接口################################################################
+
+// 处理404错误 z
+Route::miss(function(){
+ return '404 Not Found';
+ // 或者你可以重定向到一个错误页面,或者进行其他处理
+});