save
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
use support\Request;
|
||||
use support\Redis;
|
||||
use support\Db;
|
||||
|
||||
class Account
|
||||
{
|
||||
public function loginCallback(Request $request)
|
||||
{
|
||||
$rd=$request->input('rd','null');
|
||||
$sum=$request->input('sum','null');
|
||||
$uid=$request->input('id','null');
|
||||
if($rd=='null'||$sum=='null'||$sum!=md5($rd.$uid.getenv('aeskey'))){
|
||||
return view('404');
|
||||
}
|
||||
$session = $request->session();
|
||||
$session->set('ACCOUNT_CALLBACK_rd', $rd);
|
||||
$session->set('ACCOUNT', $uid);
|
||||
$user = Db::table('User')->where('ID', $uid)->first();
|
||||
$requireFields = array();
|
||||
$i=0;
|
||||
foreach($user as $key=>$value){
|
||||
if(in_array($key, ['name','sex','email','phone','address','sfz','birthday','avatar','realname'])&&($value==null||$value==''||$value=='null')){
|
||||
array_push($requireFields,$key);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
if($i>0){
|
||||
return view('account/extend', ['userid'=>$user->ID,'username'=>$user->name,'requireFields'=>$requireFields]);
|
||||
}else{
|
||||
$session->set('ACCOUNT_ve', 1);
|
||||
$session->forget(['ACCOUNT_CALLBACK_rd']);
|
||||
return redirect($rd);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function view(Request $request)
|
||||
{
|
||||
return view('index/view', ['name' => 'webman']);
|
||||
}
|
||||
|
||||
public function json(Request $request)
|
||||
{
|
||||
return json(['code' => 0, 'msg' => 'ok']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -18,7 +18,8 @@ class LayAuth
|
||||
}
|
||||
$app=$appquery->first();
|
||||
$provider= Db::table('Provider')->where('ID', $app->provider)->first();
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider]);
|
||||
$redirecturl='https://'.getenv('weburl').'/auth/lay/'.$appid.'/callback';
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'redirecturl'=>$redirecturl]);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,11 +31,12 @@ class LayAuth
|
||||
}
|
||||
$app=$appquery->first();
|
||||
$provider= Db::table('Provider')->where('ID', $app->provider)->first();
|
||||
$redirecturl='https://'.getenv('weburl').'/auth/lay/'.$appid.'/callback';
|
||||
switch ($gateway) {
|
||||
case "qywx":
|
||||
$code = $request->input('code','null');
|
||||
if($code=='null'){
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效']);
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
$tokenfile=base_path().'/token/qywx/innerQYWX.token';
|
||||
if(file_exists($tokenfile)){
|
||||
@@ -59,7 +61,7 @@ class LayAuth
|
||||
}
|
||||
$lookup= Http::get('https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token='.$fulltoken.'&code='.$code)->json();
|
||||
if($lookup->errcode!=0){
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效']);
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效','redirecturl'=>$redirecturl]);
|
||||
}else{
|
||||
$userid=$lookup->userid;
|
||||
$userinfo=Http::get('https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token='.$fulltoken.'&userid='.$userid)->json();
|
||||
@@ -74,10 +76,10 @@ class LayAuth
|
||||
}
|
||||
break;
|
||||
default:
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'验证方式无效或不存在']);
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'验证方式无效或不存在','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'验证方式无效或不存在']);
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'验证方式无效或不存在','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
|
||||
public function check(Request $request,$appid)
|
||||
|
||||
@@ -25,9 +25,76 @@ class OAuth
|
||||
if($redirect=='null'){
|
||||
$redirect=$app->redirect;
|
||||
}
|
||||
return redirect($redirect.'?code=123456&state='.$request->get('state',''));
|
||||
$scope=$request->get('scope','openid');
|
||||
$scope=explode("+",$scope);
|
||||
$allow_scope=json_decode($app->scope,true);
|
||||
$scope=array_intersect($scope,$allow_scope);
|
||||
$session = $request->session();
|
||||
$session->set($appid.'_oauth_redirect', $redirect);
|
||||
$session->set($appid.'_oauth_scope', $scope);
|
||||
|
||||
$redirecturl='https://'.getenv('weburl').'/auth/oauth/back/'.$appid;
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'redirecturl'=>$redirecturl]);
|
||||
|
||||
#return redirect($redirect.'?code=123456&state='.$request->get('state',''));
|
||||
#return view('auth', ['app'=>$app,'provider'=>$provider]);
|
||||
}
|
||||
public function callback(Request $request,$appid,$gateway)
|
||||
{
|
||||
$appquery= Db::table('App')->where('oauthid', $appid);
|
||||
if($appquery->doesntExist()){
|
||||
return view('404');
|
||||
}
|
||||
$app=$appquery->first();
|
||||
$provider= Db::table('Provider')->where('ID', $app->provider)->first();
|
||||
$redirecturl='https://'.getenv('weburl').'/auth/oauth/back/'.$appid;
|
||||
|
||||
switch ($gateway) {
|
||||
case "qywx":
|
||||
$code = $request->input('code','null');
|
||||
if($code=='null'){
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
$tokenfile=base_path().'/token/qywx/innerQYWX.token';
|
||||
if(file_exists($tokenfile)){
|
||||
$tokencontent=json_decode(file_get_contents($tokenfile));
|
||||
$fulltoken=$tokencontent->token;
|
||||
$ddl=$tokencontent->ddl;
|
||||
if($ddl-time()<180){
|
||||
$reapply=true;
|
||||
}else{
|
||||
$reapply=false;
|
||||
}
|
||||
}else{
|
||||
$reapply=true;
|
||||
}
|
||||
if($reapply==true){
|
||||
$apply=$response = Http::get('https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid='.getenv('appid').'&corpsecret='.getenv('token'))->json();
|
||||
$fulltoken=$apply->access_token;
|
||||
$ddl=time()+$apply->expires_in;
|
||||
$file=fopen($tokenfile,"w");
|
||||
fwrite($file, json_encode(array('token'=>$fulltoken,'ddl'=>$ddl)));
|
||||
fclose($file);
|
||||
}
|
||||
$lookup= Http::get('https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token='.$fulltoken.'&code='.$code)->json();
|
||||
if($lookup->errcode!=0){
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'登陆信息无效','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
$userid=$lookup->userid;
|
||||
$userinfo=Http::get('https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token='.$fulltoken.'&userid='.$userid)->json();
|
||||
$username=$userinfo->name;
|
||||
$userposition=$userinfo->position;
|
||||
$WT=json_encode(['id'=>$userid,'name'=>$username,'position'=>$userposition,'time'=>time()]);
|
||||
$key = getenv('aeskey');
|
||||
$iv = getenv('aesiv');
|
||||
$WT = encryptAES($WT, $key, $iv);
|
||||
$dest=$app->redirect;
|
||||
return view('success', ['app'=>$app,'provider'=>$provider,'dest'=>$dest,'userinfo'=>$userinfo])->cookie('WT', $WT,time()+9600,'/','.laysense.cn');
|
||||
break;
|
||||
default:
|
||||
return view('auth', ['app'=>$app,'provider'=>$provider,'special'=>'验证方式无效或不存在','redirecturl'=>$redirecturl]);
|
||||
}
|
||||
}
|
||||
|
||||
public function configfile(Request $request)
|
||||
{
|
||||
@@ -40,11 +107,11 @@ class OAuth
|
||||
"response_types_supported" => ["code"],
|
||||
"subject_types_supported" => ["public"],
|
||||
"id_token_signing_alg_values_supported" => ["RS256"],
|
||||
"scopes_supported" => ["openid", "profile", "email", "phone"],
|
||||
"scopes_supported" => ["openid", "profile", "email", "phone", "avatar","basic","detail","everything"],
|
||||
"token_endpoint_auth_methods_supported" => ["client_secret_basic"],
|
||||
"claims_supported" => ["sub", "iss", "name", "email", "phone"],
|
||||
"claims_supported" => ["sub", "iss", "name", "email", "phone","LaysenseRole","avatar","phone","address","age","sex","birthday"],
|
||||
"code_challenge_methods_supported" => ["plain", "S256"],
|
||||
"grant_types_supported" => ["authorization_code", "refresh_token"],
|
||||
"grant_types_supported" => ["authorization_code"],
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -58,7 +125,6 @@ class OAuth
|
||||
'iat' => time(),
|
||||
'nbf' => time()+7200,
|
||||
'exp' => time()+7200,
|
||||
'LaysenseRole' => 'Member',
|
||||
];
|
||||
$jwt = JWT::encode($payload, $key, 'HS256');
|
||||
|
||||
@@ -78,6 +144,7 @@ class OAuth
|
||||
{
|
||||
return json([
|
||||
"sub" => 'ywnsya',
|
||||
'iss' => 'https://auth.laysense.cn/',
|
||||
"name" => 'LaySense',
|
||||
"email" => 'ywnsya@126.com',
|
||||
"phone" => '18018526850',
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
<?php
|
||||
|
||||
namespace app\controller;
|
||||
|
||||
use support\Request;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
use support\Redis;
|
||||
use support\Db;
|
||||
use tekintian\TekinQR;
|
||||
use yzh52521\EasyHttp\Http;
|
||||
use yzh52521\EasyHttp\Response;
|
||||
use yzh52521\EasyHttp\RequestException;
|
||||
|
||||
class QywxOauth
|
||||
{
|
||||
public function index(Request $request)
|
||||
{
|
||||
$rd=$request->input('rd','null');
|
||||
$sum=$request->input('sum','null');
|
||||
|
||||
if($rd=='null'||$sum=='null'||$sum!=md5($rd.getenv('aeskey'))){
|
||||
return view('404');
|
||||
}
|
||||
$session = $request->session();
|
||||
$session->set('QYWX_OAUTH_rd', $rd);
|
||||
$app=$request->header('X-Requested-With','null');
|
||||
if($app=='com.tencent.wework'){
|
||||
$redirecturl='https://'.getenv('weburl').'/qywxoauth/info';
|
||||
$url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".getenv('appid')."&redirect_uri=".$redirecturl."&response_type=code&scope=snsapi_privateinfo&state=STATE&agentid=".getenv('agentid')."#wechat_redirect";
|
||||
return redirect($url);
|
||||
}
|
||||
$uuid = Uuid::uuid7()->toString();
|
||||
Redis::set($uuid, 'null');
|
||||
Redis::expire($uuid, 300);
|
||||
|
||||
$redirecturl='https://'.getenv('weburl').'/qywxoauth/answer/'.$uuid;
|
||||
$url="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".getenv('appid')."&redirect_uri=".$redirecturl."&response_type=code&scope=snsapi_privateinfo&state=STATE&agentid=".getenv('agentid')."#wechat_redirect";
|
||||
$qr = TekinQR::getQRImg($url, 10, base_path().'/public/qywx.png', 1);
|
||||
|
||||
return view('qywx/wait', ['url'=>$url,'uuid'=>$uuid,'qr'=>$qr,'to'=>'https://'.getenv('weburl').'/qywxoauth/info']);
|
||||
}
|
||||
|
||||
public function answer(Request $request,$uuid)
|
||||
{
|
||||
if($uuid=='null'||!Uuid::isValid($uuid)){
|
||||
return view('404');
|
||||
}
|
||||
if(!Redis::exists($uuid)){
|
||||
return view('qywx/expire');
|
||||
}
|
||||
$code=$request->input('code','null');
|
||||
if($code=='null'){
|
||||
return view('404');
|
||||
}
|
||||
Redis::set($uuid, $code);
|
||||
Redis::expire($uuid, 10);
|
||||
|
||||
return view('qywx/success');
|
||||
}
|
||||
|
||||
public function ask(Request $request,$uuid)
|
||||
{
|
||||
if($uuid=='null'||!Uuid::isValid($uuid)){
|
||||
return json(['code' => 501, 'msg' => 'invaild uuid']);
|
||||
}
|
||||
if(!Redis::exists($uuid)){
|
||||
return json(['code' => 500, 'msg' => 'UUID expired']);
|
||||
}
|
||||
for($i=0;$i<150;$i++){
|
||||
if(!Redis::exists($uuid)){
|
||||
return json(['code' => 500, 'msg' => 'UUID expired']);
|
||||
}
|
||||
if(Redis::get($uuid)!='null'){
|
||||
return json(['code' => 200, 'msg' => 'ok','rcode'=>Redis::get($uuid)]);
|
||||
break;
|
||||
}
|
||||
sleep(2);
|
||||
}
|
||||
return json(['code' => 503, 'msg' => 'TimeOut']);
|
||||
/**
|
||||
$code=Redis::get($uuid);
|
||||
if($code=='null'){
|
||||
return json(['code' => 201, 'msg' => 'wait for answer']);
|
||||
}
|
||||
return json(['code' => 200, 'msg' => 'ok','code'=>$code]);
|
||||
**/
|
||||
}
|
||||
public function info(Request $request)
|
||||
{
|
||||
$code=$request->input('code','null');
|
||||
if($code=='null'){
|
||||
return view('404');
|
||||
}
|
||||
$tokenfile=base_path().'/token/qywx/innerQYWX.token';
|
||||
if(file_exists($tokenfile)){
|
||||
$tokencontent=json_decode(file_get_contents($tokenfile));
|
||||
$fulltoken=$tokencontent->token;
|
||||
$ddl=$tokencontent->ddl;
|
||||
if($ddl-time()<180){
|
||||
$reapply=true;
|
||||
}else{
|
||||
$reapply=false;
|
||||
}
|
||||
}else{
|
||||
$reapply=true;
|
||||
}
|
||||
if($reapply==true){
|
||||
$apply=$response = Http::get('https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid='.getenv('appid').'&corpsecret='.getenv('token'))->json();
|
||||
$fulltoken=$apply->access_token;
|
||||
$ddl=time()+$apply->expires_in;
|
||||
$file=fopen($tokenfile,"w");
|
||||
fwrite($file, json_encode(array('token'=>$fulltoken,'ddl'=>$ddl)));
|
||||
fclose($file);
|
||||
}
|
||||
$lookup= Http::get('https://qyapi.weixin.qq.com/cgi-bin/auth/getuserinfo?access_token='.$fulltoken.'&code='.$code)->json();
|
||||
if($lookup->errcode!=0){
|
||||
return view('404');
|
||||
}
|
||||
$userid=$lookup->userid;
|
||||
$usertoken=$lookup->user_ticket;
|
||||
$userinfo=Http::asJson()->post('https://qyapi.weixin.qq.com/cgi-bin/auth/getuserdetail?access_token='.$fulltoken,['user_ticket' => "$usertoken"])->json();
|
||||
$userbasic=Http::get('https://qyapi.weixin.qq.com/cgi-bin/user/get?access_token='.$fulltoken.'&userid='.$userid)->json();
|
||||
if($userinfo->errcode!=0 || $userbasic->errcode!=0){
|
||||
return view('404');
|
||||
}
|
||||
$userinfo->name=$userbasic->name;
|
||||
$userinfo->postion=$userbasic->position;
|
||||
$userinfo->id=$userinfo->userid;
|
||||
if($userinfo->email==''||$userinfo->biz_mail==''){
|
||||
$mail=$userinfo->email.$userinfo->biz_mail;
|
||||
$userinfo->email=$mail;
|
||||
$userinfo->biz_mail=$mail;
|
||||
}
|
||||
Db::table('User')
|
||||
->updateOrInsert(
|
||||
['ID' => $userid.'@laysense'],
|
||||
['public' => 0,'name' => $userinfo->name,'sex'=>$userinfo->gender,'position' => $userinfo->postion,'avatar' => $userinfo->avatar,'email' => $userinfo->email,'phone' => $userinfo->mobile,'biz_mail'=>$userinfo->biz_mail,'address'=>$userinfo->address,'role'=>1]
|
||||
);
|
||||
$session = $request->session();
|
||||
$rd=$session->get('QYWX_OAUTH_rd','null');
|
||||
if($rd=='null'){
|
||||
return view('404');
|
||||
}
|
||||
$sum=md5($rd.$userid.'@laysense'.getenv('aeskey'));
|
||||
$session->forget(['QYWX_OAUTH_rd']);
|
||||
|
||||
|
||||
return redirect('/account/loginCallback?rd='.$rd.'&sum='.$sum.'&id='.$userid.'@laysense');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,211 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
<!-- Required Meta Tags Always Come First -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Laysense Auth">
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<title>Laysense Auth</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="https://static.laysense.cn/data/file/_4335ce.png?1709117691655">
|
||||
|
||||
<!-- Font -->
|
||||
|
||||
<!-- Theme Check and Update -->
|
||||
<script>
|
||||
const html = document.querySelector('html');
|
||||
const isLightOrAuto = localStorage.getItem('hs_theme') === 'light' || (localStorage.getItem('hs_theme') === 'auto' && !window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
const isDarkOrAuto = localStorage.getItem('hs_theme') === 'dark' || (localStorage.getItem('hs_theme') === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
|
||||
if (isLightOrAuto && html.classList.contains('dark')) html.classList.remove('dark');
|
||||
else if (isDarkOrAuto && html.classList.contains('light')) html.classList.remove('light');
|
||||
else if (isDarkOrAuto && !html.classList.contains('dark')) html.classList.add('dark');
|
||||
else if (isLightOrAuto && !html.classList.contains('light')) html.classList.add('light');
|
||||
</script>
|
||||
|
||||
<!-- CSS HS -->
|
||||
<link rel="stylesheet" href="https://static.laysense.cn/data/file/cdn/preline.css">
|
||||
</head>
|
||||
|
||||
<body class="dark:bg-neutral-900">
|
||||
<!-- ========== MAIN CONTENT ========== -->
|
||||
<main id="content">
|
||||
<div class="max-w-[85rem] px-4 py-10 sm:px-6 lg:px-8 lg:py-14 mx-auto">
|
||||
<div class="max-w-xl mx-auto">
|
||||
<div class="text-center">
|
||||
<h1 class="text-3xl font-bold text-gray-800 sm:text-4xl dark:text-white">
|
||||
<?php echo($username);?>,欢迎来到来笙~!🥳
|
||||
</h1>
|
||||
<p class="mt-1 text-gray-600 dark:text-neutral-400">
|
||||
您还需要补充下述信息,以便我们为您提供更好的服务。您的隐私信息将被严格加密储存,并严格限制第三方应用的读取。
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="mt-12">
|
||||
<!-- Form -->
|
||||
<form>
|
||||
<div class="grid gap-4 lg:gap-6">
|
||||
|
||||
<?php
|
||||
foreach($requireFields as $field){
|
||||
switch ($field) {
|
||||
case 'name':
|
||||
echo '<div>
|
||||
<label for="name" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">用户名</label>
|
||||
<input type="text" id="name" name="name" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
case 'sex':
|
||||
echo ' <label class="block text-sm text-gray-700 font-medium dark:text-white">性别</label>
|
||||
<div class="grid sm:grid-cols-2 gap-2">
|
||||
<label for="hs-radio-in-form" class="flex p-3 w-full bg-white border border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400">
|
||||
<input type="radio" name="hs-radio-in-form" class="shrink-0 mt-0.5 border-gray-200 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800" id="hs-radio-in-form">
|
||||
<span class="text-sm text-gray-500 ms-3 dark:text-neutral-400">先生</span>
|
||||
</label>
|
||||
<label for="hs-radio-checked-in-form" class="flex p-3 w-full bg-white border border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400">
|
||||
<input type="radio" name="hs-radio-in-form" class="shrink-0 mt-0.5 border-gray-200 rounded-full text-blue-600 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800" id="hs-radio-checked-in-form" checked="">
|
||||
<span class="text-sm text-gray-500 ms-3 dark:text-neutral-400">女士</span>
|
||||
</label>
|
||||
</div>';
|
||||
break;
|
||||
case 'email':
|
||||
echo '<div>
|
||||
<label for="email" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">邮箱</label>
|
||||
<input type="email" name="hs-work-email-hire-us-2" id="hs-work-email-hire-us-2" autocomplete="email" id="email" name="email" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
case 'phone':
|
||||
echo '<div>
|
||||
<label for="phone" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">手机号(仅支持中国大陆,无需填写+86)</label>
|
||||
<input type="number" id="phone" name="phone" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
case 'address':
|
||||
echo '<div>
|
||||
<label for="address" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">地址(您参与活动的奖品、来笙硬件、来笙活动邀请函可能会邮寄到此地址)</label>
|
||||
<div data-toggle="distpicker" data-autoselect="3" data-province="浙江省" class="grid grid-cols-1 sm:grid-cols-3 gap-4 mb-2">
|
||||
<select name="province" class="py-3 px-4 pe-9 block border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600"></select>
|
||||
<select name="city" class="py-3 px-4 pe-9 block border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600"></select>
|
||||
<select name="area" class="py-3 px-4 pe-9 block border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600"></select>
|
||||
</div>
|
||||
<input type="text" id="address" name="address" placeholder="详细地址" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
|
||||
</div>';
|
||||
break;
|
||||
case 'birthday':
|
||||
echo '<div>
|
||||
<label for="birthday" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">您的生日</label>
|
||||
<input type="date" id="birthday" name="birthday" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
case 'avatar':
|
||||
echo '<div>
|
||||
<label class="block">
|
||||
<label for="birthday" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">给您设置一个美美的头像叭</label>
|
||||
<!--span class="sr-only">Choose profile photo</span-->
|
||||
<input type="file" name="avatar" id="avatar" class="block w-full text-sm text-gray-500
|
||||
file:me-4 file:py-2 file:px-4
|
||||
file:rounded-lg file:border-0
|
||||
file:text-sm file:font-semibold
|
||||
file:bg-blue-600 file:text-white
|
||||
hover:file:bg-blue-700
|
||||
file:disabled:opacity-50 file:disabled:pointer-events-none
|
||||
dark:text-neutral-500
|
||||
dark:file:bg-blue-500
|
||||
dark:hover:file:bg-blue-400
|
||||
">
|
||||
</label>
|
||||
<div class="shrink-0 group block">
|
||||
<div class="flex items-center">
|
||||
<img id="avatarpreview" class="inline-block shrink-0 size-[62px] rounded-full" src="/laysenseLogo.jpg" alt="Avatar">
|
||||
<div class="ms-3">
|
||||
<h3 class="font-semibold text-gray-800 dark:text-white">'.$username.'</h3>
|
||||
<p class="text-sm font-medium text-gray-400 dark:text-neutral-500">来笙新用户</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>';
|
||||
break;
|
||||
case 'sfz':
|
||||
echo '<div>
|
||||
<label for="sfz" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">中国大陆身份证号</label>
|
||||
<input type="text" name="sfz" id="sfz" autocomplete="email" id="email" name="email" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
case 'realname':
|
||||
echo '<div>
|
||||
<label for="sfz" class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">真实姓名</label>
|
||||
<input type="text" name="sfz" id="sfz" autocomplete="email" id="email" name="email" class="py-3 px-4 block w-full border-gray-200 rounded-lg text-sm focus:border-blue-500 focus:ring-blue-500 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-400 dark:placeholder-neutral-500 dark:focus:ring-neutral-600">
|
||||
</div>';
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- Checkbox -->
|
||||
<div class="mt-3 flex border-gray-200">
|
||||
<div class="flex">
|
||||
<input id="remember-me" name="remember-me" type="checkbox" class="shrink-0 mt-1.5 border-gray-800 rounded text-blue-600 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800">
|
||||
</div>
|
||||
<div class="ms-3">
|
||||
<label for="remember-me" class=" text-sm text-gray-600 dark:text-neutral-400">您已了解并同意来笙<a class="text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline font-medium dark:text-blue-500" href="#">隐私条款</a>,同意来笙安全地处理和储存您的个人信息,并在您同意和授权的前提下安全地提供给第三方应用使用。</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Checkbox -->
|
||||
|
||||
<div class="mt-6 grid">
|
||||
<button type="submit" class="w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-blue-600 text-white hover:bg-blue-700 focus:outline-none focus:bg-blue-700 disabled:opacity-50 disabled:pointer-events-none">完善信息</button>
|
||||
</div>
|
||||
|
||||
<div class="mt-3 text-center">
|
||||
<p class="text-sm text-gray-500 dark:text-neutral-500">
|
||||
您的信息将被加密处理和储存,来笙不会保存您的身份证号等敏感内容。<br />仅限中国大陆用户使用,国际用户请咨询 admin@laysense.com
|
||||
</p>
|
||||
</div>
|
||||
</form>
|
||||
<!-- End Form -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-3 flex justify-center items-center text-center divide-x divide-gray-300 dark:divide-neutral-700">
|
||||
©上海来笙信息科技有限公司 2024 </p>
|
||||
|
||||
|
||||
</main>
|
||||
<!-- ========== END MAIN CONTENT ========== -->
|
||||
|
||||
<!-- JS Implementing Plugins -->
|
||||
|
||||
<!-- JS PLUGINS -->
|
||||
<!-- Required plugins -->
|
||||
<script src="https://static.laysense.cn/data/file/cdn/preline.js"></script>
|
||||
<script src="/jquery.js"></script>
|
||||
<script src="/distpicker.js"></script>
|
||||
<script>
|
||||
|
||||
document.querySelector('#avatar').onchange = function (){
|
||||
if(this.files.length){
|
||||
let file = this.files[0];
|
||||
let reader = new FileReader();
|
||||
//新建 FileReader 对象
|
||||
reader.onload = function(){
|
||||
// 当 FileReader 读取文件时候,读取的结果会放在 FileReader.result 属性中
|
||||
document.querySelector('#avatarpreview').src = this.result;
|
||||
};
|
||||
// 设置以什么方式读取文件,这里以base64方式
|
||||
reader.readAsDataURL(file);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- JS THIRD PARTY PLUGINS -->
|
||||
</body>
|
||||
</html>
|
||||
+6
-3
@@ -1,4 +1,4 @@
|
||||
<?php if(!isset($special)){ $special=false;}?>
|
||||
<?php if(!isset($special)||$special==''){ $special='false';}?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
@@ -86,11 +86,14 @@
|
||||
<div class="py-3 flex items-center text-xs text-gray-400 uppercase before:flex-1 before:border-t before:border-gray-200 before:me-6 after:flex-1 after:border-t after:border-gray-200 after:ms-6 dark:text-neutral-500 dark:before:border-neutral-600 dark:after:border-neutral-600">来笙内部登录</div>
|
||||
|
||||
<div >
|
||||
<a href="https://login.work.weixin.qq.com/wwlogin/sso/login?login_type=CorpApp&appid=<?php echo(getenv('appid'));?>&agentid=<?php echo(getenv('agentid'));?>&redirect_uri=https://<?php echo(getenv('weburl'));?>/auth/lay/<?php echo($app->ID);?>/qywx/callback" class=" mb-4 w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-teal-100 text-teal-800 hover:bg-teal-200 focus:outline-none focus:bg-teal-200 disabled:opacity-50 disabled:pointer-events-none dark:text-teal-500 dark:bg-teal-800/30 dark:hover:bg-teal-800/20 dark:focus:bg-teal-800/20">
|
||||
<!--a href="https://login.work.weixin.qq.com/wwlogin/sso/login?login_type=CorpApp&appid=<?php echo(getenv('appid'));?>&agentid=<?php echo(getenv('agentid'));?>&redirect_uri=<?php echo($redirecturl);?>/qywx/callback" class=" mb-4 w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-teal-100 text-teal-800 hover:bg-teal-200 focus:outline-none focus:bg-teal-200 disabled:opacity-50 disabled:pointer-events-none dark:text-teal-500 dark:bg-teal-800/30 dark:hover:bg-teal-800/20 dark:focus:bg-teal-800/20">
|
||||
<svg t="1722953611732" class="icon" viewBox="0 0 1229 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4326" width="24" height="24"><path d="M702.72 849.92c-76.8 30.72-158.72 35.84-240.64 30.72-35.84-5.12-71.68-10.24-107.52-20.48-5.12 0-10.24 0-15.36 5.12-46.08 20.48-92.16 46.08-133.12 66.56-15.36 10.24-30.72 10.24-46.08 0s-15.36-25.6-15.36-46.08c10.24-35.84 10.24-71.68 15.36-107.52 0-5.12-5.12-10.24-5.12-15.36-51.2-51.2-92.16-102.4-122.88-168.96-51.2-122.88-40.96-245.76 30.72-358.4C134.4 112.64 247.04 46.08 380.16 15.36S641.28 0 764.16 61.44c112.64 56.32 194.56 143.36 230.4 266.24 15.36 46.08 20.48 92.16 15.36 138.24-25.6-25.6-56.32-30.72-87.04-15.36 0-30.72 0-61.44-10.24-92.16-20.48-71.68-61.44-128-112.64-174.08-87.04-71.68-194.56-102.4-307.2-102.4-117.76 10.24-220.16 51.2-302.08 133.12-66.56 66.56-102.4 148.48-97.28 245.76 5.12 81.92 40.96 148.48 92.16 204.8l40.96 40.96c20.48 15.36 25.6 30.72 15.36 51.2-5.12 20.48-10.24 46.08-15.36 66.56 0 5.12-5.12 10.24 0 10.24 5.12 5.12 10.24 0 10.24 0 25.6-15.36 56.32-30.72 81.92-51.2 15.36-10.24 30.72-10.24 51.2-5.12 87.04 25.6 179.2 25.6 266.24 0 5.12 0 10.24-5.12 10.24 5.12 10.24 30.72 25.6 51.2 56.32 66.56z" fill="#0082EF" p-id="4327"></path><path d="M1214.72 747.52c0 35.84-25.6 61.44-56.32 66.56-51.2 10.24-92.16 30.72-128 66.56-10.24 10.24-15.36 10.24-25.6 5.12-5.12-5.12-5.12-15.36 0-25.6 35.84-35.84 56.32-81.92 66.56-128 5.12-35.84 40.96-56.32 76.8-56.32 40.96 5.12 66.56 35.84 66.56 71.68z" fill="#0081EE" p-id="4328"></path><path d="M953.6 1024c-35.84 0-66.56-25.6-71.68-56.32-5.12-51.2-30.72-92.16-66.56-122.88-5.12-5.12-10.24-10.24-5.12-20.48 5.12-15.36 15.36-15.36 25.6-10.24 10.24 5.12 15.36 15.36 20.48 20.48 30.72 25.6 66.56 40.96 102.4 46.08 35.84 5.12 61.44 40.96 56.32 76.8 5.12 35.84-25.6 66.56-61.44 66.56z" fill="#FA6202" p-id="4329"></path><path d="M682.24 757.76c0-35.84 20.48-61.44 56.32-71.68 51.2-10.24 92.16-30.72 128-66.56 10.24-10.24 20.48-10.24 25.6 0 5.12 5.12 5.12 15.36-5.12 25.6-30.72 30.72-51.2 66.56-61.44 112.64 0 5.12 0 15.36-5.12 20.48-10.24 35.84-40.96 56.32-76.8 51.2-35.84-5.12-61.44-35.84-61.44-71.68z" fill="#FECD00" p-id="4330"></path><path d="M1035.52 578.56c15.36 30.72 30.72 56.32 51.2 76.8 10.24 10.24 10.24 20.48 5.12 25.6-5.12 10.24-15.36 10.24-25.6 0-25.6-30.72-61.44-51.2-97.28-61.44-10.24-5.12-20.48-5.12-30.72-5.12-20.48-5.12-40.96-15.36-46.08-40.96-10.24-25.6-10.24-51.2 10.24-71.68 20.48-25.6 46.08-30.72 71.68-25.6 25.6 10.24 46.08 25.6 51.2 56.32 0 15.36 5.12 30.72 10.24 46.08z" fill="#2CBD00" p-id="4331"></path></svg>
|
||||
企业微信登录
|
||||
</a-->
|
||||
<a href="/qywxoauth/?rd=<?php echo($redirecturl);?>&sum=<?php echo(md5($redirecturl.getenv('aeskey')));?>" class=" mb-4 w-full py-3 px-4 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-teal-100 text-teal-800 hover:bg-teal-200 focus:outline-none focus:bg-teal-200 disabled:opacity-50 disabled:pointer-events-none dark:text-teal-500 dark:bg-teal-800/30 dark:hover:bg-teal-800/20 dark:focus:bg-teal-800/20">
|
||||
<svg t="1722953611732" class="icon" viewBox="0 0 1229 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4326" width="24" height="24"><path d="M702.72 849.92c-76.8 30.72-158.72 35.84-240.64 30.72-35.84-5.12-71.68-10.24-107.52-20.48-5.12 0-10.24 0-15.36 5.12-46.08 20.48-92.16 46.08-133.12 66.56-15.36 10.24-30.72 10.24-46.08 0s-15.36-25.6-15.36-46.08c10.24-35.84 10.24-71.68 15.36-107.52 0-5.12-5.12-10.24-5.12-15.36-51.2-51.2-92.16-102.4-122.88-168.96-51.2-122.88-40.96-245.76 30.72-358.4C134.4 112.64 247.04 46.08 380.16 15.36S641.28 0 764.16 61.44c112.64 56.32 194.56 143.36 230.4 266.24 15.36 46.08 20.48 92.16 15.36 138.24-25.6-25.6-56.32-30.72-87.04-15.36 0-30.72 0-61.44-10.24-92.16-20.48-71.68-61.44-128-112.64-174.08-87.04-71.68-194.56-102.4-307.2-102.4-117.76 10.24-220.16 51.2-302.08 133.12-66.56 66.56-102.4 148.48-97.28 245.76 5.12 81.92 40.96 148.48 92.16 204.8l40.96 40.96c20.48 15.36 25.6 30.72 15.36 51.2-5.12 20.48-10.24 46.08-15.36 66.56 0 5.12-5.12 10.24 0 10.24 5.12 5.12 10.24 0 10.24 0 25.6-15.36 56.32-30.72 81.92-51.2 15.36-10.24 30.72-10.24 51.2-5.12 87.04 25.6 179.2 25.6 266.24 0 5.12 0 10.24-5.12 10.24 5.12 10.24 30.72 25.6 51.2 56.32 66.56z" fill="#0082EF" p-id="4327"></path><path d="M1214.72 747.52c0 35.84-25.6 61.44-56.32 66.56-51.2 10.24-92.16 30.72-128 66.56-10.24 10.24-15.36 10.24-25.6 5.12-5.12-5.12-5.12-15.36 0-25.6 35.84-35.84 56.32-81.92 66.56-128 5.12-35.84 40.96-56.32 76.8-56.32 40.96 5.12 66.56 35.84 66.56 71.68z" fill="#0081EE" p-id="4328"></path><path d="M953.6 1024c-35.84 0-66.56-25.6-71.68-56.32-5.12-51.2-30.72-92.16-66.56-122.88-5.12-5.12-10.24-10.24-5.12-20.48 5.12-15.36 15.36-15.36 25.6-10.24 10.24 5.12 15.36 15.36 20.48 20.48 30.72 25.6 66.56 40.96 102.4 46.08 35.84 5.12 61.44 40.96 56.32 76.8 5.12 35.84-25.6 66.56-61.44 66.56z" fill="#FA6202" p-id="4329"></path><path d="M682.24 757.76c0-35.84 20.48-61.44 56.32-71.68 51.2-10.24 92.16-30.72 128-66.56 10.24-10.24 20.48-10.24 25.6 0 5.12 5.12 5.12 15.36-5.12 25.6-30.72 30.72-51.2 66.56-61.44 112.64 0 5.12 0 15.36-5.12 20.48-10.24 35.84-40.96 56.32-76.8 51.2-35.84-5.12-61.44-35.84-61.44-71.68z" fill="#FECD00" p-id="4330"></path><path d="M1035.52 578.56c15.36 30.72 30.72 56.32 51.2 76.8 10.24 10.24 10.24 20.48 5.12 25.6-5.12 10.24-15.36 10.24-25.6 0-25.6-30.72-61.44-51.2-97.28-61.44-10.24-5.12-20.48-5.12-30.72-5.12-20.48-5.12-40.96-15.36-46.08-40.96-10.24-25.6-10.24-51.2 10.24-71.68 20.48-25.6 46.08-30.72 71.68-25.6 25.6 10.24 46.08 25.6 51.2 56.32 0 15.36 5.12 30.72 10.24 46.08z" fill="#2CBD00" p-id="4331"></path></svg>
|
||||
企业微信登录
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
<!-- Required Meta Tags Always Come First -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Laysense Auth">
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<title>Laysense Auth</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="https://static.laysense.cn/data/file/_4335ce.png?1709117691655">
|
||||
|
||||
<!-- Font -->
|
||||
|
||||
<!-- Theme Check and Update -->
|
||||
<script>
|
||||
const html = document.querySelector('html');
|
||||
const isLightOrAuto = localStorage.getItem('hs_theme') === 'light' || (localStorage.getItem('hs_theme') === 'auto' && !window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
const isDarkOrAuto = localStorage.getItem('hs_theme') === 'dark' || (localStorage.getItem('hs_theme') === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
|
||||
if (isLightOrAuto && html.classList.contains('dark')) html.classList.remove('dark');
|
||||
else if (isDarkOrAuto && html.classList.contains('light')) html.classList.remove('light');
|
||||
else if (isDarkOrAuto && !html.classList.contains('dark')) html.classList.add('dark');
|
||||
else if (isLightOrAuto && !html.classList.contains('light')) html.classList.add('light');
|
||||
</script>
|
||||
|
||||
<!-- CSS HS -->
|
||||
<link rel="stylesheet" href="https://static.laysense.cn/data/file/cdn/preline.css">
|
||||
</head>
|
||||
|
||||
<body class="flex h-full items-center py-16 dark:bg-neutral-800" background="https://bing.img.run/1920x1080.php" style="background-size: 100% 100%;">
|
||||
<!-- ========== MAIN CONTENT ========== -->
|
||||
<main id="content" class="w-full max-w-md mx-auto p-6">
|
||||
|
||||
<div class="mt-7 border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-900 dark:border-neutral-700" style="background: rgba(255, 255, 255, 0.6);-webkit-backdrop-filter: blur(10px);backdrop-filter: blur(10px);">
|
||||
<div class="p-4 sm:p-7">
|
||||
<div class="text-center">
|
||||
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white" ><img src="https://static.laysense.cn/data/file/laysenseW.png" style="height:30px;" />应用授权请求被拒绝</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">
|
||||
抱歉,由于:<?php echo($app->reason);?>,该应用的授权请求已被拒绝,您可以:
|
||||
<a class="text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline font-medium dark:text-blue-500" href="https://laysense.cn/" target="_blank">
|
||||
前往来笙
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
<div class="py-3 flex items-center text-xs text-gray-400 uppercase before:flex-1 before:border-t before:border-gray-200 before:me-6 after:flex-1 after:border-t after:border-gray-200 after:ms-6 dark:text-neutral-500 dark:before:border-neutral-600 dark:after:border-neutral-600">请求授权的APP</div>
|
||||
|
||||
<div class="shrink-0 group block ">
|
||||
<div class="flex items-center">
|
||||
<img class="inline-block shrink-0 size-[62px] rounded-full" src="<?php echo($app->img);?>" alt="Avatar">
|
||||
<div class="ms-3">
|
||||
<h3 class="font-semibold text-gray-800 dark:text-white"><?php echo($app->name);?></h3>
|
||||
<p class="text-sm font-medium text-gray-400 dark:text-neutral-500"><?php echo($app->info);?></p>
|
||||
</div>
|
||||
</div>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400 text-center" >
|
||||
由
|
||||
<a class="text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline font-medium dark:text-blue-500" href="<?php echo($provider->url);?>" target="_blank">
|
||||
<?php echo($provider->name);?>
|
||||
</a>
|
||||
提供
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-3 flex justify-center items-center text-center divide-x divide-gray-300 dark:divide-neutral-700">
|
||||
©上海来笙信息科技有限公司 2024 </p>
|
||||
|
||||
</main>
|
||||
<!-- ========== END MAIN CONTENT ========== -->
|
||||
|
||||
<!-- JS Implementing Plugins -->
|
||||
|
||||
<!-- JS PLUGINS -->
|
||||
<!-- Required plugins -->
|
||||
<script src="https://static.laysense.cn/data/file/cdn/preline.js"></script>
|
||||
|
||||
<!-- JS THIRD PARTY PLUGINS -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
<!-- Required Meta Tags Always Come First -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Laysense Auth">
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<title>Laysense Auth</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="https://static.laysense.cn/data/file/_4335ce.png?1709117691655">
|
||||
|
||||
<!-- Font -->
|
||||
|
||||
<!-- Theme Check and Update -->
|
||||
<script>
|
||||
const html = document.querySelector('html');
|
||||
const isLightOrAuto = localStorage.getItem('hs_theme') === 'light' || (localStorage.getItem('hs_theme') === 'auto' && !window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
const isDarkOrAuto = localStorage.getItem('hs_theme') === 'dark' || (localStorage.getItem('hs_theme') === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
|
||||
if (isLightOrAuto && html.classList.contains('dark')) html.classList.remove('dark');
|
||||
else if (isDarkOrAuto && html.classList.contains('light')) html.classList.remove('light');
|
||||
else if (isDarkOrAuto && !html.classList.contains('dark')) html.classList.add('dark');
|
||||
else if (isLightOrAuto && !html.classList.contains('light')) html.classList.add('light');
|
||||
</script>
|
||||
|
||||
<!-- CSS HS -->
|
||||
<link rel="stylesheet" href="https://static.laysense.cn/data/file/cdn/preline.css">
|
||||
</head>
|
||||
|
||||
<body class="flex h-full items-center py-16 dark:bg-neutral-800" background="https://bing.img.run/1920x1080.php" style="background-size: 100% 100%;">
|
||||
<!-- ========== MAIN CONTENT ========== -->
|
||||
<main id="content" class="w-full max-w-md mx-auto p-6">
|
||||
|
||||
<div class="mt-7 border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-900 dark:border-neutral-700" style="background: rgba(255, 255, 255, 0.6);-webkit-backdrop-filter: blur(10px);backdrop-filter: blur(10px);">
|
||||
<div class="p-4 sm:p-7">
|
||||
<div class="text-center">
|
||||
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white" ><img src="https://static.laysense.cn/data/file/laysenseW.png" style="height:30px;" />登陆已过期</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">
|
||||
当前登录请求已失效,请回到原页面重试。
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<p class="mt-3 flex justify-center items-center text-center divide-x divide-gray-300 dark:divide-neutral-700">
|
||||
©上海来笙信息科技有限公司 2024 </p>
|
||||
|
||||
</main>
|
||||
<!-- ========== END MAIN CONTENT ========== -->
|
||||
|
||||
<!-- JS Implementing Plugins -->
|
||||
|
||||
<!-- JS PLUGINS -->
|
||||
<!-- Required plugins -->
|
||||
<script src="https://static.laysense.cn/data/file/cdn/preline.js"></script>
|
||||
|
||||
<!-- JS THIRD PARTY PLUGINS -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
<!-- Required Meta Tags Always Come First -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Laysense Auth">
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<title>Laysense Auth</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="https://static.laysense.cn/data/file/_4335ce.png?1709117691655">
|
||||
|
||||
<!-- Font -->
|
||||
|
||||
<!-- Theme Check and Update -->
|
||||
<script>
|
||||
const html = document.querySelector('html');
|
||||
const isLightOrAuto = localStorage.getItem('hs_theme') === 'light' || (localStorage.getItem('hs_theme') === 'auto' && !window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
const isDarkOrAuto = localStorage.getItem('hs_theme') === 'dark' || (localStorage.getItem('hs_theme') === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
|
||||
if (isLightOrAuto && html.classList.contains('dark')) html.classList.remove('dark');
|
||||
else if (isDarkOrAuto && html.classList.contains('light')) html.classList.remove('light');
|
||||
else if (isDarkOrAuto && !html.classList.contains('dark')) html.classList.add('dark');
|
||||
else if (isLightOrAuto && !html.classList.contains('light')) html.classList.add('light');
|
||||
</script>
|
||||
|
||||
<!-- CSS HS -->
|
||||
<link rel="stylesheet" href="https://static.laysense.cn/data/file/cdn/preline.css">
|
||||
</head>
|
||||
|
||||
<body class="flex h-full items-center py-16 dark:bg-neutral-800" background="https://bing.img.run/1920x1080.php" style="background-size: 100% 100%;">
|
||||
<!-- ========== MAIN CONTENT ========== -->
|
||||
<main id="content" class="w-full max-w-md mx-auto p-6">
|
||||
|
||||
<div class="mt-7 border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-900 dark:border-neutral-700" style="background: rgba(255, 255, 255, 0.6);-webkit-backdrop-filter: blur(10px);backdrop-filter: blur(10px);">
|
||||
<div class="p-4 sm:p-7">
|
||||
<div class="text-center">
|
||||
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white" ><img src="https://static.laysense.cn/data/file/laysenseW.png" style="height:30px;" />授权登录成功</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">
|
||||
您已成功登录,请回到网页源页面操作,您可以关闭本页面。
|
||||
</p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="mt-3 flex justify-center items-center text-center divide-x divide-gray-300 dark:divide-neutral-700">
|
||||
©上海来笙信息科技有限公司 2024 </p>
|
||||
|
||||
|
||||
</main>
|
||||
<!-- ========== END MAIN CONTENT ========== -->
|
||||
|
||||
<!-- JS Implementing Plugins -->
|
||||
|
||||
<!-- JS PLUGINS -->
|
||||
<!-- Required plugins -->
|
||||
<script src="https://static.laysense.cn/data/file/cdn/preline.js"></script>
|
||||
|
||||
<!-- JS THIRD PARTY PLUGINS -->
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,116 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="zh" class="h-full">
|
||||
<head>
|
||||
<!-- Required Meta Tags Always Come First -->
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<meta name="description" content="Laysense Auth">
|
||||
|
||||
|
||||
<!-- Title -->
|
||||
<title>Laysense Auth</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="shortcut icon" href="https://static.laysense.cn/data/file/_4335ce.png?1709117691655">
|
||||
|
||||
<!-- Font -->
|
||||
|
||||
<!-- Theme Check and Update -->
|
||||
<script>
|
||||
const html = document.querySelector('html');
|
||||
const isLightOrAuto = localStorage.getItem('hs_theme') === 'light' || (localStorage.getItem('hs_theme') === 'auto' && !window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
const isDarkOrAuto = localStorage.getItem('hs_theme') === 'dark' || (localStorage.getItem('hs_theme') === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
|
||||
if (isLightOrAuto && html.classList.contains('dark')) html.classList.remove('dark');
|
||||
else if (isDarkOrAuto && html.classList.contains('light')) html.classList.remove('light');
|
||||
else if (isDarkOrAuto && !html.classList.contains('dark')) html.classList.add('dark');
|
||||
else if (isLightOrAuto && !html.classList.contains('light')) html.classList.add('light');
|
||||
</script>
|
||||
|
||||
<!-- CSS HS -->
|
||||
<link rel="stylesheet" href="https://static.laysense.cn/data/file/cdn/preline.css">
|
||||
</head>
|
||||
|
||||
<body class="flex h-full items-center py-16 dark:bg-neutral-800" background="https://bing.img.run/1920x1080.php" style="background-size: 100% 100%;">
|
||||
<!-- ========== MAIN CONTENT ========== -->
|
||||
<main id="content" class="w-full max-w-md mx-auto p-6">
|
||||
|
||||
<div class="mt-7 border border-gray-200 rounded-xl shadow-sm dark:bg-neutral-900 dark:border-neutral-700" style="background: rgba(255, 255, 255, 0.6);-webkit-backdrop-filter: blur(10px);backdrop-filter: blur(10px);">
|
||||
<div class="p-4 sm:p-7">
|
||||
<div class="text-center">
|
||||
<h1 class="block text-2xl font-bold text-gray-800 dark:text-white" ><img src="https://static.laysense.cn/data/file/laysenseW.png" style="height:30px;" />请使用企业微信扫码登陆</h1>
|
||||
<p class="mt-2 text-sm text-gray-600 dark:text-neutral-400">
|
||||
二维码有效期 <span class="text-blue-600 decoration-2 hover:underline focus:outline-none focus:underline font-medium dark:text-blue-500" >5分钟</span> 超时请刷新页面
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="py-3 flex items-center text-xs text-gray-400 uppercase before:flex-1 before:border-t before:border-gray-200 before:me-6 after:flex-1 after:border-t after:border-gray-200 after:ms-6 dark:text-neutral-500 dark:before:border-neutral-600 dark:after:border-neutral-600">登录二维码</div>
|
||||
|
||||
<div class="shrink-0 group block ">
|
||||
<div class="flex items-center" id="qrdiv">
|
||||
<img src="<?php echo($qr);?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<p class="mt-3 flex justify-center items-center text-center divide-x divide-gray-300 dark:divide-neutral-700">
|
||||
©上海来笙信息科技有限公司 2024 </p>
|
||||
|
||||
|
||||
</main>
|
||||
<!-- ========== END MAIN CONTENT ========== -->
|
||||
|
||||
<!-- JS Implementing Plugins -->
|
||||
|
||||
<!-- JS PLUGINS -->
|
||||
<!-- Required plugins -->
|
||||
<script src="https://static.laysense.cn/data/file/cdn/preline.js"></script>
|
||||
|
||||
<!-- JS THIRD PARTY PLUGINS -->
|
||||
<script src="/jquery.js"></script>
|
||||
|
||||
<script>
|
||||
$(function() {
|
||||
//定义code
|
||||
var code;
|
||||
//获取code TODO:
|
||||
getStatusLong();
|
||||
// 长轮询执行
|
||||
function getStatusLong()
|
||||
{
|
||||
|
||||
$.ajax({
|
||||
type: 'get',
|
||||
url: "<?php echo('/qywxoauth/ask/'.$uuid);?>",
|
||||
success: function(response) {
|
||||
if (response.code == 200) {
|
||||
window.location = "<?php echo($to.'?code=');?>"+response.rcode;
|
||||
}else if(response.code == 500||response.code == 503){
|
||||
// 二维码已经过期
|
||||
$('#qrdiv').html('二维码已超时,请刷新页面重试');
|
||||
}else if(response.code == 501){
|
||||
$('#qrdiv').html('参数错误,请重新进行登录');
|
||||
}
|
||||
},
|
||||
dataType: 'json',
|
||||
timeout: 300*1000,// 超时时间
|
||||
// 超时意味着出错了
|
||||
error: function (error) {
|
||||
console.log(error);// timeout
|
||||
$('#qrdiv').html('二维码已超时,请刷新页面重试');
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user