diff --git a/app/controller/UserController.php b/app/controller/UserController.php index 1c9379e..14b5cc2 100644 --- a/app/controller/UserController.php +++ b/app/controller/UserController.php @@ -6,6 +6,7 @@ namespace app\controller; use app\BaseController; use think\facade\View; +use app\model\User; class UserController extends BaseController { @@ -13,6 +14,9 @@ class UserController extends BaseController // 用户中心 public function index() { + $userinfo = User::find(\session('userid'))->toArray(); + View::assign($userinfo); + View::assign('url', $this->request->domain()); return View::fetch(); } // 登陆视图 @@ -23,4 +27,11 @@ class UserController extends BaseController } return View::fetch(); } + // 修改用户 + public function setUser() + { + $userinfo = User::find(\session('userid'))->toArray(); + View::assign($userinfo); + return View::fetch(); + } } diff --git a/app/controller/api/UserController.php b/app/controller/api/UserController.php index 5ec6172..dccc2c3 100644 --- a/app/controller/api/UserController.php +++ b/app/controller/api/UserController.php @@ -5,7 +5,6 @@ declare(strict_types=1); namespace app\controller\api; use app\BaseController; -use think\Request; use think\facade\Session; use app\model\User; @@ -13,9 +12,9 @@ class UserController extends BaseController { protected $middleware = ['Auth' => ['except' => ['login']]]; - public function login(Request $request) + public function login() { - $login_info = $request->post(); + $login_info = $this->request->post(); $userinfo = self::checkUser($login_info); if ($userinfo['code'] === 0) { Session::set('userid', $userinfo['data']->id); @@ -33,6 +32,25 @@ class UserController extends BaseController Session::clear(); return json(\backMsg(0, '注销成功')); } + public function editUser() + { + $userid = \session('userid'); + $info = $this->request->post(); + $res = User::update($info, ['id' => $userid]); + if (!$res) { + return json(\backMsg(1, '修改失败')); + } + return json(\backMsg(0, '重置成功')); + } + public function resetKey() + { + $userid = \session('userid'); + $res = User::update(['secret_key' => $this->generateKey()], ['id' => $userid]); + if (!$res) { + return json(\backMsg(1, '重置失败')); + } + return json(\backMsg(0, '重置成功')); + } private function checkUser(array $login_info): array { $username = $login_info['username']; @@ -48,4 +66,14 @@ class UserController extends BaseController return \backMsg(2, '用户不存在'); } } + private function generateKey() + { + $bytes = openssl_random_pseudo_bytes(16, $strong); + if ($strong) { + $key = bin2hex($bytes); + return md5($key); + } else { + return false; + } + } } diff --git a/public/static/img/cc-primary.png b/public/static/img/cc-primary.png new file mode 100644 index 0000000..456ea74 Binary files /dev/null and b/public/static/img/cc-primary.png differ diff --git a/public/static/img/chart-success.png b/public/static/img/chart-success.png new file mode 100644 index 0000000..94b56f7 Binary files /dev/null and b/public/static/img/chart-success.png differ diff --git a/public/static/img/paypal.png b/public/static/img/paypal.png new file mode 100644 index 0000000..99d8129 Binary files /dev/null and b/public/static/img/paypal.png differ diff --git a/public/static/img/wallet-info.png b/public/static/img/wallet-info.png new file mode 100644 index 0000000..eb7c08b Binary files /dev/null and b/public/static/img/wallet-info.png differ diff --git a/view/console/console.html b/view/console/console.html index 1a9e4c9..9efad18 100644 --- a/view/console/console.html +++ b/view/console/console.html @@ -9,419 +9,190 @@ + -
-
-
-
-
+
+
+
+
+
请在您网站后台配置支付接口对接时请您选择走易支付接口方式来对接本平台哦!请添加收藏我们网站,备用或者防止丢失哦!
+
+
+
+
+
+
+
-
今日收款金额(元)
+
今日流水
-
+
0
-
- - - - - - - +
+
-
+
-
今日支付订单(笔)
+
昨日流水
-
+
0
-
- - - - - - - - - +
+
-
+
-
七月收款金额(元)
+
本周流水
-
+
0
-
- - - - - - - - - - - - - - - - - +
+
-
+
-
七月支付订单(笔)
+
本月流水
-
+
0
-
- - - - - - - - +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
订单统计
+
+ 订单内容 +
+
+
+
+
+
最新订单
+
+ 订单明细 +
+
+
+
-
-
-
-
-
今日支付宝收款(元)
+
+
+
+
+
+ 寄语 +
+
+ 原想将澎湃的爱平平稳稳放置你手心,奈何我徒有一股蛮劲,只顾向你跑去,一个不稳跌的满身脏兮兮。试图爬起的我, + 心想你会不会笑我 " 献爱献的这样笨拙, 怎么不知避开爱里的埋伏 " +
+
+
+
+
+
+ 链接 +
-
-
- 0 -
-
- - - -
-
+ 官 + 网 +
+ 下 载 +
+ 后 端
-
-
-
今日微信收款(元)
+
+
+
更 新
-
-
- 0 -
-
- - - -
-
-
-
-
-
-
-
本月支付宝订单(笔)
-
-
-
- 0 -
-
- - - -
-
-
-
-
-
-
-
本月微信订单(笔)
-
-
-
- 0 -
-
- - - -
-
+
    +
  • 优化代码格式2021-09-06 + 11:28
  • +
  • 新增消息组件2021-09-06 + 11:28
  • +
  • 移动端兼容2021-09-06 + 11:28
  • +
  • 系统布局优化2021-09-06 + 11:28
  • +
-
-
-
-
-
-
-
-
-
-
-
-
-
-
动态
-
-
-
-
-
-

七彩枫叶 在 Pear Admin 专区 回答问题 -

- 几秒前 -
-
-
-
-
-

简 在 Pear - Admin 专区 进行了 提问 -

- 2天前 -
-
-
-
-
-

恒宇少年 将 Pear Admin 更新至 - 2.3.0 - 版本

- 7天前 -
-
-
-
-
-

如花 在 Pear Admin 社区 发布了 建议

- 7天前 -
-
-
-
-
-

就眠仪式 在 Pear Admin 社区 发布了 建议

- 8天前 -
-
-
-
-
-

贤心 在 Pear Admin 专区 进行了 提问 -

- 8天前 -
-
-
-
-
-
-
-
-
更 新
-
-
    -
  • 优化代码格式2021-09-06 - 11:28
  • -
  • 新增消息组件2021-09-06 - 11:28
  • -
  • 移动端兼容2021-09-06 - 11:28
  • -
  • 系统布局优化2021-09-06 - 11:28
  • -
  • 兼容多系统菜单模式2021-09-06 - 11:28
  • -
  • 兼容多标签页切换2021-09-06 - 11:28
  • -
  • 扩展下拉组件2021-09-06 - 11:28
  • -
  • 扩展卡片样式2021-09-06 - 11:28
  • -
-
-
-
-
- 链接 -
-
- 官 - 网 -
- 下 载 -
- 后 端 -
-
-
-
- 寄语 -
-
- 原想将澎湃的爱平平稳稳放置你手心,奈何我徒有一股蛮劲,只顾向你跑去,一个不稳跌的满身脏兮兮。试图爬起的我, - 心想你会不会笑我 " 献爱献的这样笨拙, 怎么不知避开爱里的埋伏 " -
-
+
- diff --git a/view/user/index.html b/view/user/index.html index 0e7a234..24ec84c 100644 --- a/view/user/index.html +++ b/view/user/index.html @@ -6,76 +6,78 @@ 个人资料 + -
-
-
-
-
-