linyaostalker
5 years ago
17 changed files with 369 additions and 28 deletions
-
26api/assets/AppAsset.php
-
4api/config/.gitignore
-
1api/config/bootstrap.php
-
51api/config/main.php
-
3api/config/params.php
-
22api/controllers/SiteController.php
-
59api/controllers/TestController.php
-
2api/runtime/.gitignore
-
27api/views/site/error.php
-
5api/web/.gitignore
-
2api/web/assets/.gitignore
-
120api/web/css/site.css
-
BINapi/web/favicon.ico
-
BINbackend/web/uploads/xls/15738696921690.jpg
-
0datadictionary.md
-
10vendor/iron/grid/GridView.php
-
33vendor/iron/widgets/Menu.php
@ -0,0 +1,26 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace backend\assets; |
||||
|
|
||||
|
use yii\web\AssetBundle; |
||||
|
|
||||
|
/** |
||||
|
* Main backend application asset bundle. |
||||
|
*/ |
||||
|
class AppAsset extends AssetBundle |
||||
|
{ |
||||
|
public $basePath = '@webroot'; |
||||
|
public $baseUrl = '@web'; |
||||
|
public $css = [ |
||||
|
'css/site.css', |
||||
|
]; |
||||
|
public $js = [ |
||||
|
'js/common.js' |
||||
|
]; |
||||
|
public $depends = [ |
||||
|
'yii\web\YiiAsset', |
||||
|
'yii\bootstrap4\BootstrapAsset', |
||||
|
'yii\bootstrap4\BootstrapPluginAsset', |
||||
|
'iron\web\AdminlteAsset', |
||||
|
]; |
||||
|
} |
@ -0,0 +1,4 @@ |
|||||
|
codeception-local.php |
||||
|
main-local.php |
||||
|
params-local.php |
||||
|
test-local.php |
@ -0,0 +1 @@ |
|||||
|
<?php |
@ -0,0 +1,51 @@ |
|||||
|
<?php |
||||
|
|
||||
|
$params = array_merge( |
||||
|
require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php' |
||||
|
); |
||||
|
|
||||
|
return [ |
||||
|
'id' => 'api', |
||||
|
'basePath' => dirname(__DIR__), |
||||
|
'controllerNamespace' => 'api\controllers', |
||||
|
'bootstrap' => ['log'], |
||||
|
'modules' => [], |
||||
|
'components' => [ |
||||
|
'request' => [ |
||||
|
'parsers' => [ |
||||
|
'application/json' => 'yii\web\JsonParser', |
||||
|
], |
||||
|
'csrfParam' => '_csrf-backend', |
||||
|
], |
||||
|
'user' => [ |
||||
|
'identityClass' => 'common\models\User', |
||||
|
'enableAutoLogin' => true, |
||||
|
'identityCookie' => ['name' => '_identity-backend', 'httpOnly' => true], |
||||
|
], |
||||
|
'session' => [ |
||||
|
// this is the name of the session cookie used for login on the app
|
||||
|
'name' => 'advanced-api', |
||||
|
], |
||||
|
'log' => [ |
||||
|
'traceLevel' => YII_DEBUG ? 3 : 0, |
||||
|
'targets' => [ |
||||
|
[ |
||||
|
'class' => 'yii\log\FileTarget', |
||||
|
'levels' => ['error', 'warning'], |
||||
|
], |
||||
|
], |
||||
|
], |
||||
|
'errorHandler' => [ |
||||
|
'errorAction' => 'site/error', |
||||
|
], |
||||
|
'urlManager' => [ |
||||
|
'enablePrettyUrl' => true, |
||||
|
'showScriptName' => true, |
||||
|
'enableStrictParsing' => false, |
||||
|
'rules' => [ |
||||
|
['class' => 'yii\rest\UrlRule', 'controller' => 'test'], |
||||
|
], |
||||
|
], |
||||
|
], |
||||
|
'params' => $params, |
||||
|
]; |
@ -0,0 +1,3 @@ |
|||||
|
<?php |
||||
|
return [ |
||||
|
]; |
@ -0,0 +1,22 @@ |
|||||
|
<?php |
||||
|
|
||||
|
namespace api\controllers; |
||||
|
|
||||
|
use yii\web\Controller; |
||||
|
|
||||
|
/** |
||||
|
* Created by PhpStorm. |
||||
|
* User: iron |
||||
|
* Date: 2018/5/25 |
||||
|
* Time: 16:42 |
||||
|
*/ |
||||
|
class SiteController extends Controller |
||||
|
{ |
||||
|
public function actions() { |
||||
|
return [ |
||||
|
'error' => [ |
||||
|
'class' => 'yii\web\ErrorAction', |
||||
|
], |
||||
|
]; |
||||
|
} |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
<?php |
||||
|
/* |
||||
|
* The MIT License |
||||
|
* |
||||
|
* Copyright 2019 Blobt. |
||||
|
* |
||||
|
* Permission is hereby granted, free of charge, to any person obtaining a copy |
||||
|
* of this software and associated documentation files (the "Software"), to deal |
||||
|
* in the Software without restriction, including without limitation the rights |
||||
|
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
||||
|
* copies of the Software, and to permit persons to whom the Software is |
||||
|
* furnished to do so, subject to the following conditions: |
||||
|
* |
||||
|
* The above copyright notice and this permission notice shall be included in |
||||
|
* all copies or substantial portions of the Software. |
||||
|
* |
||||
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
||||
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
||||
|
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
||||
|
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
||||
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
||||
|
* THE SOFTWARE. |
||||
|
*/ |
||||
|
|
||||
|
namespace api\controllers; |
||||
|
/** |
||||
|
* @author iron |
||||
|
* @email weiriron@gmail.com |
||||
|
*/ |
||||
|
|
||||
|
use common\models\ars\Goods; |
||||
|
use common\models\searchs\GoodsSearch; |
||||
|
use yii\data\ActiveDataProvider; |
||||
|
use yii\db\ActiveRecord; |
||||
|
use yii\rest\ActiveController; |
||||
|
use yii\web\NotFoundHttpException; |
||||
|
|
||||
|
class TestController extends ActiveController |
||||
|
{ |
||||
|
public $modelClass = 'common\models\ars\Goods'; |
||||
|
|
||||
|
public function actions() |
||||
|
{ |
||||
|
$action = parent::actions(); |
||||
|
unset($action['index']); |
||||
|
return$action; |
||||
|
} |
||||
|
|
||||
|
public function actionIndex() |
||||
|
{ |
||||
|
return new ActiveDataProvider([ |
||||
|
'query' => Goods::find(), |
||||
|
'pagination' => [ |
||||
|
'pageSize' => 1, |
||||
|
], |
||||
|
]); |
||||
|
} |
||||
|
} |
@ -0,0 +1,2 @@ |
|||||
|
* |
||||
|
!.gitignore |
@ -0,0 +1,27 @@ |
|||||
|
<?php |
||||
|
|
||||
|
/* @var $this yii\web\View */ |
||||
|
/* @var $name string */ |
||||
|
/* @var $message string */ |
||||
|
/* @var $exception Exception */ |
||||
|
|
||||
|
use yii\helpers\Html; |
||||
|
|
||||
|
$this->title = $name; |
||||
|
?>
|
||||
|
<div class="site-error"> |
||||
|
|
||||
|
<h1><?= Html::encode($this->title) ?></h1>
|
||||
|
|
||||
|
<div class="alert alert-danger"> |
||||
|
<?= nl2br(Html::encode($message)) ?>
|
||||
|
</div> |
||||
|
|
||||
|
<p> |
||||
|
The above error occurred while the Web server was processing your request. |
||||
|
</p> |
||||
|
<p> |
||||
|
Please contact us if you think this is a server error. Thank you. |
||||
|
</p> |
||||
|
|
||||
|
</div> |
@ -0,0 +1,5 @@ |
|||||
|
/index.php |
||||
|
/index-test.php |
||||
|
/robots.txt |
||||
|
uploads |
||||
|
|
@ -0,0 +1,2 @@ |
|||||
|
* |
||||
|
!.gitignore |
@ -0,0 +1,120 @@ |
|||||
|
html, |
||||
|
body { |
||||
|
height: 100%; |
||||
|
} |
||||
|
|
||||
|
.wrap { |
||||
|
min-height: 100%; |
||||
|
height: auto; |
||||
|
margin: 0 auto -60px; |
||||
|
padding: 0 0 60px; |
||||
|
} |
||||
|
|
||||
|
.wrap > .container { |
||||
|
padding: 70px 15px 20px; |
||||
|
} |
||||
|
|
||||
|
.footer { |
||||
|
height: 60px; |
||||
|
background-color: #f5f5f5; |
||||
|
border-top: 1px solid #ddd; |
||||
|
padding-top: 20px; |
||||
|
} |
||||
|
|
||||
|
.jumbotron { |
||||
|
text-align: center; |
||||
|
background-color: transparent; |
||||
|
} |
||||
|
|
||||
|
.jumbotron .btn { |
||||
|
font-size: 21px; |
||||
|
padding: 14px 24px; |
||||
|
} |
||||
|
|
||||
|
.not-set { |
||||
|
color: #c55; |
||||
|
font-style: italic; |
||||
|
} |
||||
|
|
||||
|
/* add sorting icons to gridview sort links */ |
||||
|
a.asc:after, a.desc:after { |
||||
|
position: relative; |
||||
|
top: 1px; |
||||
|
display: inline-block; |
||||
|
font-family: 'Glyphicons Halflings'; |
||||
|
font-style: normal; |
||||
|
font-weight: normal; |
||||
|
line-height: 1; |
||||
|
padding-left: 5px; |
||||
|
} |
||||
|
|
||||
|
a.asc:after { |
||||
|
content: /*"\e113"*/ "\e151"; |
||||
|
} |
||||
|
|
||||
|
a.desc:after { |
||||
|
content: /*"\e114"*/ "\e152"; |
||||
|
} |
||||
|
|
||||
|
.sort-numerical a.asc:after { |
||||
|
content: "\e153"; |
||||
|
} |
||||
|
|
||||
|
.sort-numerical a.desc:after { |
||||
|
content: "\e154"; |
||||
|
} |
||||
|
|
||||
|
.sort-ordinal a.asc:after { |
||||
|
content: "\e155"; |
||||
|
} |
||||
|
|
||||
|
.sort-ordinal a.desc:after { |
||||
|
content: "\e156"; |
||||
|
} |
||||
|
|
||||
|
.grid-view td { |
||||
|
white-space: nowrap; |
||||
|
} |
||||
|
|
||||
|
.grid-view .filters input, |
||||
|
.grid-view .filters select { |
||||
|
min-width: 50px; |
||||
|
} |
||||
|
|
||||
|
.hint-block { |
||||
|
display: block; |
||||
|
margin-top: 5px; |
||||
|
color: #999; |
||||
|
} |
||||
|
|
||||
|
.error-summary { |
||||
|
color: #a94442; |
||||
|
background: #fdf7f7; |
||||
|
border-left: 3px solid #eed3d7; |
||||
|
padding: 10px 20px; |
||||
|
margin: 0 0 15px 0; |
||||
|
} |
||||
|
|
||||
|
/* align the logout "link" (button in forms) of the navbar */ |
||||
|
.nav li > form > button.logout { |
||||
|
padding: 15px; |
||||
|
border: none; |
||||
|
} |
||||
|
|
||||
|
@media(max-width:767px) { |
||||
|
.nav li > form > button.logout { |
||||
|
display:block; |
||||
|
text-align: left; |
||||
|
width: 100%; |
||||
|
padding: 10px 15px; |
||||
|
} |
||||
|
} |
||||
|
|
||||
|
.nav > li > form > button.logout:focus, |
||||
|
.nav > li > form > button.logout:hover { |
||||
|
text-decoration: none; |
||||
|
} |
||||
|
|
||||
|
.nav > li > form > button.logout:focus { |
||||
|
outline: none; |
||||
|
} |
Before Width: 1024 | Height: 759 | Size: 159 KiB |
Write
Preview
Loading…
Cancel
Save
Reference in new issue