1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-29 05:41:37 +08:00

1.抽离refund.info.js

2.优化获取临时令牌日志
This commit is contained in:
xiaochong0302 2025-04-03 18:58:33 +08:00
parent 02983a27c9
commit 08d3859e38
9 changed files with 75 additions and 88 deletions

View File

@ -3,7 +3,6 @@
<table class="kg-table layui-table">
<tr>
<th>名称</th>
<th>类型</th>
<th>大小</th>
<th>日期</th>
<th width="15%">操作</th>
@ -13,7 +12,6 @@
{% set delete_url = url({'for':'admin.resource.delete','id':item.id}) %}
<tr>
<td><input class="layui-input res-name" type="text" value="{{ item.upload.name }}" data-url="{{ update_url }}"></td>
<td>{{ item.upload.mime }}</td>
<td>{{ item.upload.size|human_size }}</td>
<td>{{ date('Y-m-d H:i:s',item.create_time) }}</td>
<td>
@ -27,4 +25,4 @@
{% else %}
<div class="kg-center">没有相关资料</div>
<br>
{% endif %}
{% endif %}

View File

@ -34,7 +34,7 @@ class AccountController extends Controller
}
if ($this->authUser->id > 0) {
return $this->response->redirect('/');
return $this->response->redirect(['for' => 'home.index']);
}
$returnUrl = $this->request->getHTTPReferer();
@ -62,7 +62,7 @@ class AccountController extends Controller
}
if ($this->authUser->id > 0) {
return $this->response->redirect('/');
return $this->response->redirect(['for' => 'home.index']);
}
$service = new OAuthProviderService();
@ -105,7 +105,7 @@ class AccountController extends Controller
return $this->response->redirect(['for' => 'home.index']);
}
$this->seo->prependTitle('重置密码');
$this->seo->prependTitle('忘记密码');
}
/**
@ -119,9 +119,11 @@ class AccountController extends Controller
$returnUrl = $this->request->getPost('return_url', 'string');
$location = $returnUrl ?: $this->url->get(['for' => 'home.index']);
$content = [
'location' => $returnUrl ?: '/',
'msg' => '注册成功',
'location' => $location,
'msg' => '注册账号成功',
];
return $this->jsonSuccess($content);
@ -140,7 +142,12 @@ class AccountController extends Controller
$location = $returnUrl ?: $this->url->get(['for' => 'home.index']);
return $this->jsonSuccess(['location' => $location]);
$content = [
'location' => $location,
'msg' => '登录账号成功',
];
return $this->jsonSuccess($content);
}
/**
@ -156,7 +163,12 @@ class AccountController extends Controller
$location = $returnUrl ?: $this->url->get(['for' => 'home.index']);
return $this->jsonSuccess(['location' => $location]);
$content = [
'location' => $location,
'msg' => '登录账号成功',
];
return $this->jsonSuccess($content);
}
/**

View File

@ -26,7 +26,7 @@
<a class="layui-btn layui-bg-blue" href="{{ order_pay_url }}" target="_top">立即支付</a>
{% endif %}
{% if order.me.allow_cancel == 1 %}
<a class="layui-btn layui-bg-red order-cancel" href="javascript:" data-sn="{{ order.sn }}" data-url="{{ order_cancel_url }}">立即取消</a>
<button class="layui-btn layui-bg-red btn-order-cancel" data-sn="{{ order.sn }}" data-url="{{ order_cancel_url }}">立即取消</button>
{% endif %}
{% if order.me.allow_refund == 1 %}
<a class="layui-btn layui-bg-blue" href="{{ refund_confirm_url }}">申请退款</a>
@ -39,4 +39,4 @@
{{ js_include('home/js/order.info.js') }}
{% endblock %}
{% endblock %}

View File

@ -9,9 +9,9 @@
<table class="layui-table order-table" lay-size="lg">
<tr>
<td colspan="2">
订单金额:<span class="price">{{ '¥%0.2f'|format(refund.order.amount) }}</span>
退款金额:<span class="price">{{ '¥%0.2f'|format(refund.amount) }}</span>
退款状态:<span class="status">{{ refund_status(refund.status) }}</span>
<span>订单金额:<em class="price">{{ '¥%0.2f'|format(refund.order.amount) }}</em></span>
<span>退款金额:<em class="price">{{ '¥%0.2f'|format(refund.amount) }}</em></span>
<span>退款状态:{{ refund_status(refund.status) }}</span>
</td>
</tr>
<tr>
@ -22,41 +22,8 @@
<br>
<div class="center">
{% if refund.me.allow_cancel == 1 %}
<button class="kg-refund layui-btn" data-sn="{{ refund.sn }}" data-url="{{ cancel_url }}">取消退款</button>
<button class="layui-btn btn-refund-cancel" data-sn="{{ refund.sn }}" data-url="{{ cancel_url }}">取消退款</button>
{% endif %}
</div>
{% endblock %}
{% block inline_js %}
<script>
layui.use(['jquery', 'layer'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.iframeAuto(index);
$('.kg-refund').on('click', function () {
var url = $(this).data('url');
var data = {sn: $(this).data('sn')};
layer.confirm('确定要取消退款吗?', function () {
$.ajax({
type: 'POST',
url: url,
data: data,
success: function (res) {
layer.msg(res.msg, {icon: 1});
setTimeout(function () {
parent.window.location.href = '/uc/refunds';
}, 1500);
}
});
});
});
});
</script>
{% endblock %}

View File

@ -10,10 +10,11 @@
{% set point_enabled = setting('point','enabled') %}
<div class="my-profile-card wrap">
<div class="vip">{{ vip_info(auth_user) }}</div>
<div class="avatar">
<img class="my-avatar" src="{{ auth_user.avatar }}" alt="{{ auth_user.name }}">
</div>
<div class="name">{{ auth_user.name }} {{ vip_info(auth_user) }}</div>
<div class="name">{{ auth_user.name }}</div>
</div>
<div class="layui-card">
@ -71,4 +72,4 @@
<li><a href="{{ url({'for':'home.uc.account'}) }}">帐号安全</a></li>
</ul>
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<div class="layui-row layui-col-space20">
{% for item in pager.items %}
{% set user_url = url({'for':'home.user.show','id':item.id}) %}
<div class="layui-col-md2">
<div class="layui-col-md3">
<div class="user-card">
<div class="avatar">
<a href="{{ user_url }}" title="{{ item.about }}" target="_blank">

View File

@ -10,6 +10,7 @@ namespace App\Services;
use Phalcon\Logger\Adapter\File as FileLogger;
use Qcloud\Cos\Client as CosClient;
use TencentCloud\Common\Credential;
use TencentCloud\Common\Exception\TencentCloudSDKException;
use TencentCloud\Common\Profile\ClientProfile;
use TencentCloud\Common\Profile\HttpProfile;
use TencentCloud\Sts\V20180813\Models\GetFederationTokenRequest;
@ -100,11 +101,12 @@ class Storage extends Service
$result = $client->GetFederationToken($request);
} catch (\Exception $e) {
} catch (TencentCloudSDKException $e) {
$this->logger->error('Get Tmp Token Exception' . kg_json_encode([
$this->logger->error('Get Tmp Token Exception ' . kg_json_encode([
'code' => $e->getCode(),
'message' => $e->getMessage(),
'requestId' => $e->getRequestId(),
]));
$result = false;
@ -130,11 +132,12 @@ class Storage extends Service
$result = $response['Location'] ? $key : false;
} catch (\Exception $e) {
} catch (TencentCloudSDKException $e) {
$this->logger->error('Put String Exception ' . kg_json_encode([
'code' => $e->getCode(),
'message' => $e->getMessage(),
'requestId' => $e->getRequestId(),
]));
$result = false;
@ -162,11 +165,12 @@ class Storage extends Service
$result = $response['Location'] ? $key : false;
} catch (\Exception $e) {
} catch (TencentCloudSDKException $e) {
$this->logger->error('Put File Exception ' . kg_json_encode([
'code' => $e->getCode(),
'message' => $e->getMessage(),
'requestId' => $e->getRequestId(),
]));
$result = false;
@ -194,11 +198,12 @@ class Storage extends Service
$result = $response['Location'] ? $key : false;
} catch (\Exception $e) {
} catch (TencentCloudSDKException $e) {
$this->logger->error('Delete Object Exception ' . kg_json_encode([
'code' => $e->getCode(),
'message' => $e->getMessage(),
'requestId' => $e->getRequestId(),
]));
$result = false;

View File

@ -1799,10 +1799,6 @@
background-color: #f2f2f2;
}
.user-tab {
margin: 0;
}
.user-tab .layui-tab-title {
margin-bottom: 10px;
text-align: center;
@ -1843,7 +1839,7 @@
.user-card {
float: left;
width: 100%;
height: 240px;
height: 200px;
position: relative;
text-align: center;
background-color: #fff;
@ -1876,32 +1872,6 @@
color: #666;
}
.user-card .meta {
color: #666;
}
.user-card .meta span {
margin-right: 5px;
}
.user-card .type {
position: absolute;
top: 18px;
right: 28px;
}
.user-list {
margin-bottom: 20px;
}
.teacher-list .user-card {
height: 200px;
}
.vip-user-list .user-card {
height: 200px;
}
.tag-card {
float: left;
width: 100%;
@ -1947,10 +1917,17 @@
}
.my-profile-card {
position: relative;
margin-bottom: 15px;
text-align: center;
}
.my-profile-card .vip {
position: absolute;
right: 15px;
top:15px;
}
.my-profile-card .avatar {
margin-bottom: 10px;
}

View File

@ -0,0 +1,27 @@
layui.use(['jquery', 'layer'], function () {
var $ = layui.jquery;
var layer = layui.layer;
var index = parent.layer.getFrameIndex(window.name);
parent.layer.iframeAuto(index);
$('.btn-refund-cancel').on('click', function () {
var url = $(this).data('url');
var data = {sn: $(this).data('sn')};
layer.confirm('确定要取消退款吗?', function () {
$.ajax({
type: 'POST',
url: url,
data: data,
success: function () {
layer.msg('取消退款成功', {icon: 1});
setTimeout(function () {
parent.window.location.href = '/uc/refunds';
}, 1500);
}
});
});
});
});