quanwei
2025-11-11 0d04d60f456b1902c1e27b9586652649df3963d4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
 
namespace app\api\controller\user;
 
use app\api\model\user\Userapple as UserappleModel;
use app\api\controller\Controller;
use app\common\model\settings\Setting;
 
/**
 * 用户管理模型
 */
class Userapple extends Controller
{
    /**
     * 用户自动登录,默认微信小程序
     */
    public function login()
    {
        $model = new UserappleModel;
        $user_id = $model->login($this->request->post());
        return $this->renderSuccess('',[
            'user_id' => $user_id,
            'token' => $model->getToken()
        ]);
    }
 
    public function policy(){
        $config = Setting::getItem('store');
        return $this->renderSuccess('',[
            'service' => $config['policy']['service'],
            'privacy' => $config['policy']['privacy'],
        ]);
    }
}