├── .eslintignore ├── phalapi ├── src │ └── app │ │ ├── Common │ │ ├── README.md │ │ └── Response.php │ │ ├── functions.php │ │ ├── Api │ │ ├── Image.php │ │ ├── Examples │ │ │ ├── Nothing.php │ │ │ └── QrCode.php │ │ ├── Site.php │ │ ├── Data.php │ │ └── Message.php │ │ ├── Model │ │ └── Examples │ │ │ └── CURD.php │ │ └── Domain │ │ └── Examples │ │ └── CURD.php ├── vendor │ ├── phalapi │ │ ├── notorm │ │ │ ├── tests │ │ │ │ ├── README.md │ │ │ │ └── Lite_Test.php │ │ │ ├── .gitignore │ │ │ ├── README.md │ │ │ ├── src │ │ │ │ ├── Lite.php │ │ │ │ └── NotORM │ │ │ │ │ └── Literal.php │ │ │ └── composer.json │ │ ├── task │ │ │ ├── .gitignore │ │ │ ├── data │ │ │ │ ├── task_mq.sql │ │ │ │ ├── task_progress.sql │ │ │ │ └── phalapi_task_progress.sql │ │ │ ├── src │ │ │ │ ├── Progress │ │ │ │ │ ├── Trigger.php │ │ │ │ │ └── Trigger │ │ │ │ │ │ └── CommonTrigger.php │ │ │ │ ├── Runner │ │ │ │ │ ├── Remote │ │ │ │ │ │ └── Connector │ │ │ │ │ │ │ └── HttpConnector.php │ │ │ │ │ └── LocalRunner.php │ │ │ │ ├── MQ.php │ │ │ │ ├── MQ │ │ │ │ │ ├── DBMQ.php │ │ │ │ │ ├── ArrayMQ.php │ │ │ │ │ ├── FileMQ.php │ │ │ │ │ ├── MemcachedMQ.php │ │ │ │ │ ├── RedisMQ.php │ │ │ │ │ └── KeyValueMQ.php │ │ │ │ └── Lite.php │ │ │ ├── tests │ │ │ │ ├── Runner │ │ │ │ │ └── testtaskdemo.php │ │ │ │ ├── Task_Progress_Test.php │ │ │ │ ├── Task_Lite_Test.php │ │ │ │ ├── Progress │ │ │ │ │ └── Trigger │ │ │ │ │ │ └── CommonTrigger_Test.php │ │ │ │ └── MQ │ │ │ │ │ ├── Task_MQ_Redis_Test.php │ │ │ │ │ ├── Task_MQ_File_Test.php │ │ │ │ │ └── Task_MQ_Memcached_Test.php │ │ │ ├── bin │ │ │ │ └── crontab.php │ │ │ ├── config │ │ │ │ ├── dbs.php │ │ │ │ └── app.php │ │ │ └── composer.json │ │ └── kernal │ │ │ ├── tests │ │ │ ├── config │ │ │ │ ├── sys.php │ │ │ │ └── app.php │ │ │ ├── src │ │ │ │ ├── test_file_for_loader.php │ │ │ │ ├── Model │ │ │ │ │ ├── fun.php │ │ │ │ │ ├── app_fun.php │ │ │ │ │ └── app.php │ │ │ │ ├── Cache │ │ │ │ │ ├── memcached.php │ │ │ │ │ ├── redis.php │ │ │ │ │ ├── apcu.php │ │ │ │ │ └── NoneCache_Test.php │ │ │ │ ├── Request │ │ │ │ │ └── Formatter │ │ │ │ │ │ ├── Classes │ │ │ │ │ │ ├── FormatterCallbackMyClass.php │ │ │ │ │ │ └── FormatterCallbackMyClass2.php │ │ │ │ │ │ ├── funs.php │ │ │ │ │ │ ├── BooleanFormatter_Test.php │ │ │ │ │ │ └── EnumFormatter.php │ │ │ │ ├── Helper │ │ │ │ │ ├── runner.php │ │ │ │ │ └── TestRunner_Test.php │ │ │ │ ├── pai.php │ │ │ │ ├── Config │ │ │ │ │ ├── yaconf.php │ │ │ │ │ ├── FileConfig_Test.php │ │ │ │ │ └── YaconfConfig_Test.php │ │ │ │ ├── app.php │ │ │ │ ├── Crypt │ │ │ │ │ └── RSA │ │ │ │ │ │ ├── MultiPub2PriCrypt_Test.php │ │ │ │ │ │ └── Pri2PubCrypt_Test.php │ │ │ │ ├── Response │ │ │ │ │ ├── XmlResponse_Test.php │ │ │ │ │ ├── ExplorerResponse_Test.php │ │ │ │ │ ├── JsonResponse_Test.php │ │ │ │ │ └── JsonpResponse_Test.php │ │ │ │ ├── Exception │ │ │ │ │ └── RedirectException_Test.php │ │ │ │ ├── Cookie_Test.php │ │ │ │ └── Logger │ │ │ │ │ └── ExplorerLogger_Test.php │ │ │ ├── test_data │ │ │ │ └── language │ │ │ │ │ └── zh_cn │ │ │ │ │ └── common.php │ │ │ ├── language │ │ │ │ └── zh_cn │ │ │ │ │ └── common.php │ │ │ ├── phpunit.xml │ │ │ └── phpunit_silence.xml │ │ │ ├── .gitignore │ │ │ ├── src │ │ │ ├── Request │ │ │ │ ├── Formatter.php │ │ │ │ └── Formatter │ │ │ │ │ ├── CallbackFormatter.php │ │ │ │ │ ├── IntFormatter.php │ │ │ │ │ ├── FloatFormatter.php │ │ │ │ │ ├── BooleanFormatter.php │ │ │ │ │ └── DateFormatter.php │ │ │ ├── Exception.php │ │ │ ├── Database.php │ │ │ ├── Filter │ │ │ │ └── NoneFilter.php │ │ │ ├── Response │ │ │ │ ├── ExplorerResponse.php │ │ │ │ ├── XmlResponse.php │ │ │ │ ├── JsonResponse.php │ │ │ │ └── JsonpResponse.php │ │ │ ├── Cache │ │ │ │ ├── NoneCache.php │ │ │ │ ├── MemcachedCache.php │ │ │ │ ├── APCUCache.php │ │ │ │ └── MultiCache.php │ │ │ ├── Exception │ │ │ │ ├── RedirectException.php │ │ │ │ ├── BadRequestException.php │ │ │ │ └── InternalServerErrorException.php │ │ │ ├── Filter.php │ │ │ ├── Helper │ │ │ │ └── ApiOnline.php │ │ │ ├── Crypt.php │ │ │ ├── Cache.php │ │ │ ├── Crypt │ │ │ │ └── RSA │ │ │ │ │ ├── KeyGenerator.php │ │ │ │ │ ├── Pri2PubCrypt.php │ │ │ │ │ ├── Pub2PriCrypt.php │ │ │ │ │ ├── MultiPri2PubCrypt.php │ │ │ │ │ └── MultiPub2PriCrypt.php │ │ │ ├── Logger │ │ │ │ └── ExplorerLogger.php │ │ │ ├── functions.php │ │ │ ├── Config │ │ │ │ └── YaconfConfig.php │ │ │ ├── Config.php │ │ │ └── Model │ │ │ │ └── Query.php │ │ │ ├── README.md │ │ │ └── composer.json │ ├── autoload.php │ └── composer │ │ ├── autoload_classmap.php │ │ ├── autoload_namespaces.php │ │ ├── autoload_files.php │ │ ├── autoload_psr4.php │ │ └── LICENSE ├── public │ ├── favicon.ico │ ├── index.php │ ├── examples │ │ └── upload.html │ ├── init.php │ └── docs.php ├── sdk │ ├── Python │ │ └── PhalApiClient │ │ │ ├── python2.x │ │ │ ├── __init__.py │ │ │ ├── PhalApiClient.py │ │ │ └── demo.py │ │ │ └── python3.x │ │ │ ├── __init__.py │ │ │ ├── PhalApiClient.py │ │ │ └── demo.py │ ├── Ruby │ │ └── PhalApiClient │ │ │ ├── tests │ │ │ ├── run_tests │ │ │ ├── client_response.rb │ │ │ └── client_parser_json.rb │ │ │ └── demo.rb │ ├── Objective-C │ │ ├── PhalApiClient │ │ │ ├── AFNPhalApiClient │ │ │ │ └── AFNPhalApiClient.h │ │ │ ├── PhalApiClientFilter.h │ │ │ └── PhalApiClientFilter.m │ │ └── XSHttpTool │ │ │ └── Singleton.h │ ├── JAVA │ │ └── net │ │ │ └── phalapi │ │ │ └── sdk │ │ │ ├── PhalApiClientParser.java │ │ │ ├── PhalApiClientFilter.java │ │ │ ├── PhalApiClientParserJson.java │ │ │ └── PhalApiClientResponse.java │ ├── C_Sharp │ │ └── PhalApiClient │ │ │ ├── PhalApiClientParser.cs │ │ │ ├── PhalApiClientFilter.cs │ │ │ ├── PhalApiClientParserJson.cs │ │ │ └── PhalApiClientResponse.cs │ ├── Go │ │ └── main.go │ └── PHP │ │ └── PhalApiClient │ │ └── demo.php ├── .gitignore ├── bin │ ├── phalapi-cli │ ├── phalapi-buildsqls │ └── phalapi-buildtest ├── language │ ├── zh_tw │ │ └── common.php │ ├── en │ │ └── common.php │ ├── fr │ │ └── common.php │ ├── de │ │ └── common.php │ └── zh_cn │ │ └── common.php ├── data │ └── phalapi.sql ├── config │ ├── sys.php │ └── app.php ├── tests │ ├── bootstrap.php │ ├── phpunit.xml │ └── app │ │ └── Api │ │ ├── Site_Test.php │ │ └── User_Test.php └── composer.json ├── .babelrc ├── cypress.json ├── src ├── components │ ├── main │ │ ├── index.js │ │ └── components │ │ │ ├── user │ │ │ ├── index.js │ │ │ ├── user.less │ │ │ └── user.vue │ │ │ ├── a-back-top │ │ │ └── index.js │ │ │ ├── language │ │ │ ├── index.js │ │ │ └── language.vue │ │ │ ├── tags-nav │ │ │ └── index.js │ │ │ ├── header-bar │ │ │ ├── index.js │ │ │ ├── sider-trigger │ │ │ │ ├── index.js │ │ │ │ ├── sider-trigger.less │ │ │ │ └── sider-trigger.vue │ │ │ ├── custom-bread-crumb │ │ │ │ ├── index.js │ │ │ │ ├── custom-bread-crumb.less │ │ │ │ └── custom-bread-crumb.vue │ │ │ ├── header-bar.less │ │ │ └── header-bar.vue │ │ │ ├── side-menu │ │ │ ├── index.js │ │ │ ├── item-mixin.js │ │ │ ├── mixin.js │ │ │ ├── side-menu.less │ │ │ └── side-menu-item.vue │ │ │ ├── error-store │ │ │ ├── index.js │ │ │ └── error-store.vue │ │ │ └── fullscreen │ │ │ └── index.js │ ├── icons │ │ ├── index.js │ │ └── icons.vue │ ├── cropper │ │ ├── index.js │ │ └── index.less │ ├── editor │ │ └── index.js │ ├── split-pane │ │ ├── index.js │ │ └── trigger.vue │ ├── tables │ │ ├── index.js │ │ ├── index.less │ │ └── handle-btns.js │ ├── count-to │ │ ├── index.js │ │ └── index.less │ ├── drag-list │ │ └── index.js │ ├── info-card │ │ └── index.js │ ├── login-form │ │ └── index.js │ ├── common-icon │ │ ├── index.js │ │ └── common-icon.vue │ ├── parent-view │ │ ├── index.js │ │ └── parent-view.vue │ ├── markdown │ │ └── index.js │ ├── paste-editor │ │ ├── index.js │ │ └── paste-editor.less │ ├── charts │ │ ├── index.js │ │ └── bar.vue │ └── common │ │ ├── util.js │ │ └── common.less ├── view │ ├── single-page │ │ └── home │ │ │ └── index.js │ ├── multilevel │ │ ├── level-2-1.vue │ │ ├── level-2-3.vue │ │ └── level-2-2 │ │ │ ├── level-2-2-1.vue │ │ │ └── level-2-2-2.vue │ ├── components │ │ ├── markdown │ │ │ └── markdown.vue │ │ ├── editor │ │ │ └── editor.vue │ │ └── cropper │ │ │ └── cropper.vue │ ├── error-page │ │ ├── 404.vue │ │ ├── 401.vue │ │ ├── 500.vue │ │ ├── error-content.vue │ │ ├── back-btn-group.vue │ │ └── error.less │ ├── argu-page │ │ ├── query.vue │ │ └── params.vue │ ├── login │ │ ├── login.less │ │ └── login.vue │ ├── join-page.vue │ ├── excel │ │ └── common.less │ ├── error-store │ │ └── error-store.vue │ └── i18n │ │ └── i18n-page.vue ├── assets │ ├── images │ │ ├── logo.jpg │ │ ├── login-bg.jpg │ │ ├── logo-min.jpg │ │ ├── qq-group1.jpg │ │ ├── qq-group2.jpg │ │ └── talkingdata.png │ └── icons │ │ ├── iconfont.eot │ │ ├── iconfont.ttf │ │ └── iconfont.woff ├── index.less ├── directive │ ├── directives.js │ ├── index.js │ └── module │ │ ├── clipboard.js │ │ └── draggable.js ├── api │ ├── routers.js │ └── data.js ├── libs │ └── api.request.js ├── plugin │ ├── index.js │ └── error-store │ │ └── index.js ├── router │ └── before-close.js ├── store │ └── index.js ├── App.vue ├── mock │ ├── data.js │ ├── login.js │ └── index.js ├── config │ └── index.js ├── main.js └── locale │ ├── lang │ ├── zh-CN.js │ ├── zh-TW.js │ └── en-US.js │ └── index.js ├── .postcssrc.js ├── public ├── api.php ├── docs.php ├── favicon.ico └── index.html ├── .travis.yml ├── tests ├── unit │ ├── .eslintrc.js │ └── HelloWorld.spec.js └── e2e │ ├── .eslintrc │ ├── specs │ └── test.js │ ├── plugins │ └── index.js │ └── support │ ├── index.js │ └── commands.js ├── .editorconfig ├── .gitignore ├── .eslintrc.js ├── LICENSE └── vue.config.js /.eslintignore: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /phalapi/src/app/Common/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/notorm/tests/README.md: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@vue/app" 4 | ] 5 | } 6 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/notorm/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor 3 | -------------------------------------------------------------------------------- /cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "pluginsFile": "tests/e2e/plugins/index.js" 3 | } 4 | -------------------------------------------------------------------------------- /src/components/main/index.js: -------------------------------------------------------------------------------- 1 | import Main from './main.vue' 2 | export default Main 3 | -------------------------------------------------------------------------------- /.postcssrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | plugins: { 3 | autoprefixer: {} 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/.gitignore: -------------------------------------------------------------------------------- 1 | /vendor/ 2 | composer.lock 3 | tests/runtime 4 | 5 | -------------------------------------------------------------------------------- /src/components/icons/index.js: -------------------------------------------------------------------------------- 1 | import Icons from './icons.vue' 2 | export default Icons 3 | -------------------------------------------------------------------------------- /src/view/single-page/home/index.js: -------------------------------------------------------------------------------- 1 | import home from './home.vue' 2 | export default home 3 | -------------------------------------------------------------------------------- /src/components/cropper/index.js: -------------------------------------------------------------------------------- 1 | import Cropper from './index.vue' 2 | export default Cropper 3 | -------------------------------------------------------------------------------- /src/components/editor/index.js: -------------------------------------------------------------------------------- 1 | import Editor from './editor.vue' 2 | export default Editor 3 | -------------------------------------------------------------------------------- /src/components/split-pane/index.js: -------------------------------------------------------------------------------- 1 | import Split from './split.vue' 2 | export default Split 3 | -------------------------------------------------------------------------------- /src/components/tables/index.js: -------------------------------------------------------------------------------- 1 | import Tables from './tables.vue' 2 | export default Tables 3 | -------------------------------------------------------------------------------- /public/api.php: -------------------------------------------------------------------------------- 1 | false, 5 | ); 6 | -------------------------------------------------------------------------------- /src/assets/images/logo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalapi/phalapi-iview-admin/HEAD/src/assets/images/logo.jpg -------------------------------------------------------------------------------- /src/components/main/components/a-back-top/index.js: -------------------------------------------------------------------------------- 1 | import ABackTop from './index.vue' 2 | export default ABackTop 3 | -------------------------------------------------------------------------------- /src/components/main/components/language/index.js: -------------------------------------------------------------------------------- 1 | import Language from './language.vue' 2 | export default Language 3 | -------------------------------------------------------------------------------- /src/components/main/components/tags-nav/index.js: -------------------------------------------------------------------------------- 1 | import TagsNav from './tags-nav.vue' 2 | export default TagsNav 3 | -------------------------------------------------------------------------------- /src/components/markdown/index.js: -------------------------------------------------------------------------------- 1 | import MarkdownEditor from './markdown.vue' 2 | export default MarkdownEditor 3 | -------------------------------------------------------------------------------- /src/components/paste-editor/index.js: -------------------------------------------------------------------------------- 1 | import PasteEditor from './paste-editor.vue' 2 | export default PasteEditor 3 | -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python2.x/__init__.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python3.x/__init__.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 -------------------------------------------------------------------------------- /phalapi/src/app/functions.php: -------------------------------------------------------------------------------- 1 | 'Hello PhpUnit'); 3 | -------------------------------------------------------------------------------- /src/assets/images/talkingdata.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/phalapi/phalapi-iview-admin/HEAD/src/assets/images/talkingdata.png -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | vendor/ 3 | .project 4 | .buildpath 5 | 6 | tests/src/Cache/cache 7 | 8 | -------------------------------------------------------------------------------- /src/components/charts/index.js: -------------------------------------------------------------------------------- 1 | import ChartPie from './pie.vue' 2 | import ChartBar from './bar.vue' 3 | export { ChartPie, ChartBar } 4 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/sider-trigger/index.js: -------------------------------------------------------------------------------- 1 | import siderTrigger from './sider-trigger.vue' 2 | export default siderTrigger 3 | -------------------------------------------------------------------------------- /phalapi/.gitignore: -------------------------------------------------------------------------------- 1 | composer.lock 2 | 3 | runtime/* 4 | 5 | public/docs 6 | 7 | public/uploads 8 | 9 | gitc 10 | 11 | .idea/ 12 | .env 13 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/test_data/language/zh_cn/common.php: -------------------------------------------------------------------------------- 1 | 'this is a good way', 5 | ); 6 | -------------------------------------------------------------------------------- /phalapi/sdk/Ruby/PhalApiClient/tests/run_tests: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ruby ./client_response.rb 4 | 5 | ruby ./client_parser_json.rb 6 | 7 | ruby ./client.rb 8 | -------------------------------------------------------------------------------- /tests/unit/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { 3 | mocha: true 4 | }, 5 | rules: { 6 | 'import/no-extraneous-dependencies': 'off' 7 | } 8 | } -------------------------------------------------------------------------------- /src/components/main/components/header-bar/custom-bread-crumb/index.js: -------------------------------------------------------------------------------- 1 | import customBreadCrumb from './custom-bread-crumb.vue' 2 | export default customBreadCrumb 3 | -------------------------------------------------------------------------------- /src/index.less: -------------------------------------------------------------------------------- 1 | @import '~iview/src/styles/index.less'; 2 | 3 | @menu-dark-title: #001529; 4 | @menu-dark-active-bg: #000c17; 5 | @layout-sider-background: #001529; 6 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.less: -------------------------------------------------------------------------------- 1 | .custom-bread-crumb{ 2 | display: inline-block; 3 | vertical-align: top; 4 | } 5 | -------------------------------------------------------------------------------- /src/view/multilevel/level-2-1.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /src/view/multilevel/level-2-3.vue: -------------------------------------------------------------------------------- 1 | 4 | 9 | -------------------------------------------------------------------------------- /phalapi/bin/phalapi-cli: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env php 2 | response(); 7 | -------------------------------------------------------------------------------- /phalapi/language/zh_tw/common.php: -------------------------------------------------------------------------------- 1 | '{name}您好,歡迎使用PhalApi!', 5 | 'user not exists' => '用戶不存在', 6 | ); 7 | -------------------------------------------------------------------------------- /src/components/common/util.js: -------------------------------------------------------------------------------- 1 | export const showTitle = (item, vm) => { 2 | return vm.$config.useI18n ? vm.$t(item.name) : ((item.meta && item.meta.title) || item.name) 3 | } 4 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Model/fun.php: -------------------------------------------------------------------------------- 1 | 'Hello {name}, Welcome to use PhalApi!', 5 | 'user not exists' => 'user not exists', 6 | ); 7 | -------------------------------------------------------------------------------- /phalapi/public/index.php: -------------------------------------------------------------------------------- 1 | response()->output(); 10 | 11 | -------------------------------------------------------------------------------- /tests/e2e/.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "plugins": [ 3 | "cypress" 4 | ], 5 | "env": { 6 | "mocha": true, 7 | "cypress/globals": true 8 | }, 9 | "rules": { 10 | "strict": "off" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /phalapi/vendor/autoload.php: -------------------------------------------------------------------------------- 1 | '{name}Bonjour, bienvenue PhalApi!', 6 | 'user not exists' => "L'utilisateur n'existe pas", 7 | ); 8 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Request/Formatter/Classes/FormatterCallbackMyClass.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 | 5 |
6 | 7 | 8 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Request/Formatter/funs.php: -------------------------------------------------------------------------------- 1 | { 4 | return axios.request({ 5 | url: 'get_router', 6 | params: { 7 | access 8 | }, 9 | method: 'get' 10 | }) 11 | } 12 | -------------------------------------------------------------------------------- /tests/e2e/specs/test.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/api/introduction/api.html 2 | 3 | describe('My First Test', () => { 4 | it('Visits the app root url', () => { 5 | cy.visit('/') 6 | cy.contains('h1', 'Welcome to Your Vue.js App') 7 | }) 8 | }) 9 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Helper/runner.php: -------------------------------------------------------------------------------- 1 | '{name}Hallo, Willkommen PhalApi!', 8 | 'user not exists' => 'Der nutzer gibt es nicht', 9 | ); 10 | -------------------------------------------------------------------------------- /src/plugin/index.js: -------------------------------------------------------------------------------- 1 | import config from '@/config' 2 | const { plugin } = config 3 | 4 | export default (Vue) => { 5 | for (let name in plugin) { 6 | const value = plugin[name] 7 | Vue.use(require(`./${name}`).default, typeof value === 'object' ? value : undefined) 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /src/components/main/components/user/user.less: -------------------------------------------------------------------------------- 1 | .user{ 2 | &-avator-dropdown{ 3 | cursor: pointer; 4 | display: inline-block; 5 | // height: 64px; 6 | vertical-align: middle; 7 | // line-height: 64px; 8 | .ivu-badge-dot{ 9 | top: 16px; 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Model/app_fun.php: -------------------------------------------------------------------------------- 1 | debug ? $rs : $rs['data']; 11 | } 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/header-bar.less: -------------------------------------------------------------------------------- 1 | .header-bar{ 2 | width: 100%; 3 | height: 100%; 4 | position: relative; 5 | .custom-content-con{ 6 | float: right; 7 | height: auto; 8 | padding-right: 20px; 9 | line-height: 64px; 10 | & > *{ 11 | float: right; 12 | } 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /phalapi/language/zh_cn/common.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 9 | */ 10 | 11 | return array( 12 | 'Hi {name}, welcome to use PhalApi!' => '{name}您好,欢迎使用PhalApi!', 13 | 'user not exists' => '用户不存在', 14 | ); 15 | -------------------------------------------------------------------------------- /src/components/tables/index.less: -------------------------------------------------------------------------------- 1 | .search-con{ 2 | padding: 10px 0; 3 | .search{ 4 | &-col{ 5 | display: inline-block; 6 | width: 200px; 7 | } 8 | &-input{ 9 | display: inline-block; 10 | width: 200px; 11 | margin-left: 2px; 12 | } 13 | &-btn{ 14 | margin-left: 2px; 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/view/multilevel/level-2-2/level-2-2-1.vue: -------------------------------------------------------------------------------- 1 | 7 | 17 | -------------------------------------------------------------------------------- /src/view/multilevel/level-2-2/level-2-2-2.vue: -------------------------------------------------------------------------------- 1 | 7 | 17 | -------------------------------------------------------------------------------- /phalapi/src/app/Api/Image.php: -------------------------------------------------------------------------------- 1 | 20150520 8 | */ 9 | 10 | interface Trigger { 11 | 12 | /** 13 | * 进程的具体操作 14 | * @param string $params 对应数据库表task_progress.fire_params字段 15 | */ 16 | public function fire($params); 17 | } 18 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/Runner/testtaskdemo.php: -------------------------------------------------------------------------------- 1 | 0); 8 | } 9 | 10 | public function update2() { 11 | throw new \PhalApi\Exception\InternalServerErrorException('just for test'); 12 | } 13 | } 14 | 15 | -------------------------------------------------------------------------------- /src/router/before-close.js: -------------------------------------------------------------------------------- 1 | import { Modal } from 'iview' 2 | 3 | const beforeClose = { 4 | before_close_normal: (resolve) => { 5 | Modal.confirm({ 6 | title: '确定要关闭这一页吗', 7 | onOk: () => { 8 | resolve(true) 9 | }, 10 | onCancel: () => { 11 | resolve(false) 12 | } 13 | }) 14 | } 15 | } 16 | 17 | export default beforeClose 18 | -------------------------------------------------------------------------------- /phalapi/sdk/Objective-C/PhalApiClient/AFNPhalApiClient/AFNPhalApiClient.h: -------------------------------------------------------------------------------- 1 | // 2 | // AFNPhalApiClient.h 3 | // PhalApiClientDemo 4 | // 5 | // Created by Aevit on 15/10/18. 6 | // Copyright © 2015年 Aevit. All rights reserved. 7 | // 8 | 9 | #import "PhalApiClient.h" 10 | #import "AFHTTPRequestOperationManager.h" 11 | 12 | @interface AFNPhalApiClient : PhalApiClient 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /tests/e2e/plugins/index.js: -------------------------------------------------------------------------------- 1 | // https://docs.cypress.io/guides/guides/plugins-guide.html 2 | 3 | module.exports = (on, config) => Object.assign({}, config, { 4 | fixturesFolder: 'tests/e2e/fixtures', 5 | integrationFolder: 'tests/e2e/specs', 6 | screenshotsFolder: 'tests/e2e/screenshots', 7 | videosFolder: 'tests/e2e/videos', 8 | supportFile: 'tests/e2e/support/index.js' 9 | }) 10 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Cache/redis.php: -------------------------------------------------------------------------------- 1 | 2 |
3 | 4 |
5 | 6 | 7 | 12 | 13 | 28 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/language/zh_cn/common.php: -------------------------------------------------------------------------------- 1 | '{name}您好,欢迎使用PhalApi!', 12 | 'user not exists' => '用户不存在', 13 | '{0} I love you' => '{0} 我爱你', 14 | '{0} I love you because {1}' => '{0} 我爱你因为{1}', 15 | ); 16 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Request/Formatter.php: -------------------------------------------------------------------------------- 1 | 2015-11-07 11 | */ 12 | 13 | interface Formatter { 14 | 15 | public function parse($value, $rule); 16 | } 17 | -------------------------------------------------------------------------------- /tests/unit/HelloWorld.spec.js: -------------------------------------------------------------------------------- 1 | import { expect } from 'chai' 2 | import { shallow } from '@vue/test-utils' 3 | import HelloWorld from '@/components/HelloWorld.vue' 4 | 5 | describe('HelloWorld.vue', () => { 6 | it('renders props.msg when passed', () => { 7 | const msg = 'new message' 8 | const wrapper = shallow(HelloWorld, { 9 | propsData: { msg } 10 | }) 11 | expect(wrapper.text()).to.include(msg) 12 | }) 13 | }) 14 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Exception.php: -------------------------------------------------------------------------------- 1 | 2014-10-02 13 | */ 14 | 15 | class Exception extends \Exception { 16 | 17 | } 18 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/bin/crontab.php: -------------------------------------------------------------------------------- 1 | run(); 12 | } catch (Exception $ex) { 13 | echo $ex->getMessage(); 14 | echo "\n\n"; 15 | echo $ex->getTraceAsString(); 16 | // notify ... 17 | } 18 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/Runner/Remote/Connector/HttpConnector.php: -------------------------------------------------------------------------------- 1 | get('curl', 'PhalApi\CUrl'); 10 | 11 | return $curl->post($url, $data, $timeoutMs); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /src/view/components/markdown/markdown.vue: -------------------------------------------------------------------------------- 1 | 6 | 7 | 21 | 22 | 25 | -------------------------------------------------------------------------------- /src/view/error-page/404.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /src/view/error-page/401.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /src/view/error-page/500.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 20 | -------------------------------------------------------------------------------- /phalapi/sdk/JAVA/net/phalapi/sdk/PhalApiClientFilter.java: -------------------------------------------------------------------------------- 1 | package net.phalapi.sdk; 2 | 3 | import java.util.Map; 4 | 5 | /** 6 | * 接口过滤器 7 | * 8 | * - 可用于接口签名生成 9 | */ 10 | public interface PhalApiClientFilter { 11 | 12 | /** 13 | * 过滤操作 14 | * @param string service 接口服务名称 15 | * @param Map params 接口参数,注意是引用。可以直接修改 16 | * @return null 17 | */ 18 | public void filter(String service, Map params); 19 | } 20 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Database.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 13 | */ 14 | 15 | interface Database { 16 | 17 | public function connect(); 18 | 19 | public function disconnect(); 20 | } 21 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/sider-trigger/sider-trigger.less: -------------------------------------------------------------------------------- 1 | .trans{ 2 | transition: transform .2s ease; 3 | } 4 | @size: 40px; 5 | .sider-trigger-a{ 6 | padding: 6px; 7 | width: @size; 8 | height: @size; 9 | display: inline-block; 10 | text-align: center; 11 | color: #5c6b77; 12 | margin-top: 12px; 13 | i{ 14 | .trans; 15 | vertical-align: top; 16 | } 17 | &.collapsed i{ 18 | transform: rotateZ(90deg); 19 | .trans; 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/components/parent-view/parent-view.vue: -------------------------------------------------------------------------------- 1 | 6 | 21 | -------------------------------------------------------------------------------- /phalapi/vendor/composer/autoload_files.php: -------------------------------------------------------------------------------- 1 | $vendorDir . '/phalapi/kernal/src/bootstrap.php', 10 | '5cab427b0519bb4ddb2f894b03d1d957' => $vendorDir . '/phalapi/kernal/src/functions.php', 11 | 'dee36c56d6bb319b2a744b267373bb4b' => $baseDir . '/src/app/functions.php', 12 | ); 13 | -------------------------------------------------------------------------------- /src/components/main/components/side-menu/item-mixin.js: -------------------------------------------------------------------------------- 1 | export default { 2 | props: { 3 | parentItem: { 4 | type: Object, 5 | default: () => {} 6 | }, 7 | theme: String, 8 | iconSize: Number 9 | }, 10 | computed: { 11 | parentName () { 12 | return this.parentItem.name 13 | }, 14 | children () { 15 | return this.parentItem.children 16 | }, 17 | textColor () { 18 | return this.theme === 'dark' ? '#fff' : '#495060' 19 | } 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Filter/NoneFilter.php: -------------------------------------------------------------------------------- 1 | 2015-10-23 13 | */ 14 | 15 | class NoneFilter implements Filter { 16 | 17 | public function check() { 18 | // nothing here ... 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Response/ExplorerResponse.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 13 | */ 14 | 15 | class ExplorerResponse extends Response { 16 | 17 | protected function formatResult($result) { 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /src/plugin/error-store/index.js: -------------------------------------------------------------------------------- 1 | import store from '@/store' 2 | export default { 3 | install (Vue, options) { 4 | if (options.developmentOff && process.env.NODE_ENV === 'development') return 5 | Vue.config.errorHandler = (error, vm, mes) => { 6 | let info = { 7 | type: 'script', 8 | code: 0, 9 | mes: error.message, 10 | url: window.location.href 11 | } 12 | Vue.nextTick(() => { 13 | store.dispatch('addErrorLog', info) 14 | }) 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Config/yaconf.php: -------------------------------------------------------------------------------- 1 | 10 | 11 | @interface PhalApiClientFilter : NSObject 12 | 13 | /** 14 | * 接口过滤器 15 | * 可用于接口签名生成 16 | * 17 | * @param service 接口服务名称 18 | * @param params 接口参数,注意是mutable变量,可以直接修改 19 | */ 20 | - (void)filter:(NSString*)service params:(NSMutableDictionary*)params; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/notorm/tests/Lite_Test.php: -------------------------------------------------------------------------------- 1 | setStructure($structure); 14 | 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /phalapi/sdk/C_Sharp/PhalApiClient/PhalApiClientParser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace PhalApiClientSDK 7 | { 8 | /** 9 | * 接口结果解析器 10 | * 11 | * - 可用于不同接口返回格式的处理 12 | */ 13 | public interface PhalApiClientParser 14 | { 15 | 16 | /** 17 | * 结果解析 18 | * @param String apiResult 19 | * @return PhalApiClientResponse 20 | */ 21 | PhalApiClientResponse parse(String apiResult); 22 | } 23 | 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/components/paste-editor/paste-editor.less: -------------------------------------------------------------------------------- 1 | .paste-editor-wrapper{ 2 | width: 100%; 3 | height: 100%; 4 | border: 1px dashed gainsboro; 5 | textarea.textarea-el{ 6 | width: 100%; 7 | height: 100%; 8 | } 9 | .CodeMirror{ 10 | height: 100%; 11 | padding: 0; 12 | .CodeMirror-code div .CodeMirror-line > span > span.cm-tab{ 13 | &::after{ 14 | content: '→'; 15 | color: #BFBFBF; 16 | } 17 | } 18 | } 19 | .first-row{ 20 | font-weight: 700; 21 | font-size: 14px; 22 | } 23 | .incorrect-row{ 24 | background: #F5CBD1; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/config/dbs.php: -------------------------------------------------------------------------------- 1 | array( 11 | // 10张表,可根据需要,自行调整表前缀、主键名和路由 12 | 'task_mq' => array( 13 | 'prefix' => 'tbl_', 14 | 'key' => 'id', 15 | 'map' => array( 16 | array('db' => 'db_master'), 17 | array('start' => 0, 'end' => 9, 'db' => 'db_master'), 18 | ), 19 | ), 20 | ) 21 | ); 22 | 23 | 24 | -------------------------------------------------------------------------------- /phalapi/data/phalapi.sql: -------------------------------------------------------------------------------- 1 | 2 | DROP TABLE IF EXISTS `tbl_curd`; 3 | CREATE TABLE `tbl_curd` ( 4 | `id` int(10) NOT NULL AUTO_INCREMENT, 5 | `title` varchar(20) DEFAULT NULL, 6 | `content` text, 7 | `state` tinyint(4) DEFAULT NULL, 8 | `post_date` datetime DEFAULT NULL, 9 | PRIMARY KEY (`id`) 10 | ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8; 11 | 12 | INSERT INTO `tbl_curd` VALUES ('1', 'PhalApi', '欢迎使用PhalApi 2.x 版本!', '0', '2017-07-08 12:09:43'); 13 | INSERT INTO `tbl_curd` VALUES ('2', '版本更新', '主要改用composer和命名空间,并遵循psr-4规范。', '1', '2017-07-08 12:10:58'); 14 | -------------------------------------------------------------------------------- /phalapi/sdk/Go/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import ( 4 | "./PhalApiClient" 5 | "fmt" 6 | "net/url" 7 | ) 8 | 9 | func main() { 10 | rs, err := PhalApiClient.NewRequest(). 11 | WithHost(`http://127.0.0.1/PhalApi/Public/index.php`). 12 | WithService("Default.index"). 13 | WithParams(url.Values{}). 14 | Get() 15 | if err != nil { 16 | fmt.Println(err.Error()) 17 | } else { 18 | fmt.Println("code------------------------", rs.Code) 19 | fmt.Println("data------------------------", rs.Data) 20 | fmt.Println("msg------------------------", rs.Msg) 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /phalapi/sdk/Objective-C/PhalApiClient/PhalApiClientFilter.m: -------------------------------------------------------------------------------- 1 | // 2 | // PhalApiClientFilter.m 3 | // PhalApiClientDemo 4 | // 5 | // Created by Aevit on 15/10/18. 6 | // Copyright © 2015年 Aevit. All rights reserved. 7 | // 8 | 9 | #import "PhalApiClientFilter.h" 10 | 11 | @implementation PhalApiClientFilter 12 | 13 | /** 14 | * 接口过滤器 15 | * 可用于接口签名生成 16 | * 17 | * @param service 接口服务名称 18 | * @param params 接口参数,注意是mutable变量,可以直接修改 19 | */ 20 | - (void)filter:(NSString*)service params:(NSMutableDictionary*)params { 21 | // 在此对接口进行过滤 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/README.md: -------------------------------------------------------------------------------- 1 | # PhalApi 2.x 核心框架 2 | 3 | [![Latest Stable Version](https://poser.pugx.org/phalapi/kernal/v/stable)](https://packagist.org/packages/phalapi/kernal) 4 | [![Total Downloads](https://poser.pugx.org/phalapi/kernal/downloads)](https://packagist.org/packages/phalapi/kernal) 5 | [![Latest Unstable Version](https://poser.pugx.org/phalapi/kernal/v/unstable)](https://packagist.org/packages/phalapi/kernal) 6 | [![License](https://poser.pugx.org/phalapi/kernal/license)](https://packagist.org/packages/phalapi/kernal) 7 | 8 | 9 | PhalApi 2.x 框架核心部分,基于composer。 10 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Request/Formatter/CallbackFormatter.php: -------------------------------------------------------------------------------- 1 | 2017-04-19 16 | */ 17 | 18 | 19 | class CallbackFormatter extends CallableFormatter { 20 | } 21 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/config/app.php: -------------------------------------------------------------------------------- 1 | array( 5 | 'from' => array('name' => 'from', 'default' => 'phpunit'), 6 | ), 7 | 8 | /** 9 | * 接口服务白名单,格式:接口服务类名.接口服务方法名 10 | * 11 | * 示例: 12 | * - *.* 通配,全部接口服务,慎用! 13 | * - Default.* Api_Default接口类的全部方法 14 | * - *.Index 全部接口类的Index方法 15 | * - Default.Index 指定某个接口服务,即Api_Default::Index() 16 | */ 17 | 'service_whitelist' => array( 18 | '*.Index', 19 | 'ServiceWhitelist.PoPo', 20 | ), 21 | ); 22 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ.php: -------------------------------------------------------------------------------- 1 | 20150516 10 | */ 11 | 12 | interface MQ { 13 | 14 | /** 15 | * 单个添加 16 | * @param string $service 接口服务名称,如:Site.Index 17 | * @param array $params 接口服务参数 18 | */ 19 | public function add($service, $params = array()); 20 | 21 | /** 22 | * 批量弹出 23 | * @param string $service 需要获取的接口服务名称 24 | * @param int $num 弹出的个数 25 | */ 26 | public function pop($service, $num = 1); 27 | } 28 | -------------------------------------------------------------------------------- /src/components/main/components/side-menu/mixin.js: -------------------------------------------------------------------------------- 1 | import CommonIcon from '_c/common-icon' 2 | import { showTitle } from '@/libs/util' 3 | export default { 4 | components: { 5 | CommonIcon 6 | }, 7 | methods: { 8 | showTitle (item) { 9 | return showTitle(item, this) 10 | }, 11 | showChildren (item) { 12 | return item.children && (item.children.length > 1 || (item.meta && item.meta.showAlways)) 13 | }, 14 | getNameOrHref (item, children0) { 15 | return item.href ? `isTurnByHref_${item.href}` : (children0 ? item.children[0].name : item.name) 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /phalapi/config/sys.php: -------------------------------------------------------------------------------- 1 | 2017-07-13 8 | */ 9 | 10 | return array( 11 | /** 12 | * 默认环境配置 13 | */ 14 | 'debug' => false, 15 | 16 | /** 17 | * MC缓存服务器参考配置 18 | */ 19 | 'mc' => array( 20 | 'host' => '127.0.0.1', 21 | 'port' => 11211, 22 | ), 23 | 24 | /** 25 | * 加密 26 | */ 27 | 'crypt' => array( 28 | 'mcrypt_iv' => '12345678', //8位 29 | ), 30 | ); 31 | -------------------------------------------------------------------------------- /phalapi/public/init.php: -------------------------------------------------------------------------------- 1 | debug) { 20 | // 启动追踪器 21 | \PhalApi\DI()->tracer->mark('PHALAPI_INIT'); 22 | 23 | error_reporting(E_ALL); 24 | ini_set('display_errors', 'On'); 25 | } 26 | 27 | // 翻译语言包设定 28 | \PhalApi\SL('zh_cn'); 29 | -------------------------------------------------------------------------------- /phalapi/vendor/composer/autoload_psr4.php: -------------------------------------------------------------------------------- 1 | array($vendorDir . '/phalapi/task/src'), 10 | 'PhalApi\\QrCode\\' => array($vendorDir . '/phalapi/qrcode/src'), 11 | 'PhalApi\\NotORM\\' => array($vendorDir . '/phalapi/notorm/src'), 12 | 'PhalApi\\CLI\\' => array($vendorDir . '/phalapi/cli/src'), 13 | 'PhalApi\\' => array($vendorDir . '/phalapi/kernal/src'), 14 | 'App\\' => array($baseDir . '/src/app'), 15 | ); 16 | -------------------------------------------------------------------------------- /phalapi/sdk/C_Sharp/PhalApiClient/PhalApiClientFilter.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | 6 | namespace PhalApiClientSDK 7 | { 8 | /** 9 | * 接口过滤器 10 | * 11 | * - 可用于接口签名生成 12 | */ 13 | public interface PhalApiClientFilter { 14 | 15 | /** 16 | * 过滤操作 17 | * @param string service 接口服务名称 18 | * @param Map params 接口参数,注意是引用。可以直接修改 19 | * @return null 20 | */ 21 | void filter(String service, Dictionary paramsList); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /public/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 14 |
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /phalapi/tests/bootstrap.php: -------------------------------------------------------------------------------- 1 | logger = new ExplorerLogger( 21 | Logger::LOG_LEVEL_DEBUG | Logger::LOG_LEVEL_INFO | Logger::LOG_LEVEL_ERROR); 22 | 23 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Cache/NoneCache.php: -------------------------------------------------------------------------------- 1 | 2015-02-04 13 | */ 14 | 15 | class NoneCache implements Cache { 16 | 17 | public function set($key, $value, $expire = 600) { 18 | } 19 | 20 | public function get($key) { 21 | return NULL; 22 | } 23 | 24 | public function delete($key) { 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/notorm/src/NotORM/Literal.php: -------------------------------------------------------------------------------- 1 | value = $value; 18 | $this->parameters = func_get_args(); 19 | array_shift($this->parameters); 20 | } 21 | 22 | /** Get literal value 23 | * @return string 24 | */ 25 | function __toString() { 26 | return $this->value; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/DBMQ.php: -------------------------------------------------------------------------------- 1 | 20150516 13 | */ 14 | 15 | class DBMQ implements MQ { 16 | 17 | public function add($service, $params = array()) { 18 | $model = new TaskMq(); 19 | return $model->add($service, $params); 20 | } 21 | 22 | public function pop($service, $num = 1) { 23 | $model = new TaskMq(); 24 | return $model->pop($service, $num); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/components/icons/icons.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 32 | 33 | 36 | -------------------------------------------------------------------------------- /phalapi/sdk/Objective-C/XSHttpTool/Singleton.h: -------------------------------------------------------------------------------- 1 | // .h 2 | #define singleton_interface(class) + (instancetype)shared##class; 3 | 4 | // .m 5 | #define singleton_implementation(class) \ 6 | static class *_instance; \ 7 | \ 8 | + (id)allocWithZone:(struct _NSZone *)zone \ 9 | { \ 10 | static dispatch_once_t onceToken; \ 11 | dispatch_once(&onceToken, ^{ \ 12 | _instance = [super allocWithZone:zone]; \ 13 | }); \ 14 | \ 15 | return _instance; \ 16 | } \ 17 | \ 18 | + (instancetype)shared##class \ 19 | { \ 20 | if (_instance == nil) { \ 21 | _instance = [[class alloc] init]; \ 22 | } \ 23 | \ 24 | return _instance; \ 25 | } 26 | 27 | -------------------------------------------------------------------------------- /src/directive/index.js: -------------------------------------------------------------------------------- 1 | import directive from './directives' 2 | 3 | const importDirective = Vue => { 4 | /** 5 | * 拖拽指令 v-draggable="options" 6 | * options = { 7 | * trigger: /这里传入作为拖拽触发器的CSS选择器/, 8 | * body: /这里传入需要移动容器的CSS选择器/, 9 | * recover: /拖动结束之后是否恢复到原来的位置/ 10 | * } 11 | */ 12 | Vue.directive('draggable', directive.draggable) 13 | /** 14 | * clipboard指令 v-draggable="options" 15 | * options = { 16 | * value: /在输入框中使用v-model绑定的值/, 17 | * success: /复制成功后的回调/, 18 | * error: /复制失败后的回调/ 19 | * } 20 | */ 21 | Vue.directive('clipboard', directive.clipboard) 22 | } 23 | 24 | export default importDirective 25 | -------------------------------------------------------------------------------- /src/view/error-page/error-content.vue: -------------------------------------------------------------------------------- 1 | 13 | 14 | 29 | -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python2.x/PhalApiClient.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 3 | import json, urllib, urllib2 4 | 5 | def PhalApiClient(host, service = None, params = None, timeout = None): 6 | url = host + ('' if service is None else ('?service=' + service)) 7 | if params is not None: 8 | assert type(params) is dict, 'params type must be dict' 9 | assert params, 'params must is valid values' 10 | params = urllib.urlencode(params) 11 | request = urllib2.Request(url) 12 | response = urllib2.urlopen(request, data = params, timeout = timeout) 13 | return {'info': response.info(), 'state': response.getcode(), 'data': json.loads(response.read())} -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Exception/RedirectException.php: -------------------------------------------------------------------------------- 1 | 2017-07-01 15 | */ 16 | 17 | class RedirectException extends Exception { 18 | 19 | public function __construct($message, $code = 0) { 20 | parent::__construct( 21 | \PhalApi\T('Redirect: {message}', array('message' => $message)), 300 + $code 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Response/XmlResponse.php: -------------------------------------------------------------------------------- 1 | 2017-07-15 14 | */ 15 | 16 | class XmlResponse extends Response { 17 | 18 | public function __construct() { 19 | $this->addHeaders('Content-Type', 'text/html;charset=utf-8'); 20 | } 21 | 22 | protected function formatResult($result) { 23 | return Tool::arrayToXml($result); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Exception/BadRequestException.php: -------------------------------------------------------------------------------- 1 | 2015-02-05 15 | */ 16 | 17 | class BadRequestException extends Exception { 18 | 19 | public function __construct($message, $code = 0) { 20 | parent::__construct( 21 | \PhalApi\T('Bad Request: {message}', array('message' => $message)), 400 + $code 22 | ); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Filter.php: -------------------------------------------------------------------------------- 1 | 实现和使用示例:
10 | ``` 11 | * class MyFilter implements Filter { 12 | * 13 | * public function check() { 14 | * //TODO 15 | * } 16 | * } 17 | * 18 | * //$ vim ./Public/init.php 19 | * //注册签名验证服务 20 | * DI()->filter = 'MyFilter'; 21 | ``` 22 | * 23 | * @package PhalApi\Filter 24 | * @license http://www.phalapi.net/license GPL 协议 25 | * @link http://www.phalapi.net/ 26 | * @author dogstar 2014-10-25 27 | */ 28 | 29 | interface Filter { 30 | 31 | public function check(); 32 | } 33 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/notorm/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phalapi/notorm", 3 | "description": "基于NotORM类库的优化版本,专门用于PhalApi 2.x 开源接口框架。", 4 | "keywords": ["api", "notorm", "phalapi"], 5 | "homepage": "http://www.phalapi.net", 6 | "license" : "GPL-3.0+", 7 | "authors": [ 8 | { 9 | "name": "Dogstar Huang", 10 | "email": "chanzonghuang@gmail.com", 11 | "homepage" : "http://my.oschina.net/dogstar", 12 | "role": "Developer" 13 | } 14 | ], 15 | "require": { 16 | "php": ">=5.3.3" 17 | }, 18 | "autoload": { 19 | "psr-4": { 20 | "PhalApi\\NotORM\\": "src" 21 | } 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python3.x/PhalApiClient.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 3 | import json 4 | from urllib import request, parse 5 | 6 | def PhalApiClient(host, service = None, params = None, timeout = None): 7 | url = host + ('' if service is None else ('?service=' + service)) 8 | if params is not None: 9 | assert type(params) is dict, 'params type must be dict' 10 | assert params, 'params must is valid values' 11 | params = parse.urlencode(params) 12 | _request = request.Request(url) 13 | response = request.urlopen(_request, data = params, timeout = timeout) 14 | return {'info': response.info(), 'state': response.getcode(), 'data': json.loads(response.read())} -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Cache/apcu.php: -------------------------------------------------------------------------------- 1 | 2015-02-05 13 | */ 14 | 15 | class InternalServerErrorException extends Exception { 16 | 17 | public function __construct($message, $code = 0) { 18 | parent::__construct( 19 | \PhalApi\T('Interal Server Error: {message}', array('message' => $message)), 500 + $code 20 | ); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/sider-trigger/sider-trigger.vue: -------------------------------------------------------------------------------- 1 | 4 | 25 | 28 | -------------------------------------------------------------------------------- /src/view/components/editor/editor.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 30 | 31 | 34 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Helper/ApiOnline.php: -------------------------------------------------------------------------------- 1 | 2017-11-22 11 | */ 12 | 13 | class ApiOnline { 14 | 15 | protected $projectName; 16 | 17 | public function __construct($projectName) { 18 | $this->projectName = $projectName; 19 | } 20 | 21 | /** 22 | * @param string $tplPath 模板绝对路径 23 | */ 24 | public function render($tplPath = NULL) { 25 | header('Content-Type:text/html;charset=utf-8'); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /phalapi/sdk/C_Sharp/PhalApiClient/PhalApiClientParserJson.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json; 2 | using System; 3 | 4 | namespace PhalApiClientSDK 5 | { 6 | /** 7 | * JSON解析 8 | */ 9 | public class PhalApiClientParserJson : PhalApiClientParser { 10 | 11 | public PhalApiClientResponse parse(String apiResult) { 12 | if (apiResult == null) { 13 | return new PhalApiClientResponse(408, "", "Request Timeout"); 14 | } 15 | 16 | try { 17 | 18 | return JsonConvert.DeserializeObject(apiResult); 19 | } catch (Exception ex) { 20 | return new PhalApiClientResponse(500, "", "Internal Server Error: " + ex.Message); 21 | } 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /src/mock/data.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { doCustomTimes } from '@/libs/util' 3 | const Random = Mock.Random 4 | 5 | export const getTableData = req => { 6 | let tableData = [] 7 | doCustomTimes(5, () => { 8 | tableData.push(Mock.mock({ 9 | name: '@name', 10 | email: '@email', 11 | createTime: '@date' 12 | })) 13 | }) 14 | return tableData 15 | } 16 | 17 | export const getDragList = req => { 18 | let dragList = [] 19 | doCustomTimes(5, () => { 20 | dragList.push(Mock.mock({ 21 | name: Random.csentence(10, 13), 22 | id: Random.increment(10) 23 | })) 24 | }) 25 | return dragList 26 | } 27 | 28 | export const uploadImage = req => { 29 | return Promise.resolve() 30 | } 31 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/data/phalapi_task_progress.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE `tbl_task_progress` ( 2 | `id` bigint(20) NOT NULL AUTO_INCREMENT, 3 | `title` varchar(200) DEFAULT '' COMMENT '任务标题', 4 | `trigger_class` varchar(50) DEFAULT '' COMMENT '触发器类名', 5 | `fire_params` varchar(255) DEFAULT '' COMMENT '需要传递的参数,格式自定', 6 | `interval_time` int(11) DEFAULT '0' COMMENT '执行间隔,单位:秒', 7 | `enable` tinyint(1) DEFAULT '1' COMMENT '是否启动,1启动,0禁止', 8 | `result` varchar(255) DEFAULT '' COMMENT '运行的结果,以json格式保存', 9 | `state` tinyint(1) DEFAULT '0' COMMENT '进程状态,0空闲,1运行中,-1异常退出', 10 | `last_fire_time` int(11) DEFAULT '0' COMMENT '上一次运行时间', 11 | PRIMARY KEY (`id`) 12 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 13 | 14 | -------------------------------------------------------------------------------- /phalapi/sdk/JAVA/net/phalapi/sdk/PhalApiClientParserJson.java: -------------------------------------------------------------------------------- 1 | package net.phalapi.sdk; 2 | 3 | import org.json.JSONObject; 4 | 5 | /** 6 | * JSON解析 7 | */ 8 | public class PhalApiClientParserJson implements PhalApiClientParser { 9 | 10 | public PhalApiClientResponse parse(String apiResult) { 11 | if (apiResult == null) { 12 | return new PhalApiClientResponse(408, "", "Request Timeout"); 13 | } 14 | 15 | try { 16 | JSONObject jsonObj = new JSONObject(apiResult); 17 | 18 | return new PhalApiClientResponse( 19 | jsonObj.getInt("ret"), jsonObj.getString("data"), jsonObj.getString("msg")); 20 | } catch (Exception ex) { 21 | return new PhalApiClientResponse(500, "", "Internal Server Error Or " + ex.getMessage()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /tests/e2e/support/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands' 18 | 19 | // Alternatively you can use CommonJS syntax: 20 | // require('./commands') 21 | -------------------------------------------------------------------------------- /src/view/argu-page/query.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /phalapi/config/app.php: -------------------------------------------------------------------------------- 1 | 2017-07-13 8 | */ 9 | 10 | return array( 11 | 12 | /** 13 | * 应用接口层的统一参数 14 | */ 15 | 'apiCommonRules' => array( 16 | //'sign' => array('name' => 'sign', 'require' => true), 17 | ), 18 | 19 | /** 20 | * 接口服务白名单,格式:接口服务类名.接口服务方法名 21 | * 22 | * 示例: 23 | * - *.* 通配,全部接口服务,慎用! 24 | * - Site.* Api_Default接口类的全部方法 25 | * - *.Index 全部接口类的Index方法 26 | * - Site.Index 指定某个接口服务,即Api_Default::Index() 27 | */ 28 | 'service_whitelist' => array( 29 | 'Site.Index', 30 | ), 31 | ); 32 | -------------------------------------------------------------------------------- /src/view/argu-page/params.vue: -------------------------------------------------------------------------------- 1 | 9 | 10 | 33 | 34 | 37 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt.php: -------------------------------------------------------------------------------- 1 | 2014-12-10 11 | */ 12 | 13 | interface Crypt { 14 | 15 | /** 16 | * 对称加密 17 | * 18 | * @param mixed $data 等加密的数据 19 | * @param string $key 加密的key 20 | * @return mixed 加密后的数据 21 | */ 22 | public function encrypt($data, $key); 23 | 24 | /** 25 | * 对称解密 26 | * 27 | * @see Crypt::encrypt() 28 | * @param mixed $data 对称加密后的内容 29 | * @param string $key 加密的key 30 | * @return mixed 解密后的数据 31 | */ 32 | public function decrypt($data, $key); 33 | } 34 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phalapi/task", 3 | "description": "PhalApi 2.x 扩展类库 - Task计划任务,以接口服务形式实现的新型计划任务。", 4 | "keywords": [ 5 | "phalapi", "phalapi-task", "task" 6 | ], 7 | "license": "GPL-3.0+", 8 | "homepage": "https://www.phalapi.net/", 9 | "type": "library", 10 | "minimum-stability": "dev", 11 | "authors": [ 12 | { 13 | "name": "dogstar huang", 14 | "email": "chanzonghuang@gmail.com", 15 | "homepage": "http://my.oschina.net/dogstar", 16 | "role": "Developer" 17 | } 18 | ], 19 | "require": { 20 | "php": ">=5.3.3" 21 | }, 22 | "autoload": { 23 | "psr-4": { 24 | "PhalApi\\Task\\": "src" 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/Task_Progress_Test.php: -------------------------------------------------------------------------------- 1 | taskProgress = new PhalApi\Task\Progress(); 21 | } 22 | 23 | protected function tearDown() 24 | { 25 | } 26 | 27 | 28 | /** 29 | * @group testRun 30 | */ 31 | public function testRun() 32 | { 33 | $rs = $this->taskProgress->run(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/view/login/login.less: -------------------------------------------------------------------------------- 1 | .login{ 2 | width: 100%; 3 | height: 100%; 4 | background-image: url('../../assets/images/login-bg.jpg'); 5 | background-size: cover; 6 | background-position: center; 7 | position: relative; 8 | &-con{ 9 | position: absolute; 10 | right: 160px; 11 | top: 50%; 12 | transform: translateY(-60%); 13 | width: 300px; 14 | &-header{ 15 | font-size: 16px; 16 | font-weight: 300; 17 | text-align: center; 18 | padding: 30px 0; 19 | } 20 | .form-con{ 21 | padding: 10px 0 0; 22 | } 23 | .login-tip{ 24 | font-size: 10px; 25 | text-align: center; 26 | color: #c3c3c3; 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/components/tables/handle-btns.js: -------------------------------------------------------------------------------- 1 | const btns = { 2 | delete: (h, params, vm) => { 3 | return h('Poptip', { 4 | props: { 5 | confirm: true, 6 | title: '你确定要删除吗?' 7 | }, 8 | on: { 9 | 'on-ok': () => { 10 | vm.$emit('on-delete', params) 11 | vm.$emit('input', params.tableData.filter((item, index) => index !== params.row.initRowIndex)) 12 | } 13 | } 14 | }, [ 15 | h('Button', { 16 | props: { 17 | type: 'text', 18 | ghost: true 19 | } 20 | }, [ 21 | h('Icon', { 22 | props: { 23 | type: 'md-trash', 24 | size: 18, 25 | color: '#000000' 26 | } 27 | }) 28 | ]) 29 | ]) 30 | } 31 | } 32 | 33 | export default btns 34 | -------------------------------------------------------------------------------- /src/api/data.js: -------------------------------------------------------------------------------- 1 | import axios from '@/libs/api.request' 2 | 3 | export const getTableData = () => { 4 | return axios.request({ 5 | url: 'api/Data.GetTableData', 6 | method: 'get' 7 | }) 8 | } 9 | 10 | export const getDragList = () => { 11 | return axios.request({ 12 | url: 'api/Data.GetDragList', 13 | method: 'get' 14 | }) 15 | } 16 | 17 | export const errorReq = () => { 18 | return axios.request({ 19 | url: 'api/Data.ErrorUrl', 20 | method: 'post' 21 | }) 22 | } 23 | 24 | export const saveErrorLogger = info => { 25 | return axios.request({ 26 | url: 'api/Data.SaveErrorLogger', 27 | data: info, 28 | method: 'post' 29 | }) 30 | } 31 | 32 | export const uploadImg = formData => { 33 | return axios.request({ 34 | url: 'api/Image.Upload', 35 | data: formData 36 | }) 37 | } 38 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/Progress/Trigger/CommonTrigger.php: -------------------------------------------------------------------------------- 1 | 20150520 10 | */ 11 | 12 | class CommonTrigger implements Trigger { 13 | 14 | public function fire($params) { 15 | $paramsArr = explode('&', $params); 16 | 17 | $service = !empty($paramsArr[0]) ? trim($paramsArr[0]) : ''; 18 | $mqClass = !empty($paramsArr[1]) ? trim($paramsArr[1]) : 'PhalApi\Task\MQ\FileMQ'; 19 | $runnerClass = !empty($paramsArr[2]) ? trim($paramsArr[2]) : 'PhalApi\Task\Runner\LocalRunner'; 20 | 21 | $mq = new $mqClass(); 22 | $runner = new $runnerClass($mq); 23 | 24 | return $runner->go($service); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/mock/login.js: -------------------------------------------------------------------------------- 1 | import { getParams } from '@/libs/util' 2 | const USER_MAP = { 3 | super_admin: { 4 | name: 'super_admin', 5 | user_id: '1', 6 | access: ['super_admin', 'admin'], 7 | token: 'super_admin', 8 | avator: 'https://file.iviewui.com/dist/a0e88e83800f138b94d2414621bd9704.png' 9 | }, 10 | admin: { 11 | name: 'admin', 12 | user_id: '2', 13 | access: ['admin'], 14 | token: 'admin', 15 | avator: 'https://avatars0.githubusercontent.com/u/20942571?s=460&v=4' 16 | } 17 | } 18 | 19 | export const login = req => { 20 | req = JSON.parse(req.body) 21 | return { token: USER_MAP[req.userName].token } 22 | } 23 | 24 | export const getUserInfo = req => { 25 | const params = getParams(req.url) 26 | return USER_MAP[params.token] 27 | } 28 | 29 | export const logout = req => { 30 | return null 31 | } 32 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phalapi/kernal", 3 | "description": "PhalApi 2.x 框架核心部分。", 4 | "keywords": [ 5 | "api", "phalapi", "framework" 6 | ], 7 | "license": "GPL-3.0+", 8 | "homepage": "https://www.phalapi.net/", 9 | "authors": [ 10 | { 11 | "name": "Dogstar Huang", 12 | "email": "chanzonghuang@gmail.com", 13 | "homepage": "http://my.oschina.net/dogstar", 14 | "role": "Developer" 15 | }, 16 | { 17 | "name": "kwan", 18 | "email": "303198069@qq.com", 19 | "role": "Developer" 20 | } 21 | ], 22 | "require": { 23 | "php": ">=5.3.3", 24 | "phalapi/notorm": "2.2.1" 25 | }, 26 | "autoload": { 27 | "files": [ 28 | "src/bootstrap.php", 29 | "src/functions.php" 30 | ], 31 | "psr-4": { 32 | "PhalApi\\": "src" 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Cache.php: -------------------------------------------------------------------------------- 1 | 2015-02-04 11 | */ 12 | 13 | interface Cache { 14 | 15 | /** 16 | * 设置缓存 17 | * 18 | * @param string $key 缓存key 19 | * @param mixed $value 缓存的内容 20 | * @param int $expire 缓存有效时间,单位秒,非时间戳 21 | */ 22 | public function set($key, $value, $expire = 600); 23 | 24 | /** 25 | * 读取缓存 26 | * 27 | * @param string $key 缓存key 28 | * @return mixed 失败情况下返回NULL 29 | */ 30 | public function get($key); 31 | 32 | /** 33 | * 删除缓存 34 | * 35 | * @param string $key 36 | */ 37 | public function delete($key); 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Cache/MemcachedCache.php: -------------------------------------------------------------------------------- 1 | 2014-11-14 15 | */ 16 | 17 | class MemcachedCache extends MemcacheCache { 18 | 19 | /** 20 | * 注意参数的微妙区别 21 | */ 22 | public function set($key, $value, $expire = 600) { 23 | $this->memcache->set($this->formatKey($key), @serialize($value), $expire); 24 | } 25 | 26 | /** 27 | * 返回更高版本的MC实例 28 | * @return Memcached 29 | */ 30 | protected function createMemcache() { 31 | return new \Memcached(); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/app.php: -------------------------------------------------------------------------------- 1 | 2015-11-07 14 | */ 15 | 16 | class IntFormatter extends BaseFormatter implements Formatter { 17 | 18 | /** 19 | * 对整型进行格式化 20 | * 21 | * @param mixed $value 变量值 22 | * @param array $rule array('min' => '最小值', 'max' => '最大值') 23 | * @return int/string 格式化后的变量 24 | * 25 | */ 26 | public function parse($value, $rule) { 27 | return intval($this->filterByRange(intval($value), $rule)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/ArrayMQ.php: -------------------------------------------------------------------------------- 1 | 20150516 13 | */ 14 | 15 | class ArrayMQ implements MQ { 16 | 17 | protected $list = array(); 18 | 19 | public function add($service, $params = array()) { 20 | if (!isset($this->list[$service])) { 21 | $this->list[$service] = array(); 22 | } 23 | 24 | $this->list[$service][] = $params; 25 | 26 | return TRUE; 27 | } 28 | 29 | public function pop($service, $num = 1) { 30 | if (empty($this->list[$service])) { 31 | return array(); 32 | } 33 | 34 | $rs = array_splice($this->list[$service], 0, $num); 35 | 36 | return $rs; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Request/Formatter/FloatFormatter.php: -------------------------------------------------------------------------------- 1 | 2015-11-07 14 | */ 15 | 16 | class FloatFormatter extends BaseFormatter implements Formatter { 17 | 18 | /** 19 | * 对浮点型进行格式化 20 | * 21 | * @param mixed $value 变量值 22 | * @param array $rule array('min' => '最小值', 'max' => '最大值') 23 | * @return float/string 格式化后的变量 24 | * 25 | */ 26 | public function parse($value, $rule) { 27 | return floatval($this->filterByRange(floatval($value), $rule)); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/components/main/components/side-menu/side-menu.less: -------------------------------------------------------------------------------- 1 | .side-menu-wrapper{ 2 | user-select: none; 3 | .menu-collapsed{ 4 | padding-top: 10px; 5 | 6 | .ivu-dropdown{ 7 | width: 100%; 8 | .ivu-dropdown-rel a{ 9 | width: 100%; 10 | } 11 | } 12 | .ivu-tooltip{ 13 | width: 100%; 14 | .ivu-tooltip-rel{ 15 | width: 100%; 16 | } 17 | .ivu-tooltip-popper .ivu-tooltip-content{ 18 | .ivu-tooltip-arrow{ 19 | border-right-color: #fff; 20 | } 21 | .ivu-tooltip-inner{ 22 | background: #fff; 23 | color: #495060; 24 | } 25 | } 26 | } 27 | 28 | 29 | } 30 | a.drop-menu-a{ 31 | display: inline-block; 32 | padding: 6px 15px; 33 | width: 100%; 34 | text-align: center; 35 | color: #495060; 36 | } 37 | } 38 | .menu-title{ 39 | padding-left: 6px; 40 | } 41 | -------------------------------------------------------------------------------- /src/config/index.js: -------------------------------------------------------------------------------- 1 | export default { 2 | /** 3 | * @description 配置显示在浏览器标签的title 4 | */ 5 | title: 'PhalApi-iView-admin', 6 | /** 7 | * @description token在Cookie中存储的天数,默认1天 8 | */ 9 | cookieExpires: 1, 10 | /** 11 | * @description 是否使用国际化,默认为false 12 | * 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'} 13 | * 用来在菜单中显示文字 14 | */ 15 | useI18n: true, 16 | /** 17 | * @description api请求基础路径 18 | */ 19 | baseUrl: { 20 | dev: 'http://iview-admin.phalapi.net', 21 | pro: 'http://iview-admin.phalapi.net' 22 | }, 23 | /** 24 | * @description 默认打开的首页的路由name值,默认为home 25 | */ 26 | homeName: 'home', 27 | /** 28 | * @description 需要加载的插件 29 | */ 30 | plugin: { 31 | 'error-store': { 32 | showInHeader: true, // 设为false后不会在顶部显示错误日志徽标 33 | developmentOff: true // 设为true后在开发环境不会收集错误信息,方便开发中排查错误 34 | } 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/view/error-page/back-btn-group.vue: -------------------------------------------------------------------------------- 1 | 7 | 8 | 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/FileMQ.php: -------------------------------------------------------------------------------- 1 | 20150516 13 | */ 14 | 15 | class FileMQ extends KeyValueMQ { 16 | 17 | public function __construct(PhalApi_Cache_File $fileCache = NULL) { 18 | if ($fileCache === NULL) { 19 | $config = \PhalApi\DI()->config->get('app.Task.mq.file'); 20 | if (!isset($config['path'])) { 21 | $config['path'] = API_ROOT . '/Runtime'; 22 | } 23 | if (!isset($config['prefix'])) { 24 | $config['prefix'] = 'phalapi_task'; 25 | } 26 | 27 | $fileCache = new FileCache($config); 28 | } 29 | 30 | parent::__construct($fileCache); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Response/JsonResponse.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 13 | */ 14 | 15 | class JsonResponse extends Response { 16 | 17 | /** 18 | * @var int JSON常量组合的二进制掩码 19 | * @see http://php.net/manual/en/json.constants.php 20 | */ 21 | protected $options; 22 | 23 | public function __construct($options = 0) { 24 | $this->options = $options; 25 | 26 | $this->addHeaders('Content-Type', 'application/json;charset=utf-8'); 27 | } 28 | 29 | protected function formatResult($result) { 30 | return json_encode($result, $this->options); 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt/RSA/KeyGenerator.php: -------------------------------------------------------------------------------- 1 | 2015-03-15 13 | */ 14 | 15 | class KeyGenerator { 16 | 17 | protected $privkey; 18 | 19 | protected $pubkey; 20 | 21 | public function __construct() { 22 | $res = openssl_pkey_new(); 23 | openssl_pkey_export($res, $privkey); 24 | $this->privkey = $privkey; 25 | 26 | $pubkey = openssl_pkey_get_details($res); 27 | $this->pubkey = $pubkey['key']; 28 | } 29 | 30 | public function getPriKey() { 31 | return $this->privkey; 32 | } 33 | 34 | public function getPubKey() { 35 | return $this->pubkey; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt/RSA/Pri2PubCrypt.php: -------------------------------------------------------------------------------- 1 | 2015-03-14 15 | */ 16 | 17 | class Pri2PubCrypt implements Crypt { 18 | 19 | public function encrypt($data, $prikey) { 20 | $rs = ''; 21 | 22 | if (@openssl_private_encrypt($data, $rs, $prikey) === FALSE) { 23 | return NULL; 24 | } 25 | 26 | return $rs; 27 | } 28 | 29 | public function decrypt($data, $pubkey) { 30 | $rs = ''; 31 | 32 | if (@openssl_public_decrypt($data, $rs, $pubkey) === FALSE) { 33 | return NULL; 34 | } 35 | 36 | return $rs; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt/RSA/Pub2PriCrypt.php: -------------------------------------------------------------------------------- 1 | 2015-03-15 15 | */ 16 | 17 | class Pub2PriCrypt implements Crypt { 18 | 19 | public function encrypt($data, $pubkey) { 20 | $rs = ''; 21 | 22 | if (@openssl_public_encrypt($data, $rs, $pubkey) === FALSE) { 23 | return NULL; 24 | } 25 | 26 | return $rs; 27 | } 28 | 29 | public function decrypt($data, $prikey) { 30 | $rs = ''; 31 | 32 | if (@openssl_private_decrypt($data, $rs, $prikey) === FALSE) { 33 | return NULL; 34 | } 35 | 36 | return $rs; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Logger/ExplorerLogger.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 15 | */ 16 | 17 | class ExplorerLogger extends Logger { 18 | 19 | public function log($type, $msg, $data) { 20 | $msgArr = array(); 21 | $msgArr[] = date('Y-m-d H:i:s', $_SERVER['REQUEST_TIME']); 22 | $msgArr[] = strtoupper($type); 23 | $msgArr[] = str_replace(PHP_EOL, '\n', $msg); 24 | if ($data !== NULL) { 25 | $msgArr[] = is_array($data) ? json_encode($data) : $data; 26 | } 27 | 28 | $content = implode('|', $msgArr) . PHP_EOL; 29 | 30 | echo "\n", $content, "\n"; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /tests/e2e/support/commands.js: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This is will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /phalapi/composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "phalapi/phalapi", 3 | "description": "PhalApi v2.x,一个PHP轻量级开源接口框架,致力于快速开发接口服务。", 4 | "type": "project", 5 | "keywords": ["api"], 6 | "homepage": "http://www.phalapi.net", 7 | "license" : "GPL-3.0+", 8 | "minimum-stability": "dev", 9 | "authors": [ 10 | { 11 | "name": "Dogstar Huang", 12 | "email": "chanzonghuang@gmail.com", 13 | "homepage" : "http://my.oschina.net/dogstar", 14 | "role": "Developer" 15 | } 16 | ], 17 | "require": { 18 | "php": ">=5.3.3", 19 | "phalapi/kernal": "2.*.*", 20 | "phalapi/qrcode": "dev-master", 21 | "phalapi/cli": "dev-master", 22 | "phalapi/task": "dev-master" 23 | }, 24 | "autoload": { 25 | "files": [ 26 | "src/app/functions.php" 27 | ], 28 | "psr-4": { 29 | "App\\": "src/app" 30 | } 31 | } 32 | 33 | } 34 | -------------------------------------------------------------------------------- /phalapi/src/app/Api/Site.php: -------------------------------------------------------------------------------- 1 | 2014-10-04 10 | */ 11 | 12 | class Site extends Api { 13 | 14 | public function getRules() { 15 | return array( 16 | 'index' => array( 17 | 'username' => array('name' => 'username', 'default' => 'PhalApi', 'desc' => '用户名'), 18 | ), 19 | ); 20 | } 21 | 22 | /** 23 | * 默认接口服务 24 | * @desc 默认接口服务,当未指定接口服务时执行此接口服务 25 | * @return string title 标题 26 | * @return string content 内容 27 | * @return string version 版本,格式:X.X.X 28 | * @return int time 当前时间戳 29 | * @exception 400 非法请求,参数传递错误 30 | */ 31 | public function index() { 32 | return array( 33 | 'title' => 'Hello ' . $this->username, 34 | 'version' => PHALAPI_VERSION, 35 | 'time' => $_SERVER['REQUEST_TIME'], 36 | ); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/config/app.php: -------------------------------------------------------------------------------- 1 | array( 11 | //MQ队列设置,可根据使用需要配置 12 | 'mq' => array( 13 | // 默认使用文件MQ 14 | 'file' => array( 15 | 'path' => API_ROOT . '/runtime', 16 | 'prefix' => 'phalapi_task', 17 | ), 18 | // 也可以根据需要,切换使用Redis MQ 19 | 'redis' => array( 20 | 'host' => '127.0.0.1', 21 | 'port' => 6379, 22 | 'prefix' => 'phalapi_task', 23 | 'auth' => '', 24 | ), 25 | ), 26 | 27 | //Runner设置,如果使用远程调度方式,请加此配置 28 | 'runner' => array( 29 | 'remote' => array( 30 | 'host' => 'http://library.phalapi.net/demo/', 31 | 'timeoutMS' => 3000, 32 | ), 33 | ), 34 | ), 35 | ); 36 | -------------------------------------------------------------------------------- /phalapi/src/app/Api/Data.php: -------------------------------------------------------------------------------- 1 | 'dogstar', 'email' => 'chanzonghuang@gmail.com', 'createTime' => date('Y-m-d')], 21 | ['name' => '张三', 'email' => 'xxx@phalapi.net', 'createTime' => date('Y-m-d')], 22 | ]; 23 | } 24 | 25 | /** 26 | * 获取拖拉数据列表 27 | */ 28 | public function getDragList() { 29 | return [ 30 | ['id' => 1, 'name' => 'one'], 31 | ['id' => 2, 'name' => 'tow'], 32 | ['id' => 3, 'name' => 'three'], 33 | ]; 34 | } 35 | 36 | /** 37 | * 保存错误日志 38 | */ 39 | public function saveErrorLogger() { 40 | return 'success'; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python2.x/demo.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 3 | 4 | import PhalApiClient 5 | 6 | print '-' * 20 7 | print 'Request: 1' 8 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/', 'Default.Index', {'username': 'dogstar'}, 3) 9 | print 'head', result['info'] 10 | print 'state', result['state'] 11 | print 'result', result['data'] 12 | print '-' * 20 13 | print 'Request: 2' 14 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/', 'User.GetBaseInfo', {'username': 'dogstar'}) 15 | print 'head', result['info'] 16 | print 'state', result['state'] 17 | print 'result', result['data'] 18 | print '-' * 20 19 | print 'Request: 3' 20 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/') 21 | print 'head', result['info'] 22 | print 'state', result['state'] 23 | print 'result', result['data'] 24 | print '-' * 20 25 | print 'Request: 4 (illegal request)' 26 | result = PhalApiClient.PhalApiClient(1, 2, 3, 4) -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Crypt/RSA/MultiPub2PriCrypt_Test.php: -------------------------------------------------------------------------------- 1 | privkey = $keyG->getPubKey(); 27 | $this->pubkey = $keyG->getPriKey(); 28 | 29 | $this->multiPri2PubCrypt = new MultiPub2PriCrypt(); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /phalapi/sdk/Python/PhalApiClient/python3.x/demo.py: -------------------------------------------------------------------------------- 1 | #-*- coding:utf-8 -*- 2 | #gaoyiping (iam@gaoyiping.com) 2017-02-18 3 | 4 | import PhalApiClient 5 | 6 | print('-' * 20) 7 | print('Request: 1') 8 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/', 'Default.Index', {'username': 'dogstar'}, 3) 9 | print('head', result['info']) 10 | print('state', result['state']) 11 | print('result', result['data']) 12 | print('-' * 20) 13 | print('Request: 2') 14 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/', 'User.GetBaseInfo', {'username': 'dogstar'}) 15 | print('head', result['info']) 16 | print('state', result['state']) 17 | print('result', result['data']) 18 | print('-' * 20) 19 | print('Request: 3') 20 | result = PhalApiClient.PhalApiClient('http://demo.phalapi.net/') 21 | print('head', result['info']) 22 | print('state', result['state']) 23 | print('result', result['data']) 24 | print('-' * 20) 25 | print('Request: 4 (illegal request)') 26 | result = PhalApiClient.PhalApiClient(1, 2, 3, 4) -------------------------------------------------------------------------------- /phalapi/tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./ 23 | 24 | 25 | 26 | 27 | 28 | ../src 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /src/components/split-pane/trigger.vue: -------------------------------------------------------------------------------- 1 | 8 | 9 | 40 | 41 | 44 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/header-bar.vue: -------------------------------------------------------------------------------- 1 | 10 | 35 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt/RSA/MultiPri2PubCrypt.php: -------------------------------------------------------------------------------- 1 | 2015-03-14 16 | */ 17 | 18 | class MultiPri2PubCrypt extends MultiBase { 19 | 20 | protected $pri2pub; 21 | 22 | public function __construct() { 23 | $this->pri2pub = new Pri2PubCrypt(); 24 | 25 | parent::__construct(); 26 | } 27 | 28 | protected function doEncrypt($toCryptPie, $prikey) { 29 | return $this->pri2pub->encrypt($toCryptPie, $prikey); 30 | } 31 | 32 | protected function doDecrypt($encryptPie, $prikey) { 33 | return $this->pri2pub->decrypt($encryptPie, $prikey); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Crypt/RSA/MultiPub2PriCrypt.php: -------------------------------------------------------------------------------- 1 | 2015-03-15 16 | */ 17 | 18 | class MultiPub2PriCrypt extends MultiBase { 19 | 20 | protected $pub2pri; 21 | 22 | public function __construct() { 23 | $this->pub2pri = new Pub2PriCrypt(); 24 | 25 | parent::__construct(); 26 | } 27 | 28 | protected function doEncrypt($toCryptPie, $pubkey) { 29 | return $this->pub2pri->encrypt($toCryptPie, $pubkey); 30 | } 31 | 32 | protected function doDecrypt($encryptPie, $prikey) { 33 | return $this->pub2pri->decrypt($encryptPie, $prikey); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Response/XmlResponse_Test.php: -------------------------------------------------------------------------------- 1 | phalApiResponseXmlResponse = new PhalApi\Response\XmlResponse(); 20 | } 21 | 22 | protected function tearDown() 23 | { 24 | // 输出本次单元测试所执行的SQL语句 25 | // var_dump(DI()->tracer->getSqls()); 26 | 27 | // 输出本次单元测试所涉及的追踪埋点 28 | // var_dump(DI()->tracer->getSqls()); 29 | } 30 | 31 | public function testOutput() 32 | { 33 | $this->phalApiResponseXmlResponse->output(); 34 | $this->expectOutputRegex('/xml/'); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /src/components/common-icon/common-icon.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 39 | 40 | 43 | -------------------------------------------------------------------------------- /src/components/cropper/index.less: -------------------------------------------------------------------------------- 1 | .bg{ 2 | background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC") 3 | } 4 | .cropper-wrapper{ 5 | width: 600px; 6 | height: 340px; 7 | .img-box{ 8 | height: 340px; 9 | width: 430px; 10 | border: 1px solid #ebebeb; 11 | display: inline-block; 12 | .bg; 13 | img{ 14 | max-width: 100%; 15 | display: block; 16 | } 17 | } 18 | .right-con{ 19 | display: inline-block; 20 | width: 170px; 21 | vertical-align: top; 22 | box-sizing: border-box; 23 | padding: 0 10px; 24 | .preview-box{ 25 | height: 150px !important; 26 | width: 100% !important; 27 | overflow: hidden; 28 | border: 1px solid #ebebeb; 29 | .bg; 30 | } 31 | .button-box{ 32 | padding: 10px 0 0; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/functions.php: -------------------------------------------------------------------------------- 1 | 2014-12-17 18 | */ 19 | 20 | /** 21 | * 获取DI 22 | * 相当于DependenceInjection::one() 23 | * @return \PhalApi\DependenceInjection 24 | */ 25 | function DI() { 26 | return DependenceInjection::one(); 27 | } 28 | 29 | /** 30 | * 设定语言,SL为setLanguage的简写 31 | * @param string $language 翻译包的目录名 32 | */ 33 | function SL($language) { 34 | Translator::setLanguage($language); 35 | } 36 | 37 | /** 38 | * 快速翻译 39 | * @param string $msg 待翻译的内容 40 | * @param array $params 动态参数 41 | */ 42 | function T($msg, $params = array()) { 43 | return Translator::get($msg, $params); 44 | } 45 | -------------------------------------------------------------------------------- /src/directive/module/clipboard.js: -------------------------------------------------------------------------------- 1 | import Clipboard from 'clipboard' 2 | export default { 3 | bind: (el, binding) => { 4 | const clipboard = new Clipboard(el, { 5 | text: () => binding.value.value 6 | }) 7 | el.__success_callback__ = binding.value.success 8 | el.__error_callback__ = binding.value.error 9 | clipboard.on('success', e => { 10 | const callback = el.__success_callback__ 11 | callback && callback(e) 12 | }) 13 | clipboard.on('error', e => { 14 | const callback = el.__error_callback__ 15 | callback && callback(e) 16 | }) 17 | el.__clipboard__ = clipboard 18 | }, 19 | update: (el, binding) => { 20 | el.__clipboard__.text = () => binding.value.value 21 | el.__success_callback__ = binding.value.success 22 | el.__error_callback__ = binding.value.error 23 | }, 24 | unbind: (el, binding) => { 25 | delete el.__success_callback__ 26 | delete el.__error_callback__ 27 | el.__clipboard__.destroy() 28 | delete el.__clipboard__ 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /phalapi/sdk/JAVA/net/phalapi/sdk/PhalApiClientResponse.java: -------------------------------------------------------------------------------- 1 | package net.phalapi.sdk; 2 | 3 | /** 4 | * 接口返回结果 5 | * 6 | * - 与接口返回的格式对应,即有:ret/data/msg 7 | */ 8 | public class PhalApiClientResponse { 9 | 10 | protected int ret; 11 | protected String data; 12 | protected String msg; 13 | 14 | /** 15 | * 完全构造函数 16 | * @param int ret 17 | * @param String data 18 | * @param String msg 19 | */ 20 | public PhalApiClientResponse(int ret, String data, String msg) { 21 | this.ret = ret; 22 | this.data = data; 23 | this.msg = msg; 24 | } 25 | 26 | public PhalApiClientResponse(int ret, String data) { 27 | this(ret, data, ""); 28 | } 29 | 30 | public PhalApiClientResponse(int ret) { 31 | this(ret, "", ""); 32 | } 33 | 34 | public int getRet() { 35 | return this.ret; 36 | } 37 | 38 | public String getData() { 39 | return this.data; 40 | } 41 | 42 | public String getMsg() { 43 | return this.msg; 44 | } 45 | } -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Config/YaconfConfig.php: -------------------------------------------------------------------------------- 1 | 14 | * $config = new YaconfConfig(); 15 | * 16 | * var_dump($config->get('foo')); //相当于var_dump(Yaconf::get("foo")); 17 | * 18 | * var_dump($config->has('foo')); //相当于var_dump(Yaconf::has("foo")); 19 | * 20 | ``` 21 | * 22 | * @package PhalApi\Config 23 | * @see \PhalApi\Config::get() 24 | * @license http://www.phalapi.net/license GPL 协议 25 | * @link http://www.phalapi.net/ 26 | * @link https://github.com/laruence/yaconf 27 | * @author dogstar 2014-10-02 28 | */ 29 | 30 | class YaconfConfig implements Config { 31 | 32 | public function get($key, $default = NULL) { 33 | return \Yaconf::get($key, $default); 34 | } 35 | 36 | public function has($key) { 37 | return \Yaconf::has($key); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/view/error-page/error.less: -------------------------------------------------------------------------------- 1 | .error-page{ 2 | width: 100%; 3 | height: 100%; 4 | position: relative; 5 | background: #f8f8f9; 6 | .content-con{ 7 | width: 700px; 8 | height: 600px; 9 | position: absolute; 10 | left: 50%; 11 | top: 50%; 12 | transform: translate(-50%, -60%); 13 | img{ 14 | display: block; 15 | width: 100%; 16 | height: 100%; 17 | } 18 | .text-con{ 19 | position: absolute; 20 | left: 0px; 21 | top: 0px; 22 | h4{ 23 | position: absolute; 24 | left: 0px; 25 | top: 0px; 26 | font-size: 80px; 27 | font-weight: 700; 28 | color: #348EED; 29 | } 30 | h5{ 31 | position: absolute; 32 | width: 700px; 33 | left: 0px; 34 | top: 100px; 35 | font-size: 20px; 36 | font-weight: 700; 37 | color: #67647D; 38 | } 39 | } 40 | .back-btn-group{ 41 | position: absolute; 42 | right: 0px; 43 | bottom: 20px; 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/components/main/components/error-store/error-store.vue: -------------------------------------------------------------------------------- 1 | 10 | 11 | 38 | 39 | 50 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Request/Formatter/BooleanFormatter_Test.php: -------------------------------------------------------------------------------- 1 | booleanFormatter = new BooleanFormatter(); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | } 28 | 29 | 30 | /** 31 | * @group testParse 32 | */ 33 | public function testParse() 34 | { 35 | $value = 'on'; 36 | $rule = array(); 37 | 38 | $rs = $this->booleanFormatter->parse($value, $rule); 39 | 40 | $this->assertTrue($rs); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Request/Formatter/EnumFormatter.php: -------------------------------------------------------------------------------- 1 | enumFomatter = new EnumFormatter(); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | } 28 | 29 | 30 | /** 31 | * @group testParse 32 | */ 33 | public function testParse() 34 | { 35 | $value = 'ios'; 36 | $rule = array('range' => array('ios', 'android')); 37 | 38 | $rs = $this->enumFomatter->parse($value, $rule); 39 | 40 | $this->assertEquals('ios', $rs); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/Runner/LocalRunner.php: -------------------------------------------------------------------------------- 1 | 20150516 16 | */ 17 | 18 | class LocalRunner extends Runner { 19 | 20 | protected function youGo($service, $params) { 21 | $params['service'] = $service; 22 | 23 | \PhalApi\DI()->request = new Request($params); 24 | \PhalApi\DI()->response = new JsonResponse(); 25 | 26 | $phalapi = new PhalApi(); 27 | $rs = $phalapi->response(); 28 | $apiRs = $rs->getResult(); 29 | 30 | if ($apiRs['ret'] != 200) { 31 | \PhalApi\DI()->logger->debug('task local go fail', 32 | array('servcie' => $service, 'params' => $params, 'rs' => $apiRs)); 33 | 34 | return FALSE; 35 | } 36 | 37 | return TRUE; 38 | } 39 | 40 | } 41 | 42 | -------------------------------------------------------------------------------- /phalapi/sdk/Ruby/PhalApiClient/tests/client_parser_json.rb: -------------------------------------------------------------------------------- 1 | require_relative '../phalapi_client' 2 | require 'test/unit' 3 | 4 | class ClientParserJsonTest < Test::Unit::TestCase 5 | def setup 6 | @parser = PhalApi::ClientParserJson.new 7 | end 8 | 9 | def test_nil 10 | rs = nil 11 | a_response = @parser.parse(rs) 12 | 13 | assert_equal 408, a_response.ret 14 | end 15 | 16 | def test_illegal_json 17 | rs = 'i am not a json, as you can see' 18 | a_response = @parser.parse(rs) 19 | 20 | assert_equal 500, a_response.ret 21 | end 22 | 23 | def test_normal_json 24 | rs = '{"ret":200,"data":{"title":"Hello World","content":"Welcome to use Web Tools!","version":"1.0.0","time":1415982826},"msg":""}' 25 | a_response = @parser.parse(rs) 26 | 27 | assert_equal 200, a_response.ret 28 | 29 | data = a_response.data 30 | assert_equal 'Hello World', data['title'] 31 | assert_equal '1.0.0', data['version'] 32 | 33 | assert_equal '', a_response.msg 34 | end 35 | end 36 | -------------------------------------------------------------------------------- /src/mock/index.js: -------------------------------------------------------------------------------- 1 | import Mock from 'mockjs' 2 | import { login, logout, getUserInfo } from './login' 3 | import { getTableData, getDragList, uploadImage } from './data' 4 | import { getMessageInit, getContentByMsgId, hasRead, removeReaded, restoreTrash, messageCount } from './user' 5 | 6 | // 配置Ajax请求延时,可用来测试网络延迟大时项目中一些效果 7 | Mock.setup({ 8 | timeout: 100 9 | }) 10 | 11 | // 登录相关和获取用户信息 12 | Mock.mock(/\/api\/User.Login/, login) 13 | Mock.mock(/\/api\/User.GetInfo/, getUserInfo) 14 | Mock.mock(/\/api\/User.Logout/, logout) 15 | Mock.mock(/\/api\/Data.GetTableData/, getTableData) 16 | Mock.mock(/\/api\/Data.GetDragList/, getDragList) 17 | Mock.mock(/\/api\/Data.SaveErrorLogger/, 'success') 18 | Mock.mock(/\/api\/Image.Upload/, uploadImage) 19 | Mock.mock(/\/api\/Message.InitMsg/, getMessageInit) 20 | Mock.mock(/\/api\/Message.Content/, getContentByMsgId) 21 | Mock.mock(/\/api\/Message.HasRead/, hasRead) 22 | Mock.mock(/\/api\/Message.RemoveReaded/, removeReaded) 23 | Mock.mock(/\/api\/Message.Restore/, restoreTrash) 24 | Mock.mock(/\/api\/Message.Count/, messageCount) 25 | 26 | export default Mock 27 | -------------------------------------------------------------------------------- /src/view/join-page.vue: -------------------------------------------------------------------------------- 1 | 19 | 20 | 33 | 34 | 45 | -------------------------------------------------------------------------------- /src/view/login/login.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 17 | 18 | 42 | 43 | 46 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Cache/APCUCache.php: -------------------------------------------------------------------------------- 1 | 2017-04-14 14 | */ 15 | 16 | class APCUCache { 17 | 18 | public function __construct() { 19 | if (!extension_loaded('apcu')) { 20 | throw new InternalServerErrorException( 21 | \PhalApi\T('missing {name} extension', array('name' => 'apcu')) 22 | ); 23 | } 24 | } 25 | 26 | public function set($key, $value, $expire = 600) { 27 | return apcu_store($key, $value, $expire); 28 | } 29 | 30 | public function get($key) { 31 | $value = apcu_fetch($key); 32 | return $value !== FALSE ? $value : NULL; 33 | } 34 | 35 | public function delete($key) { 36 | return apcu_delete($key); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Config.php: -------------------------------------------------------------------------------- 1 | 使用示例:
10 | ``` 11 | * //假设有这样的app.php配置: 12 | * return array( 13 | * 'version' => '1.1.1', 14 | * 15 | * 'email' => array( 16 | * 'address' => 'chanzonghuang@gmail.com', 17 | * ); 18 | * ); 19 | * 20 | * //我们就可以分别这样根据需要获取配置: 21 | * //app.php里面的全部配置 22 | * DI()->config->get('app'); 23 | * 24 | * //app.php里面的单个配置 25 | * DI()->config->get('app.version'); //返回:1.1.1 26 | * 27 | * //app.php里面的多级配置 28 | * DI()->config->get('app.version.address'); //返回:chanzonghuang@gmail.com 29 | ``` 30 | * 31 | * @package PhalApi\Config 32 | * @license http://www.phalapi.net/license GPL 协议 33 | * @link http://www.phalapi.net/ 34 | * @author dogstar 2014-10-02 35 | */ 36 | 37 | interface Config { 38 | 39 | /** 40 | * 获取配置 41 | * 42 | * @param $key string 配置键值 43 | * @param mixed $default 缺省值 44 | * @return mixed 需要获取的配置值,不存在时统一返回$default 45 | */ 46 | public function get($key, $default = NULL); 47 | } 48 | -------------------------------------------------------------------------------- /phalapi/public/docs.php: -------------------------------------------------------------------------------- 1 | 使用示例:
10 | * ``` 11 | * render(API_ROOT . '/src/view/api_desc_tpl.php'); 37 | } else { 38 | $apiList = new \PhalApi\Helper\ApiList($projectName); 39 | $apiList->render(API_ROOT . '/src/view/api_list_tpl.php'); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /src/view/components/cropper/cropper.vue: -------------------------------------------------------------------------------- 1 | 18 | 19 | 43 | 44 | 49 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 iView 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /phalapi/src/app/Model/Examples/CURD.php: -------------------------------------------------------------------------------- 1 | getORM() 27 | ->select('*') 28 | ->where('state', $state) 29 | ->order('post_date DESC') 30 | ->limit(($page - 1) * $perpage, $perpage) 31 | ->fetchAll(); 32 | } 33 | 34 | public function getListTotal($state) { 35 | $total = $this->getORM() 36 | ->where('state', $state) 37 | ->count('id'); 38 | 39 | return intval($total); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phalapi/tests/app/Api/Site_Test.php: -------------------------------------------------------------------------------- 1 | site = new Site(); 24 | } 25 | 26 | protected function tearDown() 27 | { 28 | } 29 | 30 | 31 | /** 32 | * @group testGetRules 33 | */ 34 | public function testGetRules() 35 | { 36 | $rs = $this->site->getRules(); 37 | 38 | $this->assertNotEmpty($rs); 39 | } 40 | 41 | public function testIndex() 42 | { 43 | //Step 1. 构建请求URL 44 | $url = 'service=App.Site.Index&username=dogstar'; 45 | 46 | //Step 2. 执行请求 47 | $rs = TestRunner::go($url); 48 | 49 | //Step 3. 验证 50 | $this->assertNotEmpty($rs); 51 | $this->assertArrayHasKey('title', $rs); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/Task_Lite_Test.php: -------------------------------------------------------------------------------- 1 | taskLite = new PhalApi\Task\Lite(new PhalApi\Task\MQ\FileMQ()); 21 | } 22 | 23 | protected function tearDown() 24 | { 25 | } 26 | 27 | 28 | /** 29 | * @group testAdd 30 | */ 31 | public function testAdd() 32 | { 33 | $service = 'Demo.Update'; 34 | $params = array ( 35 | 'id' => 888 36 | ); 37 | 38 | $rs = $this->taskLite->add($service, $params); 39 | $this->assertTrue($rs); 40 | } 41 | 42 | public function testAddWrong() 43 | { 44 | $service = 'Demo'; 45 | 46 | $rs = $this->taskLite->add($service); 47 | 48 | $this->assertFalse($rs); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /phalapi/vendor/composer/LICENSE: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) Nils Adermann, Jordi Boggiano 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is furnished 9 | to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in all 12 | copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | 22 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Cache/MultiCache.php: -------------------------------------------------------------------------------- 1 | 2015-02-22 16 | */ 17 | 18 | class MultiCache implements Cache { 19 | 20 | protected $caches = array(); 21 | 22 | public function addCache(Cache $cache) { 23 | $this->caches[] = $cache; 24 | } 25 | 26 | public function set($key, $value, $expire = 600) { 27 | foreach ($this->caches as $cache) { 28 | $cache->set($key, $value, $expire); 29 | } 30 | } 31 | 32 | public function get($key) { 33 | foreach ($this->caches as $cache) { 34 | $value = $cache->get($key); 35 | if ($value !== NULL) { 36 | return $value; 37 | } 38 | } 39 | 40 | return NULL; 41 | } 42 | 43 | public function delete($key) { 44 | foreach ($this->caches as $cache) { 45 | $cache->delete($key); 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Response/JsonpResponse.php: -------------------------------------------------------------------------------- 1 | 2015-02-09 13 | */ 14 | 15 | class JsonpResponse extends Response { 16 | 17 | protected $callback = ''; 18 | 19 | protected $options; 20 | 21 | /** 22 | * @param string $callback JS回调函数名 23 | */ 24 | public function __construct($callback, $options = 0) { 25 | $this->callback = $this->clearXss($callback); 26 | $this->options = $options; 27 | 28 | $this->addHeaders('Content-Type', 'text/javascript; charset=utf-8'); 29 | } 30 | 31 | /** 32 | * 对回调函数进行跨站清除处理 33 | * 34 | * - 可使用白名单或者黑名单方式处理,由接口开发再实现 35 | */ 36 | protected function clearXss($callback) { 37 | return $callback; 38 | } 39 | 40 | protected function formatResult($result) { 41 | echo $this->callback . '(' . json_encode($result, $this->options) . ')'; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /phalapi/src/app/Domain/Examples/CURD.php: -------------------------------------------------------------------------------- 1 | insert($newData); 13 | } 14 | 15 | public function update($id, $newData) { 16 | $model = new ModelCURD(); 17 | return $model->update($id, $newData); 18 | } 19 | 20 | public function get($id) { 21 | $model = new ModelCURD(); 22 | return $model->get($id); 23 | } 24 | 25 | public function delete($id) { 26 | $model = new ModelCURD(); 27 | return $model->delete($id); 28 | } 29 | 30 | public function getList($state, $page, $perpage) { 31 | $rs = array('items' => array(), 'total' => 0); 32 | 33 | $model = new ModelCURD(); 34 | $items = $model->getListItems($state, $page, $perpage); 35 | $total = $model->getListTotal($state); 36 | 37 | $rs['items'] = $items; 38 | $rs['total'] = $total; 39 | 40 | return $rs; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/view/excel/common.less: -------------------------------------------------------------------------------- 1 | .margin-top-8{ 2 | margin-top: 8px; 3 | } 4 | .margin-top-10{ 5 | margin-top: 10px; 6 | } 7 | .margin-top-20{ 8 | margin-top: 20px; 9 | } 10 | .margin-left-10{ 11 | margin-left: 10px; 12 | } 13 | .margin-bottom-10{ 14 | margin-bottom: 10px; 15 | } 16 | .margin-bottom-100{ 17 | margin-bottom: 100px; 18 | } 19 | .margin-right-10{ 20 | margin-right: 10px; 21 | } 22 | .padding-left-6{ 23 | padding-left: 6px; 24 | } 25 | .padding-left-8{ 26 | padding-left: 5px; 27 | } 28 | .padding-left-10{ 29 | padding-left: 10px; 30 | } 31 | .padding-left-20{ 32 | padding-left: 20px; 33 | } 34 | .height-100{ 35 | height: 100%; 36 | } 37 | .height-120px{ 38 | height: 100px; 39 | } 40 | .height-200px{ 41 | height: 200px; 42 | } 43 | .height-492px{ 44 | height: 492px; 45 | } 46 | .height-460px{ 47 | height: 460px; 48 | } 49 | .line-gray{ 50 | height: 0; 51 | border-bottom: 2px solid #dcdcdc; 52 | } 53 | .notwrap{ 54 | word-break:keep-all; 55 | white-space:nowrap; 56 | overflow: hidden; 57 | text-overflow: ellipsis; 58 | } 59 | .padding-left-5{ 60 | padding-left: 10px; 61 | } 62 | [v-cloak]{ 63 | display: none; 64 | } -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/Lite.php: -------------------------------------------------------------------------------- 1 | 20150516 11 | */ 12 | 13 | class Lite { 14 | 15 | /** 16 | * PhalApi\Task\MQ $mq MQ队列 17 | */ 18 | protected $mq; 19 | 20 | public function __construct(MQ $mq) { 21 | $this->mq = $mq; 22 | } 23 | 24 | /** 25 | * 添加一个计划任务到MQ队列 26 | * @param string $service 接口服务名称,如:Site.Index 27 | * @param array $params 接口服务参数 28 | */ 29 | public function add($service, $params = array()) { 30 | if (empty($service) || count(explode('.', $service)) < 2) { 31 | return FALSE; 32 | } 33 | if (!is_array($params)) { 34 | return FALSE; 35 | } 36 | 37 | $rs = $this->mq->add($service, $params); 38 | 39 | if (!$rs) { 40 | \PhalApi\DI()->logger->debug('task add a new mq', 41 | array('service' => $service, 'params' => $params)); 42 | 43 | return FALSE; 44 | } 45 | 46 | return TRUE; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main.js: -------------------------------------------------------------------------------- 1 | // The Vue build version to load with the `import` command 2 | // (runtime-only or standalone) has been set in webpack.base.conf with an alias. 3 | import Vue from 'vue' 4 | import App from './App' 5 | import router from './router' 6 | import store from './store' 7 | import iView from 'iview' 8 | import i18n from '@/locale' 9 | import config from '@/config' 10 | import importDirective from '@/directive' 11 | import installPlugin from '@/plugin' 12 | import './index.less' 13 | import '@/assets/icons/iconfont.css' 14 | import TreeTable from 'tree-table-vue' 15 | // 实际打包时应该不引入mock 16 | /* eslint-disable */ 17 | if (process.env.NODE_ENV !== 'production') require('@/mock') 18 | 19 | Vue.use(iView, { 20 | i18n: (key, value) => i18n.t(key, value) 21 | }) 22 | Vue.use(TreeTable) 23 | /** 24 | * @description 注册admin内置插件 25 | */ 26 | installPlugin(Vue) 27 | /** 28 | * @description 生产环境关掉提示 29 | */ 30 | Vue.config.productionTip = false 31 | /** 32 | * @description 全局注册应用配置 33 | */ 34 | Vue.prototype.$config = config 35 | /** 36 | * 注册指令 37 | */ 38 | importDirective(Vue) 39 | 40 | /* eslint-disable no-new */ 41 | new Vue({ 42 | el: '#app', 43 | router, 44 | i18n, 45 | store, 46 | render: h => h(App) 47 | }) 48 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Response/ExplorerResponse_Test.php: -------------------------------------------------------------------------------- 1 | phalApiResponseExplorerResponse = new PhalApi\Response\ExplorerResponse(); 26 | } 27 | 28 | protected function tearDown() 29 | { 30 | // 输出本次单元测试所执行的SQL语句 31 | // var_dump(DI()->tracer->getSqls()); 32 | 33 | // 输出本次单元测试所涉及的追踪埋点 34 | // var_dump(DI()->tracer->getSqls()); 35 | } 36 | 37 | public function testOutput() 38 | { 39 | $this->phalApiResponseExplorerResponse->output(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/components/main/components/language/language.vue: -------------------------------------------------------------------------------- 1 | 14 | 15 | 52 | -------------------------------------------------------------------------------- /src/locale/lang/zh-CN.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: '首页', 3 | components: '组件', 4 | count_to_page: '数字渐变', 5 | tables_page: '多功能表格', 6 | split_pane_page: '分割窗口', 7 | markdown_page: 'Markdown编辑器', 8 | editor_page: '富文本编辑器', 9 | icons_page: '自定义图标', 10 | img_cropper_page: '图片编辑器', 11 | update: '上传数据', 12 | join_page: 'QQ群', 13 | doc: '文档', 14 | api_doc: '在线接口文档', 15 | update_table_page: '上传CSV文件', 16 | update_paste_page: '粘贴表格数据', 17 | multilevel: '多级菜单', 18 | directive_page: '指令', 19 | level_1: 'Level-1', 20 | level_2: 'Level-2', 21 | level_2_1: 'Level-2-1', 22 | level_2_3: 'Level-2-3', 23 | level_2_2: 'Level-2-2', 24 | level_2_2_1: 'Level-2-2-1', 25 | level_2_2_2: 'Level-2-2-2', 26 | excel: 'Excel', 27 | 'upload-excel': '上传excel', 28 | 'export-excel': '导出excel', 29 | tools_methods_page: '工具函数', 30 | drag_list_page: '拖拽列表', 31 | i18n_page: '多语言', 32 | modalTitle: '模态框题目', 33 | content: '这是模态框内容', 34 | buttonText: '显示模态框', 35 | 'i18n-tip': '注:仅此页做了多语言,其他页面没有在多语言包中添加语言内容', 36 | error_store_page: '错误收集', 37 | error_logger_page: '错误日志', 38 | query: '带参路由', 39 | params: '动态路由', 40 | cropper_page: '图片裁剪', 41 | message_page: '消息中心', 42 | tree_table_page: '树状表格' 43 | } 44 | -------------------------------------------------------------------------------- /src/locale/lang/zh-TW.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: '首頁', 3 | components: '组件', 4 | count_to_page: '数字渐变', 5 | tables_page: '多功能表格', 6 | split_pane_page: '分割窗口', 7 | markdown_page: 'Markdown編輯器', 8 | editor_page: '富文本編輯器', 9 | icons_page: '自定義圖標', 10 | img_cropper_page: '圖片編輯器', 11 | update: '上傳數據', 12 | join_page: 'QQ群', 13 | doc: '文檔', 14 | api_doc: '在线接口文檔', 15 | update_table_page: '上傳CSV文件', 16 | update_paste_page: '粘貼表格數據', 17 | multilevel: '多级菜单', 18 | directive_page: '指令', 19 | level_1: 'Level-1', 20 | level_2: 'Level-2', 21 | level_2_1: 'Level-2-1', 22 | level_2_3: 'Level-2-3', 23 | level_2_2: 'Level-2-2', 24 | level_2_2_1: 'Level-2-2-1', 25 | level_2_2_2: 'Level-2-2-2', 26 | excel: 'Excel', 27 | 'upload-excel': '上傳excel', 28 | 'export-excel': '導出excel', 29 | tools_methods_page: '工具函數', 30 | drag_list_page: '拖拽列表', 31 | i18n_page: '多語言', 32 | modalTitle: '模態框題目', 33 | content: '這是模態框內容', 34 | buttonText: '顯示模態框', 35 | 'i18n-tip': '注:僅此頁做了多語言,其他頁面沒有在多語言包中添加語言內容', 36 | error_store_page: '錯誤收集', 37 | error_logger_page: '錯誤日誌', 38 | query: '帶參路由', 39 | params: '動態路由', 40 | cropper_page: '圖片裁剪', 41 | message_page: '消息中心', 42 | tree_table_page: '樹狀表格' 43 | } 44 | -------------------------------------------------------------------------------- /src/view/error-store/error-store.vue: -------------------------------------------------------------------------------- 1 | 21 | 22 | 36 | 37 | 40 | -------------------------------------------------------------------------------- /src/locale/index.js: -------------------------------------------------------------------------------- 1 | import Vue from 'vue' 2 | import VueI18n from 'vue-i18n' 3 | import { localRead } from '@/libs/util' 4 | import customZhCn from './lang/zh-CN' 5 | import customZhTw from './lang/zh-TW' 6 | import customEnUs from './lang/en-US' 7 | import zhCnLocale from 'iview/src/locale/lang/zh-CN' 8 | import enUsLocale from 'iview/src/locale/lang/en-US' 9 | import zhTwLocale from 'iview/src/locale/lang/zh-TW' 10 | 11 | Vue.use(VueI18n) 12 | 13 | // 自动根据浏览器系统语言设置语言 14 | const navLang = navigator.language 15 | const localLang = (navLang === 'zh-CN' || navLang === 'en-US') ? navLang : false 16 | let lang = localLang || localRead('local') || 'zh-CN' 17 | 18 | Vue.config.lang = lang 19 | 20 | // vue-i18n 6.x+写法 21 | Vue.locale = () => {} 22 | const messages = { 23 | 'zh-CN': Object.assign(zhCnLocale, customZhCn), 24 | 'zh-TW': Object.assign(zhTwLocale, customZhTw), 25 | 'en-US': Object.assign(enUsLocale, customEnUs) 26 | } 27 | const i18n = new VueI18n({ 28 | locale: lang, 29 | messages 30 | }) 31 | 32 | export default i18n 33 | 34 | // vue-i18n 5.x写法 35 | // Vue.locale('zh-CN', Object.assign(zhCnLocale, customZhCn)) 36 | // Vue.locale('en-US', Object.assign(zhTwLocale, customZhTw)) 37 | // Vue.locale('zh-TW', Object.assign(enUsLocale, customEnUs)) 38 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Crypt/RSA/Pri2PubCrypt_Test.php: -------------------------------------------------------------------------------- 1 | phalApiCryptRSAPri2Pub = new Pri2PubCrypt(); 24 | } 25 | 26 | protected function tearDown() 27 | { 28 | } 29 | 30 | 31 | public function testHere() 32 | { 33 | $keyG = new KeyGenerator(); 34 | $prikey = $keyG->getPriKey(); 35 | $pubkey = $keyG->getPubkey(); 36 | 37 | $data = 'something important here ...'; 38 | 39 | $encryptData = $this->phalApiCryptRSAPri2Pub->encrypt($data, $prikey); 40 | 41 | $decryptData = $this->phalApiCryptRSAPri2Pub->decrypt($encryptData, $pubkey); 42 | 43 | $this->assertEquals($data, $decryptData); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/Progress/Trigger/CommonTrigger_Test.php: -------------------------------------------------------------------------------- 1 | phalApiTaskProgressTriggerCommonTrigger = new PhalApi\Task\Progress\Trigger\CommonTrigger(); 22 | } 23 | 24 | protected function tearDown() 25 | { 26 | // 输出本次单元测试所执行的SQL语句 27 | // var_dump(DI()->tracer->getSqls()); 28 | 29 | // 输出本次单元测试所涉及的追踪埋点 30 | // var_dump(DI()->tracer->getSqls()); 31 | } 32 | 33 | 34 | /** 35 | * @group testFire 36 | */ 37 | public function testFire() 38 | { 39 | $params = 'Site.Index'; 40 | 41 | $rs = $this->phalApiTaskProgressTriggerCommonTrigger->fire($params); 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /phalapi/sdk/C_Sharp/PhalApiClient/PhalApiClientResponse.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace PhalApiClientSDK 4 | { 5 | /** 6 | * 接口返回结果 7 | * 8 | * - 与接口返回的格式对应,即有:ret/data/msg 9 | */ 10 | public class PhalApiClientResponse 11 | { 12 | public int ret { get; set; } 13 | 14 | public dynamic data { get; set; } 15 | 16 | public String msg { get; set; } 17 | 18 | 19 | 20 | /** 21 | * 完全构造函数 22 | * @param int ret 23 | * @param JSONObject data 24 | * @param String msg 25 | */ 26 | public PhalApiClientResponse(int ret, dynamic data, String msg) 27 | { 28 | this.ret = ret; 29 | this.data = data; 30 | this.msg = msg; 31 | } 32 | 33 | public PhalApiClientResponse(int ret, dynamic data) 34 | { 35 | this.ret = ret; 36 | this.data = data; 37 | this.msg = ""; 38 | } 39 | 40 | public PhalApiClientResponse(int ret) 41 | { 42 | this.ret = ret; 43 | this.data = ""; 44 | this.msg = ""; 45 | } 46 | public PhalApiClientResponse() 47 | { 48 | 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/components/main/components/header-bar/custom-bread-crumb/custom-bread-crumb.vue: -------------------------------------------------------------------------------- 1 | 11 | 47 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Exception/RedirectException_Test.php: -------------------------------------------------------------------------------- 1 | phalApiExceptionRedirectException = new PhalApi\Exception\RedirectException('test', 0); 26 | } 27 | 28 | protected function tearDown() 29 | { 30 | // 输出本次单元测试所执行的SQL语句 31 | // var_dump(DI()->tracer->getSqls()); 32 | 33 | // 输出本次单元测试所涉及的追踪埋点 34 | // var_dump(DI()->tracer->getSqls()); 35 | } 36 | 37 | public function testHere() 38 | { 39 | $this->assertEquals(300, $this->phalApiExceptionRedirectException->getCode()); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Helper/TestRunner_Test.php: -------------------------------------------------------------------------------- 1 | testRunner = new TestRunner(); 25 | } 26 | 27 | protected function tearDown() 28 | { 29 | } 30 | 31 | 32 | /** 33 | * @group testGo 34 | */ 35 | public function testGo() 36 | { 37 | $url = 'demo.phalapi.net'; 38 | $params = array ( 39 | 'service' => 'Tests.InnerRunner.Go', 40 | ); 41 | 42 | $rs = TestRunner::go($url, $params); 43 | 44 | $this->assertTrue(is_array($rs)); 45 | } 46 | 47 | /** 48 | * @expectedException \PhalApi\Exception 49 | */ 50 | public function testGoWrong() 51 | { 52 | TestRunner::go('', array()); 53 | } 54 | } 55 | 56 | -------------------------------------------------------------------------------- /src/components/main/components/side-menu/side-menu-item.vue: -------------------------------------------------------------------------------- 1 | 19 | 27 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Request/Formatter/BooleanFormatter.php: -------------------------------------------------------------------------------- 1 | 2015-11-07 14 | */ 15 | 16 | 17 | class BooleanFormatter extends BaseFormatter implements Formatter { 18 | 19 | /** 20 | * 对布尔型进行格式化 21 | * 22 | * @param mixed $value 变量值 23 | * @param array $rule array('TRUE' => '成立时替换的内容', 'FALSE' => '失败时替换的内容') 24 | * @return boolean/string 格式化后的变量 25 | * 26 | */ 27 | public function parse($value, $rule) { 28 | $rs = $value; 29 | 30 | if (!is_bool($value)) { 31 | if (is_numeric($value)) { 32 | $rs = $value > 0 ? TRUE : FALSE; 33 | } else if (is_string($value)) { 34 | $rs = in_array(strtolower($value), array('ok', 'true', 'success', 'on', 'yes')) 35 | ? TRUE : FALSE; 36 | } else { 37 | $rs = $value ? TRUE : FALSE; 38 | } 39 | } 40 | 41 | return $rs; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/MemcachedMQ.php: -------------------------------------------------------------------------------- 1 | 20160430 15 | */ 16 | 17 | class MemcachedMQ extends KeyValueMQ { 18 | 19 | public function __construct(Cache $mcCache = NULL) { 20 | if ($mcCache === NULL) { 21 | $config = \PhalApi\DI()->config->get('app.Task.mq.mc'); 22 | if (!isset($config['host'])) { 23 | $config['host'] = '127.0.0.1'; 24 | } 25 | if (!isset($config['port'])) { 26 | $config['port'] = 11211; 27 | } 28 | 29 | //优先使用memcached 30 | $mcCache = extension_loaded('memcached') 31 | ? new MemcachedCache($config) 32 | : new MemcacheCache($config); 33 | } 34 | 35 | $mcCache->set('123123', time(), 31536000); 36 | 37 | parent::__construct($mcCache); 38 | } 39 | 40 | /** 41 | * 最大缓存时间,29天,因为MC的过期时间不能超过30天 42 | */ 43 | protected function getExpireTime() { 44 | return 2505600; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/MQ/Task_MQ_Redis_Test.php: -------------------------------------------------------------------------------- 1 | taskMQRedis = new PhalApi\Task\MQ\RedisMQ(); 21 | } 22 | 23 | protected function tearDown() 24 | { 25 | } 26 | 27 | 28 | /** 29 | * @group testAdd 30 | */ 31 | public function testAdd() 32 | { 33 | $service = 'TaskRedis.Test'; 34 | $params = array ( 35 | 'id' => 1, 36 | ); 37 | 38 | $rs = $this->taskMQRedis->add($service, $params); 39 | 40 | $this->taskMQRedis->add($service, array('id' => 2)); 41 | } 42 | 43 | /** 44 | * @group testPop 45 | */ 46 | public function testPop() 47 | { 48 | $service = 'TaskRedis.Test'; 49 | $num = 2; 50 | 51 | $rs = $this->taskMQRedis->pop($service, $num); 52 | 53 | $this->assertEquals(array(array('id' => 1), array('id' => 2)), $rs); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/MQ/Task_MQ_File_Test.php: -------------------------------------------------------------------------------- 1 | taskMQFile = new PhalApi\Task\MQ\FileMQ(); 21 | } 22 | 23 | protected function tearDown() 24 | { 25 | } 26 | 27 | 28 | /** 29 | * @group testAdd 30 | */ 31 | public function testAdd() 32 | { 33 | $service = 'Task_MQ_File_Default.Index'; 34 | $params = array ( 35 | 'username' => 'dogstar', 36 | ); 37 | 38 | $rs = $this->taskMQFile->add($service, $params); 39 | $rs = $this->taskMQFile->add($service, $params); 40 | $rs = $this->taskMQFile->add($service, $params); 41 | } 42 | 43 | /** 44 | * @group testPop 45 | */ 46 | public function testPop() 47 | { 48 | $service = 'Task_MQ_File_Default.Index'; 49 | $num = 2; 50 | 51 | $rs = $this->taskMQFile->pop($service, $num); 52 | $this->assertCount($num, $rs); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Cache/NoneCache_Test.php: -------------------------------------------------------------------------------- 1 | noneCache = new NoneCache(); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | } 28 | 29 | 30 | /** 31 | * @group testSet 32 | */ 33 | public function testSet() 34 | { 35 | $key = 'aKey'; 36 | $value = 'aValue'; 37 | $expire = '100'; 38 | 39 | $rs = $this->noneCache->set($key, $value, $expire); 40 | } 41 | 42 | /** 43 | * @group testGet 44 | */ 45 | public function testGet() 46 | { 47 | $key = 'aKey'; 48 | 49 | $rs = $this->noneCache->get($key); 50 | 51 | $this->assertNull($rs); 52 | } 53 | 54 | /** 55 | * @group testDelete 56 | */ 57 | public function testDelete() 58 | { 59 | $key = 'aKey'; 60 | 61 | $rs = $this->noneCache->delete($key); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/view/i18n/i18n-page.vue: -------------------------------------------------------------------------------- 1 | 24 | 25 | 40 | 41 | 51 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/phpunit.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | ./src 23 | 24 | 25 | 26 | 27 | 28 | 29 | ../src 30 | 31 | ../src/Helper/api_list_tpl.php 32 | ../src/Helper/api_desc_tpl.php 33 | ../src/Helper/ApiList.php 34 | ../src/Helper/ApiDesc.php 35 | ../src/Loader.php 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /phalapi/tests/app/Api/User_Test.php: -------------------------------------------------------------------------------- 1 | appApiUser = new User(); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | // 输出本次单元测试所执行的SQL语句 28 | // var_dump(\PhalApi\DI()->tracer->getSqls()); 29 | 30 | // 输出本次单元测试所涉及的追踪埋点 31 | // var_dump(\PhalApi\DI()->tracer->getSqls()); 32 | } 33 | 34 | 35 | /** 36 | * @group testGetRules 37 | */ 38 | public function testGetRules() 39 | { 40 | $rs = $this->appApiUser->getRules(); 41 | } 42 | 43 | /** 44 | * @group testLogin 45 | */ 46 | public function testLogin() 47 | { 48 | //Step 1. 构建请求URL 49 | $url = 'service=App.User.Login&username=dogstar&password=123456'; 50 | 51 | //Step 2. 执行请求 52 | $rs = TestRunner::go($url); 53 | 54 | //Step 3. 验证 55 | $this->assertTrue($rs['is_login']); 56 | $this->assertSame(8, $rs['user_id']); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/components/charts/bar.vue: -------------------------------------------------------------------------------- 1 | 4 | 5 | 59 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Cookie_Test.php: -------------------------------------------------------------------------------- 1 | cookie = new Cookie(); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | } 28 | 29 | 30 | /** 31 | * @group testGet 32 | */ 33 | public function testGet() 34 | { 35 | $key = NULL; 36 | 37 | $rs = $this->cookie->get($key); 38 | 39 | $this->assertTrue(is_array($rs)); 40 | 41 | $this->assertNull($this->cookie->get('noThisKey')); 42 | 43 | $_COOKIE['aKey'] = 'phalapi'; 44 | $key = 'aKey'; 45 | $this->assertEquals('phalapi', $this->cookie->get($key)); 46 | } 47 | 48 | /** 49 | * @group testSet 50 | */ 51 | public function testSet() 52 | { 53 | $key = 'bKey'; 54 | $value = '2015'; 55 | 56 | $rs = @$this->cookie->set($key, $value); 57 | 58 | //should not get in this time, but next time 59 | $this->assertNull($this->cookie->get($key)); 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/tests/MQ/Task_MQ_Memcached_Test.php: -------------------------------------------------------------------------------- 1 | taskMQMemcached = new PhalApi\Task\MQ\MemcachedMQ(); 21 | } 22 | 23 | protected function tearDown() 24 | { 25 | } 26 | 27 | 28 | /** 29 | * @group testAdd 30 | */ 31 | public function testAdd() 32 | { 33 | $service = 'Task_MQ_Memcached_Default.Index'; 34 | $params = array ( 35 | 'username' => 'dogstar', 36 | ); 37 | 38 | $rs = $this->taskMQMemcached->add($service, $params); 39 | $rs = $this->taskMQMemcached->add($service, $params); 40 | $rs = $this->taskMQMemcached->add($service, $params); 41 | } 42 | 43 | /** 44 | * @group testPop 45 | */ 46 | public function testPop() 47 | { 48 | $service = 'Task_MQ_Memcached_Default.Index'; 49 | $num = 2; 50 | 51 | $rs = $this->taskMQMemcached->pop($service, $num); 52 | $this->assertCount($num, $rs); 53 | } 54 | 55 | } 56 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/phpunit_silence.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | ./src 24 | 25 | 26 | 27 | 28 | 29 | 30 | ../src 31 | 32 | ../src/Helper/api_list_tpl.php 33 | ../src/Helper/api_desc_tpl.php 34 | ../src/Helper/ApiList.php 35 | ../src/Helper/ApiDesc.php 36 | ../src/Loader.php 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /phalapi/sdk/PHP/PhalApiClient/demo.php: -------------------------------------------------------------------------------- 1 | withHost('http://demo.phalapi.net/'); 7 | 8 | $rs = $client->reset() 9 | ->withService('Default.Index') 10 | ->withParams('username', 'dogstar') 11 | ->withTimeout(3000) 12 | ->request(); 13 | 14 | var_dump($rs->getRet()); 15 | echo "\n"; 16 | var_dump($rs->getData()); 17 | echo "\n"; 18 | var_dump($rs->getMsg()); 19 | 20 | /** 21 | 22 | int(200) 23 | 24 | array(4) { 25 | ["title"]=> 26 | string(12) "Hello World!" 27 | ["content"]=> 28 | string(36) "dogstar您好,欢迎使用PhalApi!" 29 | ["version"]=> 30 | string(5) "1.2.1" 31 | ["time"]=> 32 | int(1444925238) 33 | } 34 | 35 | string(0) "" 36 | 37 | */ 38 | 39 | echo "\n--------------------\n"; 40 | 41 | //one more time 42 | $rs = $client->reset() 43 | ->withService("User.GetBaseInfo") 44 | ->withParams("user_id", "1") 45 | ->request(); 46 | 47 | var_dump($rs->getRet()); 48 | echo "\n"; 49 | var_dump($rs->getData()); 50 | echo "\n"; 51 | var_dump($rs->getMsg()); 52 | 53 | 54 | echo "\n--------------------\n"; 55 | 56 | //illegal request 57 | $rs = $client->reset() 58 | ->withService("XXX.XXXXX") 59 | ->withParams("user_id", "1") 60 | ->request(); 61 | 62 | var_dump($rs->getRet()); 63 | echo "\n"; 64 | var_dump($rs->getData()); 65 | echo "\n"; 66 | var_dump($rs->getMsg()); 67 | 68 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Config/FileConfig_Test.php: -------------------------------------------------------------------------------- 1 | fileConfig = new FileConfig(dirname(__FILE__) . '/../../config'); 23 | } 24 | 25 | protected function tearDown() 26 | { 27 | } 28 | 29 | public function testConstruct() 30 | { 31 | } 32 | 33 | /** 34 | * @group testGet 35 | */ 36 | public function testGetDefault() 37 | { 38 | $key = 'sys.noThisKey'; 39 | $default = 2014; 40 | 41 | $rs = $this->fileConfig->get($key, $default); 42 | 43 | $this->assertSame($default, $rs); 44 | } 45 | 46 | public function testGetNormal() 47 | { 48 | $key = 'sys.debug'; 49 | 50 | $rs = $this->fileConfig->get($key); 51 | 52 | $this->assertFalse($rs); 53 | } 54 | 55 | public function testGetAll() 56 | { 57 | $key = 'dbs'; 58 | 59 | $rs = $this->fileConfig->get($key); 60 | 61 | $this->assertTrue(is_array($rs)); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /phalapi/src/app/Api/Examples/QrCode.php: -------------------------------------------------------------------------------- 1 | array( 14 | 'data' => array('name' => 'data', 'require' => true, 'desc' => '待生成二维码的内容'), 15 | 'level' => array('name' => 'level', 'type' => 'enum', 'range' => array('L','M','Q','H'), 'default' => 'L', 'desc' => '错误纠正级别,L为最小,H为最佳'), 16 | 'size' => array('name' => 'size', 'type' => 'int', 'min' => 1, 'max' => 10, 'default' => 4, 'desc' => '二维码尺寸大小'), 17 | 'isShowPic' => array('name' => 'output', 'type' => 'boolean', 'default' => true, 'desc' => '是否直接显示二维码,否的话通过base64返回二维码数据'), 18 | ), 19 | ); 20 | } 21 | 22 | /** 23 | * 根据文本内容,生成二维码 24 | * @desc 可根据传入的广西内容,生成对应的二维码,还可以调整尺寸大小。可以直接输出png图片,也可以返回base64后的图片数据。 25 | */ 26 | public function png() { 27 | $qrcode = \PhalApi\DI()->get('qrcode', new \PhalApi\QrCode\Lite()); 28 | 29 | if ($this->isShowPic) { 30 | $qrcode->png($this->data, false, $this->level, $this->size); 31 | exit(); 32 | } else { 33 | $temp = tempnam("/tmp", 'qrcode'); 34 | $qrcode->png($this->data, $temp, $this->level, $this->size); 35 | return base64_encode(file_get_contents($temp)); 36 | } 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Config/YaconfConfig_Test.php: -------------------------------------------------------------------------------- 1 | phalApiConfigYaconf = new YaconfConfig(); 32 | } 33 | 34 | protected function tearDown() 35 | { 36 | } 37 | 38 | 39 | /** 40 | * @group testGet 41 | */ 42 | public function testGet() 43 | { 44 | $key = 'test.name'; 45 | $default = NULL; 46 | 47 | $rs = $this->phalApiConfigYaconf->get($key, $default); 48 | 49 | $this->assertEquals('PhalApi', $rs); 50 | } 51 | 52 | /** 53 | * @group testHas 54 | */ 55 | public function testHas() 56 | { 57 | $key = 'test.version'; 58 | 59 | $rs = $this->phalApiConfigYaconf->has($key); 60 | 61 | $this->assertTrue($rs); 62 | } 63 | 64 | } 65 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Logger/ExplorerLogger_Test.php: -------------------------------------------------------------------------------- 1 | explorerLogger = new ExplorerLogger( 24 | Logger::LOG_LEVEL_DEBUG | Logger::LOG_LEVEL_INFO | Logger::LOG_LEVEL_ERROR); 25 | } 26 | 27 | protected function tearDown() 28 | { 29 | } 30 | 31 | 32 | /** 33 | * @group testLog 34 | */ 35 | public function testLog() 36 | { 37 | $type = 'test'; 38 | $msg = 'this is a test msg'; 39 | $data = array('from' => 'testLog'); 40 | 41 | $this->explorerLogger->log($type, $msg, $data); 42 | 43 | $this->expectOutputRegex('/TEST|this is a test msg|{"from":"testLog"}/'); 44 | } 45 | 46 | public function testLogButNoShow() 47 | { 48 | $logger = new ExplorerLogger(0); 49 | 50 | $logger->info('no info'); 51 | $logger->debug('no debug'); 52 | $logger->error('no error'); 53 | 54 | $this->expectOutputString(''); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Response/JsonResponse_Test.php: -------------------------------------------------------------------------------- 1 | phalApiResponseJsonResponse = new PhalApi\Response\JsonResponse(); 26 | 27 | if (version_compare(PHP_VERSION, '5.4', '>=')) { 28 | $this->phalApiResponseJsonResponse = new PhalApi\Response\JsonResponse(JSON_UNESCAPED_UNICODE); 29 | } 30 | } 31 | 32 | protected function tearDown() 33 | { 34 | // 输出本次单元测试所执行的SQL语句 35 | // var_dump(DI()->tracer->getSqls()); 36 | 37 | // 输出本次单元测试所涉及的追踪埋点 38 | // var_dump(DI()->tracer->getSqls()); 39 | } 40 | 41 | public function testOutput() 42 | { 43 | $this->phalApiResponseJsonResponse->setData(array('我爱中国')); 44 | $this->phalApiResponseJsonResponse->output(); 45 | $this->expectOutputRegex('/200/'); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /vue.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path') 2 | 3 | const resolve = dir => { 4 | return path.join(__dirname, dir) 5 | } 6 | 7 | // 项目部署基础 8 | // 默认情况下,我们假设你的应用将被部署在域的根目录下, 9 | // 例如:https://www.my-app.com/ 10 | // 默认:'/' 11 | // 如果您的应用程序部署在子路径中,则需要在这指定子路径 12 | // 例如:https://www.foobar.com/my-app/ 13 | // 需要将它改为'/my-app/' 14 | // iview-admin线上演示打包路径: https://file.iviewui.com/admin-dist/ 15 | const BASE_URL = process.env.NODE_ENV === 'production' 16 | ? '/' 17 | : '/' 18 | 19 | module.exports = { 20 | // Project deployment base 21 | // By default we assume your app will be deployed at the root of a domain, 22 | // e.g. https://www.my-app.com/ 23 | // If your app is deployed at a sub-path, you will need to specify that 24 | // sub-path here. For example, if your app is deployed at 25 | // https://www.foobar.com/my-app/ 26 | // then change this to '/my-app/' 27 | baseUrl: BASE_URL, 28 | // tweak internal webpack configuration. 29 | // see https://github.com/vuejs/vue-cli/blob/dev/docs/webpack.md 30 | // 如果你不需要使用eslint,把lintOnSave设为false即可 31 | lintOnSave: true, 32 | chainWebpack: config => { 33 | config.resolve.alias 34 | .set('@', resolve('src')) // key,value自行定义,比如.set('@@', resolve('src/components')) 35 | .set('_c', resolve('src/components')) 36 | }, 37 | // 打包时不生成.map文件 38 | productionSourceMap: false 39 | // 这里写你调用接口的基础路径,来解决跨域,如果设置了代理,那你本地开发环境的axios的baseUrl要写为 '' ,即空字符串 40 | // devServer: { 41 | // proxy: 'localhost:3000' 42 | // } 43 | } 44 | -------------------------------------------------------------------------------- /phalapi/sdk/Ruby/PhalApiClient/demo.rb: -------------------------------------------------------------------------------- 1 | require_relative 'phalapi_client' 2 | 3 | class MyFilter < PhalApi::ClientFilter 4 | end 5 | 6 | def show_res(response) 7 | puts "response: #{response.ret}, #{response.data}, #{response.msg}" 8 | end 9 | 10 | a_client = PhalApi::Client.create.withHost('http://demo.phalapi.net') 11 | a_response = a_client.withService('Default.Index').withParams('username', 'dogstar').withTimeout(3000).request() 12 | 13 | puts a_response.ret, a_response.data, a_response.msg 14 | 15 | puts "--------------------" 16 | 17 | a_client = PhalApi::Client.create 18 | #a_client = PhalApi::Client.new 19 | 20 | a_response = a_client.withHost('http://demo.phalapi.net').withService('Default.Index').withParams('username', 'dogstar').withParams('v', '1.3.0').request() 21 | 22 | puts "--------------------" 23 | 24 | #puts a_client 25 | show_res a_response 26 | 27 | puts "--------------------" 28 | 29 | begin 30 | a_response = a_client.reset.withParams('one').request 31 | rescue Exception => e 32 | puts e.message 33 | end 34 | 35 | puts "--------------------" 36 | 37 | a_response = a_client.reset.withFilter(MyFilter.new).withService('Default.Index').withParams('username', 'dogstar').request 38 | show_res a_response 39 | 40 | puts "--------------------" 41 | 42 | a_response = a_client.reset.withService('XXXX.noThisMethod').request 43 | puts a_response.ret, a_response.data, a_response.msg 44 | show_res a_response 45 | 46 | puts 'we done!' 47 | puts 'we done!' 48 | puts 'we done!' 49 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/RedisMQ.php: -------------------------------------------------------------------------------- 1 | config->get('app.Task.mq.redis'); 15 | 16 | if (!isset($config['host'])) { 17 | $config['host'] = '127.0.0.1'; 18 | } 19 | if (!isset($config['port'])) { 20 | $config['port'] = 6379; 21 | } 22 | if (!isset($config['prefix'])) { 23 | $config['prefix'] = 'phalapi_task'; 24 | } 25 | 26 | $redisCache = new RedisCache($config); 27 | } 28 | 29 | $this->redisCache = $redisCache; 30 | } 31 | 32 | public function add($service, $params = array()) { 33 | $num = $this->redisCache->rPush($service, $params); 34 | 35 | return $num > 0 ? TRUE : FALSE; 36 | } 37 | 38 | public function pop($service, $num = 1) { 39 | $rs = array(); 40 | 41 | while($num > 0) { 42 | $params = $this->redisCache->lPop($service); 43 | 44 | if ($params === NULL) { 45 | break; 46 | } 47 | 48 | $rs[] = $params; 49 | 50 | $num--; 51 | } 52 | 53 | return $rs; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/locale/lang/en-US.js: -------------------------------------------------------------------------------- 1 | export default { 2 | home: 'Home', 3 | components: 'Components', 4 | count_to_page: 'Count-to', 5 | tables_page: 'Table', 6 | split_pane_page: 'Split-pane', 7 | markdown_page: 'Markdown-editor', 8 | editor_page: 'Rich-Text-Editor', 9 | icons_page: 'Custom-icon', 10 | img_cropper_page: 'Image-editor', 11 | update: 'Update', 12 | doc: 'Document', 13 | api_doc: 'Api Document', 14 | join_page: 'QQ Group', 15 | update_table_page: 'Update .CSV', 16 | update_paste_page: 'Paste Table Data', 17 | multilevel: 'multilevel', 18 | directive_page: 'Directive', 19 | level_1: 'Level-1', 20 | level_2: 'Level-2', 21 | level_2_1: 'Level-2-1', 22 | level_2_3: 'Level-2-3', 23 | level_2_2: 'Level-2-2', 24 | level_2_2_1: 'Level-2-2-1', 25 | level_2_2_2: 'Level-2-2-2', 26 | excel: 'Excel', 27 | 'upload-excel': 'Upload Excel', 28 | 'export-excel': 'Export Excel', 29 | tools_methods_page: 'Tools Methods', 30 | drag_list_page: 'Drag-list', 31 | i18n_page: 'Internationalization', 32 | modalTitle: 'Modal Title', 33 | content: 'This is the modal box content.', 34 | buttonText: 'Show Modal', 35 | 'i18n-tip': 'Note: Only this page is multi-language, other pages do not add language content to the multi-language package.', 36 | error_store_page: 'Error Collection', 37 | error_logger_page: 'Error Logger', 38 | query: 'Query', 39 | params: 'Params', 40 | cropper_page: 'Cropper', 41 | message_page: 'Message Center', 42 | tree_table_page: 'Tree Table' 43 | } 44 | -------------------------------------------------------------------------------- /src/components/main/components/user/user.vue: -------------------------------------------------------------------------------- 1 | 17 | 18 | 60 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Request/Formatter/DateFormatter.php: -------------------------------------------------------------------------------- 1 | 2015-11-07 14 | */ 15 | 16 | class DateFormatter extends BaseFormatter implements Formatter { 17 | 18 | /** 19 | * 对日期进行格式化 20 | * 21 | * @param timestamp $value 变量值 22 | * @param array $rule array('format' => 'timestamp', 'min' => '最小值', 'max' => '最大值') 23 | * @return timesatmp/string 格式化后的变量 24 | * 25 | */ 26 | public function parse($value, $rule) { 27 | $rs = $value; 28 | 29 | $ruleFormat = !empty($rule['format']) ? strtolower($rule['format']) : ''; 30 | if ($ruleFormat == 'timestamp') { 31 | $rs = strtotime($value); 32 | if ($rs <= 0) { 33 | $rs = 0; 34 | } 35 | 36 | if (isset($rule['min']) && !is_numeric($rule['min'])) { 37 | $rule['min'] = strtotime($rule['min']); 38 | } 39 | if (isset($rule['max']) && !is_numeric($rule['max'])) { 40 | $rule['max'] = strtotime($rule['max']); 41 | } 42 | 43 | $rs = $this->filterByRange($rs, $rule); 44 | } 45 | 46 | return $rs; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/tests/src/Response/JsonpResponse_Test.php: -------------------------------------------------------------------------------- 1 | phalApiResponseJsonpResponse = new PhalApi\Response\JsonpResponse('foo'); 26 | if (version_compare(PHP_VERSION, '5.4', '>=')) { 27 | $this->phalApiResponseJsonpResponse = new PhalApi\Response\JsonpResponse('foo', JSON_UNESCAPED_UNICODE | JSON_FORCE_OBJECT); 28 | } 29 | } 30 | 31 | protected function tearDown() 32 | { 33 | // 输出本次单元测试所执行的SQL语句 34 | // var_dump(DI()->tracer->getSqls()); 35 | 36 | // 输出本次单元测试所涉及的追踪埋点 37 | // var_dump(DI()->tracer->getSqls()); 38 | } 39 | 40 | public function testOutput() 41 | { 42 | $this->phalApiResponseJsonpResponse->setData(array('我爱中国')); 43 | $this->phalApiResponseJsonpResponse->output(); 44 | $this->expectOutputRegex('/foo/'); 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/directive/module/draggable.js: -------------------------------------------------------------------------------- 1 | import { on } from '@/libs/tools' 2 | export default { 3 | inserted: (el, binding, vnode) => { 4 | let triggerDom = document.querySelector(binding.value.trigger) 5 | triggerDom.style.cursor = 'move' 6 | let bodyDom = document.querySelector(binding.value.body) 7 | let pageX = 0 8 | let pageY = 0 9 | let transformX = 0 10 | let transformY = 0 11 | let canMove = false 12 | const handleMousedown = e => { 13 | let transform = /\(.*\)/.exec(bodyDom.style.transform) 14 | if (transform) { 15 | transform = transform[0].slice(1, transform[0].length - 1) 16 | let splitxy = transform.split('px, ') 17 | transformX = parseFloat(splitxy[0]) 18 | transformY = parseFloat(splitxy[1].split('px')[0]) 19 | } 20 | pageX = e.pageX 21 | pageY = e.pageY 22 | canMove = true 23 | } 24 | const handleMousemove = e => { 25 | let xOffset = e.pageX - pageX + transformX 26 | let yOffset = e.pageY - pageY + transformY 27 | if (canMove) bodyDom.style.transform = `translate(${xOffset}px, ${yOffset}px)` 28 | } 29 | const handleMouseup = e => { 30 | canMove = false 31 | } 32 | on(triggerDom, 'mousedown', handleMousedown) 33 | on(document, 'mousemove', handleMousemove) 34 | on(document, 'mouseup', handleMouseup) 35 | }, 36 | update: (el, binding, vnode) => { 37 | if (!binding.value.recover) return 38 | let bodyDom = document.querySelector(binding.value.body) 39 | bodyDom.style.transform = '' 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /phalapi/src/app/Api/Message.php: -------------------------------------------------------------------------------- 1 | [ 14 | 'msgId' => ['name' => 'msg_id', 'require' => true, 'desc' => '消息ID'], 15 | ], 16 | ]; 17 | } 18 | 19 | /** 20 | * 新消息数量 21 | */ 22 | public function count() { 23 | return 3; 24 | } 25 | 26 | /** 27 | * 初始化接口 28 | */ 29 | public function initMsg() { 30 | $unread = [ 31 | ['title' => '测试未读', 'create_time' => '2018-12-12', 'msg_id' => 100], 32 | ]; 33 | $readed = [ 34 | ['title' => '测试已读', 'create_time' => '2018-12-12', 'msg_id' => 101], 35 | ]; 36 | $trash = [ 37 | ['title' => '测试删除', 'create_time' => '2018-12-12', 'msg_id' => 102], 38 | ]; 39 | 40 | return ['unread' => $unread, 'readed' => $readed, 'trash' => $trash]; 41 | } 42 | 43 | /** 44 | * 获取消息内容 45 | */ 46 | public function content() { 47 | return '神奇的接口!当前需要获取的消息ID是:' . $this->msgId; 48 | } 49 | 50 | /** 51 | * 是否有未读消息 52 | */ 53 | public function hasRead() { 54 | return true; 55 | } 56 | 57 | /** 58 | * 标志为已读 59 | */ 60 | public function removeReaded() { 61 | return true; 62 | } 63 | 64 | /** 65 | * 恢复 66 | */ 67 | public function restore() { 68 | return true; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/task/src/MQ/KeyValueMQ.php: -------------------------------------------------------------------------------- 1 | 20160430 13 | */ 14 | 15 | class KeyValueMQ implements MQ { 16 | 17 | /** 18 | * @var PhalApi_Cache_Memcached/PhalApi_Cache_Memcache/PhalApi_Cache_File $kvCache 缓存实例 19 | */ 20 | protected $kvCache; 21 | 22 | public function __construct(Cache $kvCache) { 23 | $this->kvCache = $kvCache; 24 | } 25 | 26 | public function add($service, $params = array()) { 27 | $list = $this->kvCache->get($service); 28 | if (empty($list)) { 29 | $list = array(); 30 | } 31 | 32 | $list[] = $params; 33 | 34 | $this->kvCache->set($service, $list, $this->getExpireTime()); 35 | 36 | $list = $this->kvCache->get($service); 37 | 38 | return true; 39 | } 40 | 41 | public function pop($service, $num = 1) { 42 | $rs = array(); 43 | if ($num <= 0) { 44 | return $rs; 45 | } 46 | 47 | $list = $this->kvCache->get($service); 48 | if (empty($list)) { 49 | $list = array(); 50 | } 51 | 52 | $rs = array_splice($list, 0, $num); 53 | 54 | $this->kvCache->set($service, $list, $this->getExpireTime()); 55 | 56 | return $rs; 57 | } 58 | 59 | /** 60 | * 最大缓存时间,一年 61 | */ 62 | protected function getExpireTime() { 63 | return 31536000; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /phalapi/vendor/phalapi/kernal/src/Model/Query.php: -------------------------------------------------------------------------------- 1 | 2015-02-22 14 | */ 15 | 16 | class Query { 17 | 18 | /** 19 | * @var boolean $readCache 是否读取缓存 20 | */ 21 | public $readCache = true; 22 | 23 | /** 24 | * @var boolean $writeCache 是否写入缓存 25 | */ 26 | public $writeCache = true; 27 | 28 | /** 29 | * @var string/int ID 30 | */ 31 | public $id; 32 | 33 | /** 34 | * @var int $timestamp 时间戳 35 | */ 36 | public $timestamp; 37 | 38 | public function __construct($queryArr = array()) { 39 | $this->timestamp = $_SERVER['REQUEST_TIME']; 40 | 41 | if (\PhalApi\DI()->debug) { 42 | $this->readCache = FALSE; 43 | $this->writeCache = FALSE; 44 | } 45 | 46 | foreach ($queryArr as $key => $value) { 47 | $this->$key = $value; 48 | } 49 | } 50 | 51 | public function __set($name, $value) { 52 | $this->$name = $value; 53 | } 54 | 55 | public function __get($name) { 56 | if (isset($this->$name)) { 57 | return $this->$name; 58 | } 59 | 60 | return NULL; 61 | } 62 | 63 | public function toArray() { 64 | return get_object_vars($this); 65 | } 66 | } 67 | --------------------------------------------------------------------------------