|
|
@@ -4,8 +4,10 @@ namespace app\controller\common;
|
|
|
|
|
|
use app\extra\basic\Base;
|
|
|
use app\model\system\SystemConfig;
|
|
|
+use app\model\system\SystemData;
|
|
|
use LinFly\Annotation\Route\Controller;
|
|
|
use LinFly\Annotation\Route\Route;
|
|
|
+use support\Request;
|
|
|
use support\Response;
|
|
|
use Tinywan\Captcha\Captcha;
|
|
|
|
|
|
@@ -25,19 +27,24 @@ class Common extends Base
|
|
|
try {
|
|
|
$captcha = Captcha::base64();
|
|
|
$service = (new SystemConfig)->where("type","service")->column("value","name");
|
|
|
+ $service['privacy'] = htmlspecialchars_decode(sConf("page.privacy"));
|
|
|
return successTrans("success.data",compact('captcha','service'));
|
|
|
} catch (\Throwable $throwable) {
|
|
|
return error($throwable->getMessage());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- #[Route(path: "test",methods: "get")]
|
|
|
- public function testData()
|
|
|
+ #[Route(path: "dic",methods: "get")]
|
|
|
+ public function getDicData(Request $request): Response
|
|
|
{
|
|
|
try {
|
|
|
- events("merge-pdf",['shop' => "326945519114632","order" => "202603263933413924333", "openid" => "otdgy3QxYqFjS_yl_YKUmLYMAtGI"]);
|
|
|
- return success("ok");
|
|
|
+ $param = $this->_valid([
|
|
|
+ "type.require" => trans("empty.require")
|
|
|
+ ],$request->all());
|
|
|
+ if (!is_array($param)) return error($param);
|
|
|
+ $data = (new SystemData)->where("code",$param['type'])->value("content");
|
|
|
+ $data = !empty($data) ? json_decode($data,true) : [];
|
|
|
+ return successTrans("success.data",$data);
|
|
|
} catch (\Throwable $throwable) {
|
|
|
return error($throwable->getMessage());
|
|
|
}
|