Fix some bugs
parent
4936a2fdf8
commit
cb5487065e
|
@ -20,7 +20,7 @@
|
|||
<navigations>
|
||||
<navigation>
|
||||
<name>Polaroid</name>
|
||||
<route>polaroid.page.index</route>
|
||||
<route>polaroid.page.main</route>
|
||||
</navigation>
|
||||
</navigations>
|
||||
</info>
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
<?php
|
||||
return [
|
||||
'routes' => [
|
||||
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#index', 'url' => '/albums/{path}', 'verb' => 'GET', 'postfix' => 'albums',
|
||||
['name' => 'page#main', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#album', 'url' => '/albusms/{path}/{path1}', 'verb' => 'GET',
|
||||
'requirements' => [
|
||||
'path' => '.*',
|
||||
'path1' => '.*',
|
||||
],
|
||||
'defaults' => [
|
||||
'path' => '',
|
||||
'path1' => '',
|
||||
]
|
||||
],
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ class PageController extends Controller {
|
|||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function index() {
|
||||
public function main() {
|
||||
Util::addScript($this->appName, 'polaroid-main');
|
||||
Util::addStyle($this->appName, 'icons');
|
||||
|
||||
|
@ -39,4 +39,11 @@ class PageController extends Controller {
|
|||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function album() {
|
||||
return $this->main();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -413,6 +413,8 @@ export default {
|
|||
try {
|
||||
this.loading = true;
|
||||
fileInfos = await dav.getFiles(ids);
|
||||
} catch {
|
||||
console.error('Failed to load fileInfos');
|
||||
} finally {
|
||||
this.loading = false;
|
||||
}
|
||||
|
@ -431,7 +433,7 @@ export default {
|
|||
});
|
||||
}
|
||||
|
||||
const photo = fileInfos.find(d => Number(d.fileid) === Number(img.id));
|
||||
const photo = fileInfos.find(d => Number(d.fileid) === Number(img.file_id));
|
||||
if (!photo) {
|
||||
alert('Cannot find this photo anymore!');
|
||||
return;
|
||||
|
|
Loading…
Reference in New Issue