FastMovieAI 二开基线 v1.0 (完整源码)

This commit is contained in:
李建琦
2026-08-26 18:41:02 +08:00
parent fad7690c0c
commit d54584f70d
888 changed files with 105571 additions and 1 deletions
+66
View File
@@ -0,0 +1,66 @@
<?php
namespace app\model;
use app\expose\helper\Uploads;
use app\expose\utils\Password;
use loong\oauth\facade\Auth;
class Admin extends Basic
{
protected function getOptions(): array
{
return [
'type' => [
// 设置JSON字段的类型
'allow_week' => 'json'
]
];
}
public function getHeadimgAttr($value)
{
return Uploads::url($value);
}
public function setHeadimgAttr($value)
{
return Uploads::path($value);
}
public function getNicknameAttr($value)
{
return base64_decode($value);
}
public function setNicknameAttr($value)
{
return base64_encode($value);
}
public function setPasswordAttr($value)
{
return Password::encrypt($value);
}
public static function getTokenInfo(Admin $Admin)
{
/* 重组用户信息 */
$AdminUser = new \stdClass;
$AdminUser->nickname = $Admin->nickname;
$AdminUser->headimg = $Admin->headimg;
$AdminUser->username = $Admin->username;
/* 生成token */
$data = new \stdClass;
$data->uid = $Admin->id;
$data->role_id = $Admin->role_id;
$data->username = $Admin->username;
$data->mobile = $Admin->mobile;
$data->email = $Admin->email;
$data->allow_time_start = $Admin->allow_time_start;
$data->allow_time_end = $Admin->allow_time_end;
$data->allow_week = $Admin->allow_week;
$AdminRole = AdminRole::where(['id' => $Admin->role_id])->find();
$data->is_system = $AdminRole->is_system;
$data->permissions = $AdminRole->rule;
$AdminUser->role_name = $AdminRole['name'];
$AdminUser->is_system = $AdminRole->is_system;
$AdminUser->permissions = $AdminRole->rule;
$AdminUser->token = Auth::setPrefix('ADMIN')->encrypt($data);
return $AdminUser;
}
}
+37
View File
@@ -0,0 +1,37 @@
<?php
namespace app\model;
class AdminRole extends Basic
{
public $json = ['rule'];
public $jsonAssoc = true;
public static function options($pid = null, $where = [])
{
if ($pid) {
$data = self::where($where)->where(['pid' => $pid])->select();
} else {
$data = self::where($where)->whereNull('pid')->select();
}
$options = [];
if ($data->isEmpty()) {
return $options;
}
foreach ($data as $item) {
$temp = [
'value' => $item->id,
'label' => $item['name']
];
$children = self::options($item->id, $where);
if (!empty($children)) {
$temp['children'] = $children;
}
$options[] = $temp;
}
return $options;
}
public static function systemRole($column = '*')
{
return self::where('is_system', 1)->column($column);
}
}
+10
View File
@@ -0,0 +1,10 @@
<?php
namespace app\model;
use think\Model;
class Basic extends Model
{
public $autoWriteTimestamp = 'datetime';
}
+16
View File
@@ -0,0 +1,16 @@
<?php
namespace app\model;
class Config extends Basic
{
protected function getOptions(): array
{
return [
'type' => [
// 设置JSON字段的类型
'value' => 'json'
]
];
}
}
@@ -0,0 +1,7 @@
<?php
namespace app\model;
class PaymentConfig extends Basic
{
}
@@ -0,0 +1,8 @@
<?php
namespace app\model;
class PaymentNotifyWechat extends Basic
{
}
@@ -0,0 +1,38 @@
<?php
namespace app\model;
use app\expose\enum\PaymentChannels;
use app\expose\enum\State;
class PaymentTemplate extends Basic
{
protected function getOptions(): array
{
return [
'type' => [
// 设置JSON字段的类型
'value' => 'json'
]
];
}
public static function options($where = [])
{
$options = [];
$where[] = ['state', '=', State::YES['value']];
$templates = self::where($where)->select();
foreach ($templates as $template) {
$channel = PaymentChannels::getText($template->channels);
$options[] = [
'label' => "{$channel} - {$template->title}",
'value' => $template->id,
'extra' => [
'where' => [
['channels', '=', $template->channels]
]
],
];
}
return $options;
}
}
+7
View File
@@ -0,0 +1,7 @@
<?php
namespace app\model;
class Uploads extends Basic
{
}
@@ -0,0 +1,7 @@
<?php
namespace app\model;
class UploadsClassify extends Basic
{
}