master
lion 1 month ago
parent 3c0d696afe
commit 7d146149fe

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 720 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -23,9 +23,13 @@
$participantLoginUrl = '/admin/c/'.rawurlencode($slug).'/login';
$audienceLoginUrl = '/admin/c/'.rawurlencode($slug).'/audience/login';
$homeUrl = '/';
$homeEnUrl = '/en';
$participantLoginEnUrl = '/frontend/layout.html?role=user&lang=en';
$audienceLoginEnUrl = '/frontend/layout.html?role=audience&lang=en';
$eventSitePath = public_path('frontend/event-site.html');
abort_unless(File::isFile($eventSitePath), 503, '赛事官网原型 frontend/event-site.html 不存在');
$eventSiteRelative = $eventSiteRelative ?? 'frontend/event-site.html';
$eventSitePath = public_path($eventSiteRelative);
abort_unless(File::isFile($eventSitePath), 503, '赛事官网原型 '.$eventSiteRelative.' 不存在');
$html = File::get($eventSitePath);
$assetBase = '/frontend/assets';
@ -36,10 +40,20 @@
"url('assets/",
'src="assets/',
"src='assets/",
'href="event-site-en.html"',
"href='event-site-en.html'",
'href="event-site.html"',
"href='event-site.html'",
'href="login.html"',
"href='login.html'",
'href="layout.html?role=user&lang=en"',
"href='layout.html?role=user&lang=en'",
'href="layout.html?role=audience&lang=en"',
"href='layout.html?role=audience&lang=en'",
'href="layout.html?role=user&lang=en"',
"href='layout.html?role=user&lang=en'",
'href="layout.html?role=audience&lang=en"',
"href='layout.html?role=audience&lang=en'",
'href="layout.html?role=audience"',
"href='layout.html?role=audience'",
],
@ -48,10 +62,20 @@
"url('".$assetBase.'/',
'src="'.$assetBase.'/',
"src='".$assetBase.'/',
'href="'.$homeEnUrl.'"',
"href='".$homeEnUrl."'",
'href="'.$homeUrl.'"',
"href='".$homeUrl."'",
'href="'.$participantLoginUrl.'"',
"href='".$participantLoginUrl."'",
'href="'.$participantLoginEnUrl.'"',
"href='".$participantLoginEnUrl."'",
'href="'.$audienceLoginEnUrl.'"',
"href='".$audienceLoginEnUrl."'",
'href="'.$participantLoginEnUrl.'"',
"href='".$participantLoginEnUrl."'",
'href="'.$audienceLoginEnUrl.'"',
"href='".$audienceLoginEnUrl."'",
'href="'.$audienceLoginUrl.'"',
"href='".$audienceLoginUrl."'",
],

@ -22,7 +22,7 @@ use Illuminate\View\Middleware\ShareErrorsFromSession;
|
*/
Route::get('/', function () {
$showEventSite = function (string $eventSiteRelative = 'frontend/event-site.html') {
$sourceCode = trim((string) request()->query('src', ''));
$publicSourceCode = null;
if (preg_match('/^[A-Za-z0-9_-]{2,64}$/', $sourceCode) === 1) {
@ -38,8 +38,12 @@ Route::get('/', function () {
return view('welcome', [
'publicSourceCode' => $publicSourceCode,
'eventSiteRelative' => $eventSiteRelative,
]);
});
};
Route::get('/', fn () => $showEventSite());
Route::get('/en', fn () => $showEventSite('frontend/event-site-en.html'));
Route::get('/channel-entry', ChannelEntryController::class)->name('channel.entry');

@ -24,7 +24,25 @@ class ExampleTest extends TestCase
->assertSee('参赛报名', false)
->assertSee('观众报名', false)
->assertSee('/admin/c/hsxt/login', false)
->assertSee('/admin/c/hsxt/audience/login', false);
->assertSee('/admin/c/hsxt/audience/login', false)
->assertSee('href="/en"', false)
->assertSee('>EN</a>', false);
}
public function test_english_homepage_returns_a_successful_response(): void
{
$response = $this->get('/en');
$response
->assertOk()
->assertSee('Inaugural Shanghai–Suzhou Collaborative Emerging Industries Science &amp; Technology Innovation Competition', false)
->assertSee('COMPETE', false)
->assertSee('ATTEND', false)
->assertSee('/frontend/layout.html?role=user&amp;lang=en', false)
->assertSee('/frontend/layout.html?role=audience&amp;lang=en', false)
->assertSee('href="/" lang="zh-CN"', false)
->assertSee('>中文</a>', false)
->assertSee('hero-banner hero-banner--photonic', false);
}
public function test_homepage_signup_link_preserves_public_source(): void

Loading…
Cancel
Save