mirror of
https://gitee.com/niucloud-team/niucloud.git
synced 2025-12-12 01:47:08 +00:00
up
This commit is contained in:
parent
44e7ce9a5d
commit
6648951a28
@ -1,14 +1,19 @@
|
||||
<?php
|
||||
return [
|
||||
'pages' => <<<EOT
|
||||
// PAGE_BEGIN
|
||||
// *********************************** hello world ***********************************
|
||||
{
|
||||
"path": "{{addon_name}}/pages/hello_world/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%{{addon_name}}.pages.hello_world.index%"
|
||||
// PAGE_BEGIN
|
||||
// *********************************** {{addon_name}} ***********************************
|
||||
{
|
||||
"root": "addon/{{addon_name}}",
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/hello_world/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%{{addon_name}}.pages.hello_world.index%"
|
||||
}
|
||||
}
|
||||
},
|
||||
// PAGE_END
|
||||
]
|
||||
},
|
||||
// PAGE_END
|
||||
EOT
|
||||
];
|
||||
|
||||
7
niucloud/app/service/core/addon/vm/vm/admin/api.vm
Normal file
7
niucloud/app/service/core/addon/vm/vm/admin/api.vm
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** hello world ****************************************************/
|
||||
export function getHelloWorld() {
|
||||
return request.get(`{key}/hello_world`)
|
||||
}
|
||||
1
niucloud/app/service/core/addon/vm/vm/admin/lang.vm
Normal file
1
niucloud/app/service/core/addon/vm/vm/admin/lang.vm
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
17
niucloud/app/service/core/addon/vm/vm/admin/views.vm
Normal file
17
niucloud/app/service/core/addon/vm/vm/admin/views.vm
Normal file
@ -0,0 +1,17 @@
|
||||
<template>
|
||||
<span class="text-[20px]">{{hello_world_text}}</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { getHelloWorld } from '@/addon/{key}/api/hello_world'
|
||||
|
||||
const hello_world_text = ref('');
|
||||
const getHelloWorldInfo = async () => {
|
||||
hello_world_text.value = await (await getHelloWorld()).data
|
||||
}
|
||||
getHelloWorldInfo()
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
</style>
|
||||
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
return [
|
||||
'pages' => <<<EOT
|
||||
// PAGE_BEGIN
|
||||
// *********************************** {{addon_name}} ***********************************
|
||||
{
|
||||
"root": "addon/{{addon_name}}",
|
||||
"pages": [
|
||||
{
|
||||
"path": "pages/hello_world/index",
|
||||
"style": {
|
||||
"navigationBarTitleText": "%{{addon_name}}.pages.hello_world.index%"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
// PAGE_END
|
||||
EOT
|
||||
];
|
||||
36
niucloud/app/service/core/addon/vm/vm/system/addon.vm
Normal file
36
niucloud/app/service/core/addon/vm/vm/system/addon.vm
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace addon\{key};
|
||||
|
||||
|
||||
/**
|
||||
* 插件安装之后单独的插件方法
|
||||
*/
|
||||
class Addon
|
||||
{
|
||||
/**
|
||||
* 插件安装执行
|
||||
*/
|
||||
public function install()
|
||||
{
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件卸载执行
|
||||
*/
|
||||
public function uninstall()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* 插件升级执行
|
||||
*/
|
||||
public function upgrade()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,29 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace addon\{key}\app\adminapi\controller\hello_world;
|
||||
|
||||
use core\base\BaseAdminController;
|
||||
use think\Response;
|
||||
|
||||
class Index extends BaseAdminController
|
||||
{
|
||||
/**
|
||||
* Hello World
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return success('SUCCESS', 'Hello World');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
30
niucloud/app/service/core/addon/vm/vm/system/admin_route.vm
Normal file
30
niucloud/app/service/core/addon/vm/vm/system/admin_route.vm
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use think\facade\Route;
|
||||
|
||||
use app\adminapi\middleware\AdminCheckRole;
|
||||
use app\adminapi\middleware\AdminCheckToken;
|
||||
use app\adminapi\middleware\AdminLog;
|
||||
|
||||
/**
|
||||
* {title}
|
||||
*/
|
||||
Route::group('{key}', function () {
|
||||
|
||||
/***************************************************** hello world ****************************************************/
|
||||
Route::get('hello_world', 'addon\{key}\app\adminapi\controller\hello_world\Index@index');
|
||||
|
||||
})->middleware([
|
||||
AdminCheckToken::class,
|
||||
AdminCheckRole::class,
|
||||
AdminLog::class
|
||||
]);
|
||||
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace addon\{key}\app\api\controller\hello_world;
|
||||
|
||||
use core\base\BaseApiController;
|
||||
use think\Response;
|
||||
|
||||
class Index extends BaseApiController
|
||||
{
|
||||
/**
|
||||
* Hello World
|
||||
* @return Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return success('SUCCESS', 'Hello World');
|
||||
}
|
||||
}
|
||||
36
niucloud/app/service/core/addon/vm/vm/system/api_route.vm
Normal file
36
niucloud/app/service/core/addon/vm/vm/system/api_route.vm
Normal file
@ -0,0 +1,36 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | Niucloud-admin 企业快速开发的多应用管理平台
|
||||
// +----------------------------------------------------------------------
|
||||
// | 官方网址:https://www.niucloud.com
|
||||
// +----------------------------------------------------------------------
|
||||
// | niucloud团队 版权所有 开源版本可自由商用
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: Niucloud Team
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
use app\api\middleware\ApiCheckToken;
|
||||
use app\api\middleware\ApiLog;
|
||||
use app\api\middleware\ApiChannel;
|
||||
use think\facade\Route;
|
||||
|
||||
|
||||
/**
|
||||
* {title}
|
||||
*/
|
||||
Route::group('{key}', function() {
|
||||
/***************************************************** hello world ****************************************************/
|
||||
Route::get('hello_world', 'addon\{key}\app\api\controller\hello_world\Index@index');
|
||||
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class, false) //false表示不验证登录
|
||||
->middleware(ApiLog::class);
|
||||
|
||||
|
||||
|
||||
Route::group('{key}', function() {
|
||||
|
||||
})->middleware(ApiChannel::class)
|
||||
->middleware(ApiCheckToken::class, true) //表示验证登录
|
||||
->middleware(ApiLog::class);
|
||||
|
||||
4
niucloud/app/service/core/addon/vm/vm/system/common.vm
Normal file
4
niucloud/app/service/core/addon/vm/vm/system/common.vm
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
];
|
||||
12
niucloud/app/service/core/addon/vm/vm/system/event.vm
Normal file
12
niucloud/app/service/core/addon/vm/vm/system/event.vm
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'bind' => [
|
||||
|
||||
],
|
||||
'listen' => [
|
||||
|
||||
],
|
||||
'subscribe' => [
|
||||
],
|
||||
];
|
||||
11
niucloud/app/service/core/addon/vm/vm/system/info.vm
Normal file
11
niucloud/app/service/core/addon/vm/vm/system/info.vm
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"title": "{title}",
|
||||
"desc": "{desc}",
|
||||
"key": "{key}",
|
||||
"version": "{version}",
|
||||
"author": "{author}",
|
||||
"type": "{type}",
|
||||
"support_app": "{support_app}",
|
||||
"compile":[],
|
||||
"support_version": "{support_version}"
|
||||
}
|
||||
33
niucloud/app/service/core/addon/vm/vm/system/menu.vm
Normal file
33
niucloud/app/service/core/addon/vm/vm/system/menu.vm
Normal file
@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
[
|
||||
'menu_name' => '{title}',
|
||||
'menu_key' => '{key}',
|
||||
'menu_type' => 0,
|
||||
'icon' => '',
|
||||
'api_url' => '',
|
||||
'router_path' => '',
|
||||
'view_path' => '',
|
||||
'methods' => '',
|
||||
'sort' => 100,
|
||||
'status' => 1,
|
||||
'is_show' => 1,
|
||||
'children' => [
|
||||
[
|
||||
'menu_name' => '{title}',
|
||||
'menu_key' => '{key}_hello_world',
|
||||
'menu_type' => 1,
|
||||
'icon' => '',
|
||||
'api_url' => '{key}/hello_world',
|
||||
'router_path' => '{key}/hello_world',
|
||||
'view_path' => 'hello_world/index',
|
||||
'methods' => 'get',
|
||||
'sort' => 100,
|
||||
'status' => 1,
|
||||
'is_show' => 1,
|
||||
'children' => []
|
||||
],
|
||||
]
|
||||
]
|
||||
];
|
||||
8
niucloud/app/service/core/addon/vm/vm/uni-app/api.vm
Normal file
8
niucloud/app/service/core/addon/vm/vm/uni-app/api.vm
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
import request from '@/utils/request'
|
||||
|
||||
/***************************************************** hello world ****************************************************/
|
||||
export function getHelloWorld() {
|
||||
return request.get(`{key}/hello_world`)
|
||||
}
|
||||
|
||||
2
niucloud/app/service/core/addon/vm/vm/uni-app/lang.vm
Normal file
2
niucloud/app/service/core/addon/vm/vm/uni-app/lang.vm
Normal file
@ -0,0 +1,2 @@
|
||||
{}
|
||||
|
||||
18
niucloud/app/service/core/addon/vm/vm/uni-app/views.vm
Normal file
18
niucloud/app/service/core/addon/vm/vm/uni-app/views.vm
Normal file
@ -0,0 +1,18 @@
|
||||
<template>
|
||||
<text class="text-[20px]">{{helloWorld}}</text>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import { getHelloWorld } from '@/addon/{key}/api/hello_world'
|
||||
import { onLoad } from '@dcloudio/uni-app'
|
||||
let helloWorld = ref('');
|
||||
onLoad(() => {
|
||||
getHelloWorld().then((res) => {
|
||||
helloWorld.value = res.data
|
||||
})
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
|
||||
</style>
|
||||
8
niucloud/app/service/core/addon/vm/vm/web/api.vm
Normal file
8
niucloud/app/service/core/addon/vm/vm/web/api.vm
Normal file
@ -0,0 +1,8 @@
|
||||
|
||||
/**
|
||||
* hello world
|
||||
*/
|
||||
export function getHelloWorld() {
|
||||
return request.get('{key}/hello_world')
|
||||
}
|
||||
|
||||
1
niucloud/app/service/core/addon/vm/vm/web/lang.vm
Normal file
1
niucloud/app/service/core/addon/vm/vm/web/lang.vm
Normal file
@ -0,0 +1 @@
|
||||
{}
|
||||
9
niucloud/app/service/core/addon/vm/vm/web/lang_pages.vm
Normal file
9
niucloud/app/service/core/addon/vm/vm/web/lang_pages.vm
Normal file
@ -0,0 +1,9 @@
|
||||
{
|
||||
"pages": {
|
||||
"{key}": {
|
||||
"hello_world": {
|
||||
"index": "hello_world"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
6
niucloud/app/service/core/addon/vm/vm/web/routes.vm
Normal file
6
niucloud/app/service/core/addon/vm/vm/web/routes.vm
Normal file
@ -0,0 +1,6 @@
|
||||
export default [
|
||||
{
|
||||
path: "/{key}/hello_world/index",
|
||||
component: () => import('~/addon/{key}/pages/hello_world/index.vue')
|
||||
}
|
||||
]
|
||||
15
niucloud/app/service/core/addon/vm/vm/web/view.vm
Normal file
15
niucloud/app/service/core/addon/vm/vm/web/view.vm
Normal file
@ -0,0 +1,15 @@
|
||||
<template>
|
||||
<span class="text-[24px]">{{hello_world_text}}</span>
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref } from 'vue'
|
||||
import { getHelloWorld } from '@/addon/{key}/api/hello_world'
|
||||
|
||||
const hello_world_text = ref('');
|
||||
|
||||
getHelloWorld().then(res => {
|
||||
hello_world_text.value = res.data;
|
||||
})
|
||||
</script>
|
||||
<style lang="scss" scoped></style>
|
||||
Loading…
x
Reference in New Issue
Block a user