This commit is contained in:
2025-09-13 01:22:15 +08:00
parent 155e05fd6d
commit 1a4b8551a0
674 changed files with 146276 additions and 0 deletions

View File

@ -0,0 +1,11 @@
<div class="hero-unit">
<p align="center"><img src="/img/ag-hero.png" alt="Laminas API Tools <?= \ApiTools\VERSION ?>"></p>
</div>
<div class="row">
<div class="span8">
<p><br /><br />In order to use the <strong>Laminas API Tools Admin UI</strong> you need to enable the <strong>development</strong> mode. Currently your application is running in <strong>production</strong> mode.</p>
<p>To enable the development mode you can execute the following command from the terminal:</p>
<p><pre>$ composer development-enable</pre></p>
<p>Remember to set always the production mode if you want to deploy your API in a staging/production environment.</p>
</div>
</div>

View File

@ -0,0 +1,134 @@
<?php
$info = \Application\Service\Extension\Laminas::$serviceManager->adminWebsitefiling->getCurrentWebsiteFiling();
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>登录申请</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">
<link rel="stylesheet" type="text/css" href="/css/weui.min.css">
<style>
#login-btn {
border-radius: 2rem;
}
.weui-btn_primary {
background-color: #409eff;
}
.weui-list-tips__item:before {
content: "\2022";
position: absolute;
left: 0;
top: -0.1em;
}
.weui-list-tips:before {
content: "";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1px solid #000000;
color: rgba(0,0,0,0.1);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.weui-msg__desc+.weui-msg__custom-area, .weui-msg__desc-primary+.weui-msg__custom-area {
margin-top: 40px;
}
.weui-msg__custom-area {
text-align: left;
word-wrap: break-word;
-webkit-hyphens: auto;
hyphens: auto;
margin-bottom: 16px;
}
.weui-list-tips:last-child {
padding-bottom: 0;
}
.weui-list-tips {
list-style: none;
padding-top: 24px;
padding-bottom: 24px;
line-height: 1.4;
font-size: 14px;
position: relative;
}
.weui-list-tips__item:first-child {
margin-top: 0;
}
.weui-list-tips__item {
position: relative;
padding-left: 15px;
margin: 16px 0;
}
.weui-btn_primary:not(.weui-btn_disabled):active {
color: hsla(0,0%,100%,.6);
background-color: #166a9b;
}
.weui-msg__icon-area img{
width: 120px;
width: 120px;
}
.weui-msg__icon-area {
height: 120px;
}
</style>
</head>
<body>
<!--头像-->
<div class="container">
<div class="page msg_success js_show" tabindex="-1">
<div class="weui-msg">
<div class="weui-msg__icon-area">
<!-- <i class="weui-icon-success weui-icon_msg"></i>-->
<img src="<?= current(json_decode($info['website_logo'], true))['url'] ?? '' ?>"/>
</div>
<div class="weui-msg__text-area">
<h2 class="weui-msg__title">申请获取以下权限</h2>
<div class="weui-msg__custom-area">
<ul class="weui-list-tips">
<li role="option" class="weui-list-tips__item">获得您的公开信息(昵称,头像等)</li>
</ul>
</div>
</div>
<div class="weui-msg__opr-area">
<p class="weui-btn-area">
<a href="javascript:" id="login-btn" role="button" class="weui-btn weui-btn_primary">微信一键授权登录</a>
</p>
</div>
</div>
<div class="weui-footer weui-footer_fixed-bottom">
<p class="weui-footer__text">技术支持 <?= $info['company_name'] ?? '' ?></p>
<p class="weui-footer__text">Copyright © <?= $info['origin_year'] ?>-<?= $info['current_year'] ?></p>
<a href="//beian.miit.gov.cn/" class="page_copyright">
<?= $info['company_recordno'] ?>
</a>
</div>
</div>
<div role="alert" id="loadingToast" style="opacity: 0; display: none;">
<div class="weui-mask_transparent"></div>
<div class="weui-toast">
<span class="weui-primary-loading weui-icon_toast">
<span class="weui-primary-loading__dot"></span>
</span>
<p class="weui-toast__content">加载中</p>
</div>
</div>
<script>
window.onload = function () {
document.getElementById('login-btn').addEventListener('click', function () {
window.location = '<?= $authUrl ?>'
})
}
</script>
</html>

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,4 @@
<?php
$path = $_SERVER['DOCUMENT_ROOT'].'/static/index.html';
$html = file_get_contents($path);
echo $html;

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,383 @@
<style>
.weui-form {
padding: 56px 0 0;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
line-height: 1.4;
min-height: 100%;
box-sizing: border-box;
background-color: #fff;
}
.weui-cell {
padding: 16px;
position: relative;
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
line-height: 1.41176471;
font-size: 17px;
color: rgba(0,0,0,0.9);
}
.weui-form__text-area {
padding: 0 32px;
color: #000000;
text-align: center;
}
.weui-form__control-area {
-webkit-box-flex: 1;
-webkit-flex: 1;
flex: 1;
margin: 48px 0;
}
.weui-cells__group_form .weui-cells {
margin-left: 16px;
margin-right: 16px;
}
.weui-cells__group_form .weui-cell {
padding: 16px 16px;
}
[class*=" weui-icon-"] {
display: inline-block;
vertical-align: middle;
font-size: 10px;
width: 2.4em;
height: 2.4em;
-webkit-mask-position: 50% 50%;
mask-position: 50% 50%;
-webkit-mask-repeat: no-repeat;
mask-repeat: no-repeat;
-webkit-mask-size: 100%;
mask-size: 100%;
background-color: currentColor;
}
.weui-cells__group_form .weui-cell_vcode.weui-cell_wrap .weui-input {
font-size: 17px;
min-height: 1.88235294em;
}
.weui-cells__group_form input, .weui-cells__group_form textarea, .weui-cells__group_form label[for] {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.weui-input {
width: 100%;
border: 0;
outline: 0;
-webkit-appearance: none;
background-color: transparent;
font-size: inherit;
color: inherit;
height: 1.41176471em;
line-height: 1.41176471;
}
.weui-cells__group_form .weui-vcode-btn {
font-size: 16px;
padding: 0 12px;
height: auto;
width: auto;
line-height: 2;
border-radius: 6px;
color: #06ae56;
background-color: #f2f2f2;
}
button.weui-vcode-btn {
background-color: transparent;
border: 0;
outline: 0;
}
button.weui-btn, input.weui-btn {
border-width: 0;
outline: 0;
-webkit-appearance: none;
}
.weui-vcode-btn {
display: inline-block;
height: 56px;
margin-left: 5px;
padding: 0 0.6em 0 0.7em;
line-height: 56px;
vertical-align: middle;
font-size: 17px;
color: #576b95;
position: relative;
}
.weui-btn_default {
color: #06ae56;
background-color: #f2f2f2;
}
.weui-btn {
position: relative;
display: block;
width: 184px;
margin-left: auto;
margin-right: auto;
padding: 8px 24px;
box-sizing: border-box;
font-weight: 700;
font-size: 17px;
text-align: center;
text-decoration: none;
color: #fff;
line-height: 1.88235294;
border-radius: 8px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none;
user-select: none;
}
.form_vcode {
height: 85vh;
}
.weui-cells__group_form .weui-cell_vcode.weui-cell_wrap .weui-label {
margin-top: 12px;
}
.page.form_input_status .weui-label, .page.form_vcode .weui-label {
width: 3.14em;
}
.weui-cells__group_form .weui-cell_wrap .weui-label {
margin-top: 8px;
}
.weui-cells__group_form input, .weui-cells__group_form textarea, .weui-cells__group_form label[for] {
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.weui-cells__group_form .weui-label {
max-width: 5em;
margin-right: 8px;
}
.weui-cells__group_form .weui-cell__control {
margin: 8px 0 8px 16px;
}
.weui-btn {
position: relative;
display: block;
width: 184px;
margin-left: auto;
margin-right: auto;
padding: 8px 24px;
box-sizing: border-box;
font-weight: 700;
font-size: 17px;
text-align: center;
text-decoration: none;
color: #fff;
line-height: 1.88235294;
border-radius: 8px;
-webkit-tap-highlight-color: rgba(0,0,0,0);
-webkit-user-select: none;
user-select: none;
}
.weui-toast {
position: fixed;
z-index: 5500;
font-size: 10px;
width: 13.6em;
height: 13.6em;
top: 40%;
left: 50%;
-webkit-transform: translate(-50%,-50%);
transform: translate(-50%,-50%);
text-align: center;
border-radius: 12px;
color: rgba(255,255,255,0.9);
display: -webkit-box;
display: -webkit-flex;
display: flex;
-webkit-box-orient: vertical;
-webkit-box-direction: normal;
-webkit-flex-direction: column;
flex-direction: column;
-webkit-box-align: center;
-webkit-align-items: center;
align-items: center;
-webkit-box-pack: center;
-webkit-justify-content: center;
justify-content: center;
background-color: #4c4c4c;
box-sizing: border-box;
line-height: 1.4;
}
.weui-toast_text {
width: auto;
height: auto;
min-width: 152px;
max-width: 216px;
padding: 12px 0;
border-radius: 8px;
}
.weui-toast_text .weui-toast__content {
font-size: 14px;
padding: 0 20px;
}
.weui-btn[disabled] {
color: rgba(0,0,0,0.2);
background-color: #f2f2f2;
}
</style>
<div class="page form_vcode js_show" tabindex="-1">
<input type="hidden" value="<?= $openid ?>" id="input-openid">
<div class="weui-form">
<div class="weui-form__text-area">
<h2 class="weui-form__title">手机号绑定</h2>
<!-- <div class="weui-form__desc" id="">--><?//= $openid ?><!--</div>-->
</div>
<div class="weui-form__control-area">
<div class="weui-cells__group weui-cells__group_form">
<div class="weui-cells">
<div class="weui-cell weui-cell_active">
<div class="weui-cell__hd"><label class="weui-label">手机号</label></div>
<span class="weui-cell__control">+86</span>
<div class="weui-cell__bd">
<input id="input-mobile" class="weui-input weui-cell__control" type="number" placeholder="请输入手机号" value="">
</div>
</div>
<div class="weui-cell weui-cell_active">
<div class="weui-cell__hd"><label for="js_input1" class="weui-label">验证码</label></div>
<div class="weui-cell__bd">
<input id="input-captcha" class="weui-input weui-cell__control" type="number" pattern="[0-9]*" placeholder="请输入验证码" value="">
</div>
<div class="weui-cell__ft">
<button id="captchaBtn" role="button" onclick="getCaptcha()" class="js_target weui-cell__control weui-btn weui-btn_default weui-vcode-btn weui-btn_loading">获取验证码</button>
</div>
</div>
</div>
</div>
</div>
<div class="weui-form__opr-area">
<!-- <button class="weui-btn weui-btn_primary" type="button" style="width: 184px" id="submitBtn" onclick="submit()"><i class="weui_icon_msg weui_icon_success"></i>确定</button>-->
<button disabled class="weui-btn weui-btn_primary" type="button" style="width: 184px" id="submitBtn" onclick="submit()"><i class="weui_icon_msg weui_icon_success"></i>确定</button>
</div>
</div>
<div role="alert" id="textToast" style="opacity:0;display: none;">
<div class="weui-mask_transparent"></div>
<div class="weui-toast weui-toast_text">
<p class="weui-toast__content">文字提示</p>
</div>
</div>
</div>
<script>
//ajax post请求获取接口数据
var ajaxPost = function (reqUrl, params, callback, async) {
var xhr = null;
if(window.XMLHttpRequest) {
xhr = new XMLHttpRequest();
} else if(window.ActiveXObject) {
xhr = new ActiveXObject("Microsoft.XMLHTTP");
}
if(!xhr) { return false;}
if (async && callback) {
xhr.addEventListener('readystatechange', function () {
if (xhr.readyState === 4 && xhr.status === 200) {
callback(JSON.parse(xhr.responseText));
}
});
}
xhr.open('post', reqUrl, async);
xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
var strArr = [];
for(var k in params) {
strArr.push(k + "=" + params[k]);
}
var data = strArr.join("&");
xhr.send(data);
if (!async) {
return xhr.responseText;
}
};
/**
* 获取手机号验证码
*/
function getCaptcha() {
let mobile = document.getElementById('input-mobile').value;
if (!mobile || !/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/.test(mobile)) {
topTips('请输入正确的手机号')
return
}
ajaxPost('<?= $host ?>' + '/wechat/bind-captcha', {
'mobile': document.getElementById('input-mobile').value,
'openid': document.getElementById('input-openid').value,
}, (e) => {
if (e.code === 200) {
topTips('验证码发送成功', 'success')
setTimer();
// 让确定按键可以点
document.getElementById('submitBtn').attributes.removeNamedItem('disabled')
// 发验证码了就不让改手机号
document.getElementById('input-mobile').attributes.setNamedItem(document.createAttribute('disabled'))
} else {
topTips(e.msg)
}
}, true)
}
// 计时器句柄
let timerHandler = 0;
// 发送验证码速率
let totalTimer = 60;
function setTimer() {
const el = document.getElementById('captchaBtn');
let attr = document.createAttribute('disabled')
el.attributes.setNamedItem(attr)
if (timerHandler) {
clearInterval(timerHandler)
totalTimer = 60
}
el.textContent = `获取验证码(${totalTimer}S)`;
timerHandler = setInterval(() => {
totalTimer--;
el.textContent = `获取验证码(${totalTimer}S)`;
if (totalTimer === 0) {
clearInterval(timerHandler)
el.textContent = `获取验证码`;
el.attributes.removeNamedItem('disabled')
}
}, 1000)
}
function submit() {
document.getElementById('submitBtn').attributes.setNamedItem(document.createAttribute('disabled'))
ajaxPost('<?= $host ?>' + '/wechat/bind-submit', {
'mobile': document.getElementById('input-mobile').value,
'captcha': document.getElementById('input-captcha').value,
'openid': document.getElementById('input-openid').value,
}, (e) => {
if (e.code === 200) {
alert('绑定成功');
WeixinJSBridge.call('closeWindow');
} else {
topTips(e.msg)
}
document.getElementById('submitBtn').attributes.removeNamedItem('disabled')
}, true)
}
</script>