Compare commits
38 Commits
885b86ded9
...
5018a59045
| Author | SHA1 | Date | |
|---|---|---|---|
| 5018a59045 | |||
| e781887d16 | |||
| 3eda90f2d1 | |||
| df8001d43e | |||
| 7f8ad55c97 | |||
| 14f0f1609e | |||
| 6c176a1039 | |||
| bffe804a7b | |||
| a9beb0dda6 | |||
| 3c72fa125f | |||
| 81df05e0f9 | |||
| e0fd77837d | |||
| 7344691613 | |||
| fe697df167 | |||
| b743688d99 | |||
| 51b6841a3a | |||
| 768ed5b0fb | |||
| 0c2f96fd49 | |||
| 40c8385776 | |||
| 80c6647a0c | |||
| 187a0affcc | |||
| a35288dd0b | |||
| b36627ec25 | |||
| eb2a98e7fe | |||
| 5c79e33ce1 | |||
| 341e1f54fb | |||
| 78925fbbab | |||
| d9e056972c | |||
| b09f7d1e6f | |||
| ad0f7f4b87 | |||
| 61e4ac1fb3 | |||
| 728730433b | |||
| 3a50a23cfa | |||
| 1dc03040f1 | |||
| 900d73d389 | |||
| 5b69987d6e | |||
| 512c07b5a8 | |||
| c04b7cae38 |
5
.env
5
.env
@@ -1,5 +0,0 @@
|
||||
|
||||
[JWT]
|
||||
TTL=3600
|
||||
REFRESH_TTL=20160
|
||||
SECRET=b43e6276644ed60e65c50d1b324ba10b
|
||||
@@ -36,12 +36,14 @@ WHITE_LIST[] = receive_sync/product
|
||||
# 不需记录日志的接口
|
||||
[ADMIN_API]
|
||||
IGNORE_LOGGING_LIST[] = v1/OperateLog/index
|
||||
MAX_IMAGE_SIZE = 5mb # 图片上传最大限制
|
||||
MAX_VIDEO_SIZE = 150mb # 视频上传最大限制
|
||||
MAX_ATTACHMENT_SIZE = 100mb # 附件上传最大限制
|
||||
MAX_IMAGE_SIZE = 5mb; # 图片上传最大限制
|
||||
MAX_VIDEO_SIZE = 150mb; # 视频上传最大限制
|
||||
MAX_ATTACHMENT_SIZE = 100mb; # 附件上传最大限制
|
||||
|
||||
# 开放API
|
||||
[OPENAPI]
|
||||
ACCESS_TOKEN_LIFETIME = 3600; # 访问令牌有效期
|
||||
REFRESH_TOKEN_LIFETIME = 1209600; # 刷新令牌有效期
|
||||
RESOURCE_IMAGES_DOMAIN = http://local.orico.com; # 图片资源服务器地址
|
||||
RESOURCE_VIDEOS_DOMAIN = http://local.orico.com; # 视频资源服务器地址
|
||||
|
||||
|
||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -3,8 +3,10 @@ composer.phar
|
||||
composer.lock
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.env
|
||||
.env.dev
|
||||
.env.local
|
||||
.env.prod
|
||||
|
||||
/.idea
|
||||
/.vscode
|
||||
|
||||
@@ -183,7 +183,7 @@ class ReceiveProductSync
|
||||
'desc' => '',
|
||||
'video_img' => '',
|
||||
'video_url' => '',
|
||||
'is_sale' => 0,
|
||||
'is_sale' => 1,
|
||||
'is_new' => 0,
|
||||
'is_hot' => 0,
|
||||
'is_show' => 0,
|
||||
|
||||
@@ -171,7 +171,7 @@ class Product
|
||||
// 更新产品参数
|
||||
if ($put['params'] != "") {
|
||||
ProductParamsModel::productId($id)->delete();
|
||||
if (preg_match_all('/(\S+):(.[^\s]+)/', $put['params'], $match_result)) {
|
||||
if (preg_match_all('/(.+):(.+)/', $put['params'], $match_result)) {
|
||||
$params = [];
|
||||
for ($i = 0; $i < count($match_result[0]); $i++) {
|
||||
$params[] = [
|
||||
|
||||
@@ -18,6 +18,6 @@ class SysRoleAuthorityBaseModel extends Model
|
||||
protected $schema = [
|
||||
'role_id' => 'int',
|
||||
'menu_id' => 'int',
|
||||
'permission' => 'int',
|
||||
'permission' => 'string',
|
||||
];
|
||||
}
|
||||
|
||||
@@ -53,6 +53,7 @@ return [
|
||||
'product/search' => [
|
||||
'搜索' => 'Search',
|
||||
'请搜索' => 'Please search...',
|
||||
'暂无数据' => 'No data',
|
||||
],
|
||||
// 产品详情
|
||||
'product/detail' => [
|
||||
|
||||
@@ -177,6 +177,11 @@ return [
|
||||
'提交' => 'SUBMIT',
|
||||
],
|
||||
|
||||
// 产品 - 搜索
|
||||
'product/search' => [
|
||||
'暂无数据' => 'No data',
|
||||
],
|
||||
|
||||
// 产品 - 分类
|
||||
'product/category' => [
|
||||
'查看全部' => 'View All',
|
||||
|
||||
@@ -101,7 +101,7 @@
|
||||
<a href="{$sc.link}"><img src="{$sc.image}" /></a>
|
||||
<div class="position_a text_center wow animated bounceInLeft">
|
||||
<p class="f_weight_500 timetitle" {:style(['color'=>$sc['title_txt_color']])}>{$sc.title}</p>
|
||||
<p class=" margin-top-14 f_weight_400 timedesin" {:style(['color'=>$sc['desc_txt_color']])}>{$sc.desc}</p>
|
||||
<p class=" margin-top-14 f_weight_400 timedesin" {:style(['color'=>$sc['desc_txt_color']])}>{$sc.desc|raw}</p>
|
||||
<p class=" margin-top-20 f_weight_400">
|
||||
<a href="{$sc.link}" class="timeblue"> {:lang_i18n('了解更多')} <img src="__IMAGES__/more-r.png"></a>
|
||||
</p>
|
||||
@@ -141,7 +141,7 @@
|
||||
<img src="{$bs.image}">
|
||||
<div class="position_a text_center">
|
||||
<p class=" timetitle" {:style(['color'=>$bs['title_txt_color']])}>{$bs.title} </p>
|
||||
<p class=" margin-top-14 f_weight_400 timedesin" {:style(['color'=>$bs['desc_txt_color']])}>{$bs.desc}</p>
|
||||
<p class=" margin-top-14 f_weight_400 timedesin" {:style(['color'=>$bs['desc_txt_color']])}>{$bs.desc|raw}</p>
|
||||
<p class=" margin-top-20 f_weight_400">
|
||||
<span class=" timeblue">
|
||||
<a href="{$bs.link}">{:lang_i18n('了解更多')}<img src="__IMAGES__/more-r.png"></a>
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
{volist name="vo.products" id="pro" length="4"}
|
||||
<li class="img-responsive">
|
||||
<a href="{:url('product/detail', ['id' => $pro.id])}">
|
||||
<img src="{$pro.cover_image}">
|
||||
<img src="{:thumb($pro.cover_image)}">
|
||||
<span class="title">{$pro.name}</span>
|
||||
<span class="subtitle">{$pro.spu}</span>
|
||||
</a>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<div class="prlist">
|
||||
{volist name="products" id="pro"}
|
||||
<a class="pritem" href="{:url('product/detail',['id'=>$pro.id])}">
|
||||
<img src="{$pro.cover_image}" class="primg"/>
|
||||
<img src="{:thumb($pro.cover_image)}" class="primg"/>
|
||||
<div class="prinfo">
|
||||
<span class="t1">{$pro.name|raw}</span>
|
||||
<span class="t2">{$pro.spu|raw}</span>
|
||||
@@ -28,7 +28,7 @@
|
||||
<!-- 分页 -->
|
||||
<div>{$page|raw}</div>
|
||||
{else/}
|
||||
<div style="text-align: center; padding: 10%;">暂无数据</div>
|
||||
<div style="text-align: center; padding: 10%;">{:lang_i18n('暂无数据')}</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
<div class="m_Container">
|
||||
{notempty name="categorys_data"}
|
||||
<div class="product_list">
|
||||
{if condition="in_array('products', array_keys($categorys_data[0]))"}
|
||||
<ul>
|
||||
{assign name="products" value=":\think\helper\Arr::flatMap(fn($pro) => $pro['products'], $categorys_data)" /}
|
||||
{volist name="products" id="pr"}
|
||||
@@ -55,6 +56,7 @@
|
||||
</li>
|
||||
{/volist}
|
||||
</ul>
|
||||
{/if}
|
||||
</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
|
||||
@@ -33,9 +33,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<!-- 文章内容 -->
|
||||
<div id="rendered-content" class="nhlp-app-content">
|
||||
<div class="ql-container">
|
||||
<div id="rendered-content" class="nhlp-app-content ql-editor">
|
||||
{$article.content|raw|default=''}
|
||||
</div>
|
||||
</div>
|
||||
<!-- 搜索 -->
|
||||
<div class="nhlpapp-search">
|
||||
<div class="nhlpappshtop">
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</ul>
|
||||
<div>{$page|raw}</div>
|
||||
{else/}
|
||||
<div style="text-align: center; padding: 10%;">暂无数据</div>
|
||||
<div style="text-align: center; padding: 10%;">{:lang_i18n('暂无数据')}</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,9 @@
|
||||
{/notempty}
|
||||
</div>
|
||||
<!--文章详情 -->
|
||||
<div class="nars-hlpdt-mm" id="rendered-content">{$article.content|raw|default=''}</div>
|
||||
<div class="ql-container ">
|
||||
<div class="nars-hlpdt-mm ql-editor" id="rendered-content">{$article.content|raw|default=''}</div>
|
||||
</div>
|
||||
<!--锚点定位 -->
|
||||
<div class="nars-hlpdt-mr">
|
||||
<div id="title-list">
|
||||
|
||||
@@ -25,7 +25,10 @@ class Authorize
|
||||
$server = request()->server();
|
||||
$request = new Request([], $post, [], [], [], $server);
|
||||
$storage = new OAuthStorage;
|
||||
$oauth = new OAuth2($storage);
|
||||
$oauth = new OAuth2($storage, [
|
||||
'access_token_lifetime' => intval(env('OPENAPI.ACCESS_TOKEN_LIFETIME', 3600)),
|
||||
'refresh_token_lifetime' => intval(env('OPENAPI.REFRESH_TOKEN_LIFETIME', 1209600)),
|
||||
]);
|
||||
$token = $oauth->grantAccessToken($request);
|
||||
return success('success', json_decode($token->getContent(), true));
|
||||
} catch (OAuth2ServerException $e) {
|
||||
|
||||
@@ -19,7 +19,10 @@ class Auth
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
try {
|
||||
$oauth = new OAuth2(new OAuthStorage);
|
||||
$oauth = new OAuth2(new OAuthStorage, [
|
||||
'access_token_lifetime' => intval(env('OPENAPI.ACCESS_TOKEN_LIFETIME', 3600)),
|
||||
'refresh_token_lifetime' => intval(env('OPENAPI.REFRESH_TOKEN_LIFETIME', 1209600)),
|
||||
]);
|
||||
$token = $oauth->getBearerToken();
|
||||
$oauth->verifyAccessToken($token);
|
||||
} catch (OAuth2ServerException $e) {
|
||||
|
||||
@@ -20,6 +20,8 @@ class OAuthClientModel extends Model
|
||||
'client_secret' => 'string',
|
||||
'redirect_uri' => 'string',
|
||||
'enabled' => 'int',
|
||||
'expired_at' => 'datetime',
|
||||
'remark' => 'string',
|
||||
'created_at' => 'datetime',
|
||||
'updated_at' => 'datetime',
|
||||
'deleted_at' => 'datetime'
|
||||
|
||||
@@ -78,15 +78,18 @@ class OAuthStorage implements IOAuth2GrantCode, IOAuth2RefreshTokens, IOAuth2Gra
|
||||
public function getClient($client_id): IOAuth2Client
|
||||
{
|
||||
// 实现获取客户端的逻辑
|
||||
$ret = OAuthClientModel::clientId($client_id)->find();
|
||||
if (is_null($ret)) {
|
||||
$client = OAuthClientModel::clientId($client_id)->find();
|
||||
if (is_null($client)) {
|
||||
throw new \Exception('客户端不存在');
|
||||
}
|
||||
if ($ret->enabled != 1) {
|
||||
if ($client->enabled != 1) {
|
||||
throw new \Exception('客户端已禁用');
|
||||
}
|
||||
if (strtotime($client->expired_at) < time()) {
|
||||
throw new \Exception('client_id 授权已过期');
|
||||
}
|
||||
|
||||
return new OAuth2Client($ret->client_id, $ret->client_secret, [$ret->redirect_uri]);
|
||||
return new OAuth2Client($client->client_id, $client->client_secret, [$client->redirect_uri]);
|
||||
}
|
||||
|
||||
public function checkClientCredentials(IOAuth2Client $client, $client_secret = null): bool
|
||||
@@ -96,6 +99,9 @@ class OAuthStorage implements IOAuth2GrantCode, IOAuth2RefreshTokens, IOAuth2Gra
|
||||
if (is_null($client)) {
|
||||
return false;
|
||||
}
|
||||
if (strtotime($client->expired_at) < time()) {
|
||||
throw new \Exception('client_id 授权已过期');
|
||||
}
|
||||
|
||||
return $client->client_secret == hash('sha1', $client->client_id . $client_secret . $this->salt);
|
||||
}
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
font-size: 14px;
|
||||
font-family: Montserrat-Bold, Montserrat;
|
||||
font-weight: bold;
|
||||
width: 212px;
|
||||
/* width: 212px; */
|
||||
/* height: 48px; */
|
||||
padding: 15px 60px;
|
||||
background: #004bfa;
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
font-size: 14px;
|
||||
font-family: Montserrat-Bold, Montserrat;
|
||||
font-weight: bold;
|
||||
width: 212px;
|
||||
/* width: 212px; */
|
||||
padding: 15px 60px;
|
||||
background: #004bfa;
|
||||
border-radius: 28px;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -541,7 +541,7 @@
|
||||
margin-left: 1%;
|
||||
border-radius: 26px 26px 26px 26px;
|
||||
width: 98%;
|
||||
height: 41.625rem;
|
||||
/* height: 41.625rem; */
|
||||
}
|
||||
|
||||
.orico_Page_index .pageMain .brandStory .swiper-wrapper .bsitem .bsinf {
|
||||
|
||||
@@ -608,13 +608,13 @@
|
||||
.scrollbutton_01.smallImgUp,
|
||||
.scrollbutton_01.smallImgUp.disabled {
|
||||
background: url(/static/index/pc/images/fl.png);
|
||||
left: 0px;
|
||||
left: 10%;
|
||||
}
|
||||
|
||||
.scrollbutton_01.smallImgDown,
|
||||
.scrollbutton_01.smallImgDown.disabled {
|
||||
background: url(/static/index/pc/images/rh.png);
|
||||
right: 0px;
|
||||
right: 10%;
|
||||
}
|
||||
|
||||
.scrollbutton.smallImgUp,
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user