提交 4d62b8b7 编写于 作者: S server

develop

上级 c30a4f66
!function(o){var e={};function i(n){if(e[n])return e[n].exports;var t=e[n]={i:n,l:!1,exports:{}};return o[n].call(t.exports,t,t.exports,i),t.l=!0,t.exports}i.m=o,i.c=e,i.d=function(n,t,o){i.o(n,t)||Object.defineProperty(n,t,{enumerable:!0,get:o})},i.r=function(n){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},i.t=function(t,n){if(1&n&&(t=i(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(i.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)i.d(o,e,function(n){return t[n]}.bind(null,e));return o},i.n=function(n){var t=n&&n.__esModule?function(){return n.default}:function(){return n};return i.d(t,"a",t),t},i.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},i.p="/vendor/AdminManager/",i(i.s=0)}([function(n,t,o){!function(r){r(function(){var t,n,o=window.api.dialog,e=window.api.base,i=window.__msAdminRoot;0<r("[data-admin-version]").length&&(r(document).on("click","[data-admin-upgrade]",function(){return o.confirm("请在升级之前做好系统备份,确定升级?",function(){o.confirm("再次确定已经做好数据备份,确定升级?",function(){o.confirm("升级需要最长可能10分钟的时间,请在升级过程中不要关闭浏览器",function(){t("init")})})}),!1}),t=function(n){o.loadingOn(),e.post(i+"upgrade/"+n,{},function(n){o.loadingOff(),e.defaultFormCallback(n,{success:function(n){"finish"===n.data.action?o.alertSuccess("升级完成",function(){window.location.href=i+"logout"}):(o.tipSuccess(n.data.msg),setTimeout(function(){t(n.data.action)},2e3))}})})},n=r("[data-admin-version]").attr("data-admin-version"),r("body").append('<script src="https://www.tecmz.com/product/'+window.__version_check_app+"/version_check?domain="+window.location.host+"&version="+n+'"><\/script>'))})}.call(this,o(1))},function(n,t){n.exports=window.$}]);
\ No newline at end of file
后台管理配置
---
- 提供后台管理公共的基础服务
......@@ -3,7 +3,7 @@
"require": [
"Vendor"
],
"title": "管理员管理",
"title": "后台管理配置",
"version": "1.0.0",
"author": "官方",
"description": "提供管理员角色、管理员、管理日志功能"
......
{
"devDependencies": {
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"babel-loader": "^8.2.2",
"babel-plugin-transform-remove-strict-mode": "^0.0.2",
"css-loader": "^5.0.1",
"expose-loader": "^1.0.3",
"extract-text-webpack-plugin": "^4.0.0-beta.0",
"file-loader": "^6.2.0",
"gulp": "^4.0.2",
"gulp-clean-css": "^4.3.0",
"gulp-less": "^4.0.1",
"gulp-print": "^5.0.2",
"gulp-style-aliases": "^1.1.11",
"jsx-loader": "^0.13.2",
"less": "^3.13.1",
"less-loader": "^5.0.0",
"merge-stream": "^2.0.0",
"on-build-webpack": "^0.1.0",
"style-loader": "^2.0.0",
"uglify-js": "^3.12.6",
"url-loader": "^4.1.1",
"vue-loader": "^15.9.6",
"vue-template-compiler": "^2.6.12",
"webpack": "^4.46.0",
"webpack-build-notifier": "^2.1.1",
"webpack-cli": "^4.5.0"
},
"dependencies": {
"dateformat": "^4.5.1",
"element-ui": "^2.15.1",
"jquery": "^3.5.1",
"js-cookie": "^2.2.1",
"md5": "^2.3.0",
"query-string": "^6.14.0",
"randomstring": "^1.1.5",
"sprintf-js": "^1.1.2",
"ua-parser-js": "^0.7.24",
"vue": "^2.6.12",
"vue-clipboard2": "^0.3.1",
"xlsx": "^0.16.9",
"isutf8": "^3.0.0"
}
}
$(function () {
var Dialog = window.api.dialog;
var Base = window.api.base;
var AdminUrl = window.__msAdminRoot;
if ($('[data-admin-version]').length > 0) {
$(document).on('click', '[data-admin-upgrade]', function () {
Dialog.confirm("请在升级之前做好系统备份,确定升级?", function () {
Dialog.confirm("再次确定已经做好数据备份,确定升级?", function () {
Dialog.confirm("升级需要最长可能10分钟的时间,请在升级过程中不要关闭浏览器", function () {
request('init');
});
});
});
return false;
});
var request = function (action) {
Dialog.loadingOn();
Base.post(AdminUrl + 'upgrade/' + action, {}, function (res) {
Dialog.loadingOff();
Base.defaultFormCallback(res, {
success: function (res) {
if (res.data.action === 'finish') {
Dialog.alertSuccess('\u5347\u7ea7\u5b8c\u6210', function () {
window.location.href = AdminUrl + 'logout';
});
} else {
Dialog.tipSuccess(res.data.msg);
setTimeout(function () {
request(res.data.action);
}, 2000);
}
}
});
});
};
var version = $('[data-admin-version]').attr('data-admin-version');
$('body').append('<script src="https://www.tecmz.com/product/' + window.__version_check_app + '/version_check?domain=' + window.location.host + '&version=' + version + '"></script>');
}
});
const webpack = require('./../../../../vendor/modstart/modstart/resources/asset/src/mod/webpack.js');
module.exports = webpack(__dirname)
......@@ -147,8 +147,7 @@ class ModuleStoreController extends Controller
$version = $dataInput->getTrimString('version');
BizException::throwsIfEmpty('module为空', $module);
BizException::throwsIfEmpty('version为空', $version);
BizException::throwsIf('系统模块不能动态配置', ModuleManager::isSystemModule($module));
switch ($step) {
switch ($step) {
case 'installModule':
$ret = ModuleManager::install($module);
BizException::throwsIfResponseError($ret);
......
......@@ -6,9 +6,6 @@
<div id="app"></div>
@endsection
{!! \ModStart\ModStart::js('asset/vendor/jqueryMark.js') !!}
{!! \ModStart\ModStart::style('[data-markjs]{color:red !important;background:transparent;}') !!}
@section('bodyAppend')
<script src="@asset('asset/vendor/vue.js')"></script>
<script src="@asset('asset/vendor/element-ui/index.js')"></script>
......
......@@ -4,6 +4,11 @@
<i class="iconfont icon-warning"></i>
应用可在线安装、卸载、禁用、启用、配置、升级插件,插件升级前请做好备份。
</div>
<div v-if="!memberUser.id" class="ub-alert ub-alert-danger">
<i class="iconfont icon-warning"></i>
您还没有登录,登录后才能从模块市场安装、升级模块
<a href="javascript:;" @click="doMemberLoginShow()">立即登录</a>
</div>
<div class="tw-bg-white tw-rounded">
<el-tabs v-model="search.tab" style="height:45px;">
<el-tab-pane name="store">
......@@ -85,6 +90,7 @@
<div class="tw-w-28 tw-float-left" style="margin-left:-6rem;">
<a v-if="module.url"
:href="module.url"
target="_blank"
class="ub-cover-3-2 tw-shadow tw-w-28 tw-rounded"
:style="{'background-image':'url('+module.cover+')'}"></a>
<div v-else
......@@ -97,7 +103,7 @@
<a :href="module.url" target="_blank"
class="tw-font-bold tw-text-gray-700 ub-text-truncate tw-block">
<span v-if="module._isLocal" class="ub-tag primary sm ub-bg-a">本地插件</span>
<span class="pb-search-keywords">{{module.title}}</span>
<span v-html="$highlight(module.title,search.keywords)"></span>
</a>
<div>
<span v-if="!module.isFee && !module._isLocal"
......@@ -107,9 +113,9 @@
<span v-else-if="module.priceSuperEnable">{{module.priceSuper}}</span>
</div>
</div>
<div class="tw-text-gray-400 tw-text-sm tw-mt-2 pb-search-keywords" style="height:2rem;overflow:auto;">
{{module.description}}
</div>
<div class="tw-text-gray-400 tw-text-sm tw-mt-2"
style="height:2rem;overflow:auto;"
v-html="$highlight(module.description,search.keywords)"></div>
</div>
</div>
<div v-if="!module._isSystem"
......@@ -149,22 +155,27 @@
</div>
<div v-else
class="tw-border-0 tw-border-solid tw-border-t tw-border-gray-100 tw-mt-2 tw-pt-2 tw-text-gray-500">
<div class="ub-text-muted">
<span class="ub-text-muted">
系统模块不能动态配置
</div>
</span>
<a v-if="module._isInstalled && !module._isLocal && module.latestVersion && module.latestVersion!==module._localVersion"
@click="doUpgrade(module)"
href="javascript:;" class="ub-text-warning tw-mr-4">
<i class="iconfont icon-direction-up"></i> 升级
</a>
</div>
<div class="tw-border-0 tw-border-solid tw-border-t tw-border-gray-100 tw-mt-2 tw-pt-2 tw-text-gray-500">
<div class="ub-text-muted" v-if="module._isLocal">
标识:<span class="pb-search-keywords">{{module.name}}</span>
版本 V{{module._localVersion}}
标识:<span v-html="$highlight(module.name,search.keywords)"></span>
版本V{{module._localVersion}}
</div>
<div class="ub-text-muted" v-else-if="module._isInstalled">
标识:<span class="pb-search-keywords">{{module.name}}</span>
已安装 V{{module._localVersion}} 版,最新版 V{{module.latestVersion}}
标识:<span v-html="$highlight(module.name,search.keywords)"></span>
已安装V{{module._localVersion}},最新版V{{module.latestVersion}}
</div>
<div class="ub-text-muted" v-else>
标识:<span class="pb-search-keywords">{{module.name}}</span>
最新版 V{{module.latestVersion}}
标识:<span v-html="$highlight(module.name,search.keywords)"></span>
最新版V{{module.latestVersion}}
</div>
</div>
</div>
......@@ -201,12 +212,12 @@
<div class="label">验证码</div>
<div class="field">
<div class="row no-gutters">
<div class="col-6">
<div class="col-8">
<input type="text" class="form" v-model="memberLoginInfo.captcha"
autocomplete="off"
placeholder="图片验证码"/>
</div>
<div class="col-6">
<div class="col-4">
<img class="captcha" title="刷新验证" :src="memberLoginCaptchaImage"
@click="doMemberLoginCaptchaRefresh()"/>
</div>
......@@ -220,6 +231,11 @@
</button>
</div>
</div>
<div class="line">
<div class="field">
还没有账号?<a href="https://modstart.com" target="_blank">立即注册</a>
</div>
</div>
</div>
</div>
</div>
......@@ -351,12 +367,6 @@
}
return true
})
if (this.search.keywords) {
this.$nextTick(() => {
$('.pb-search-keywords').unmark();
$('.pb-search-keywords').mark(this.search.keywords, {});
})
}
return results
}
},
......@@ -404,8 +414,8 @@
this.$dialog.confirm('确认退出?', () => {
this.storeApiToken = ''
Storage.set('storeApiToken', '')
this.doLoadStoreMember()
this.memberUserShow = false
this.doLoadStore()
})
},
doMemberLoginSubmit() {
......@@ -429,7 +439,9 @@
if (this.memberUser.id > 0) {
this.memberUserShow = true
} else {
this.$dialog.loadingOn()
this.doMemberLoginCaptchaRefresh(() => {
this.$dialog.loadingOff()
this.memberUserShow = true
})
}
......
ModStart基础包,提供公共的基础服务
ModStart基础包
---
- 提供公共的基础服务
{
"name": "Vendor",
"title": "通用功能包",
"version": "1.0.0",
"author": "官方",
......
// vue 依赖已经在 webpack 中去除,需要外部引入
import Vue from 'vue'
import {StrUtil, UrlUtil} from './../svue/lib/util'
import {StrUtil, UrlUtil, HtmlUtil} from './../svue/lib/util'
const Dialog = window.api.dialog
const Base = window.api.base
......@@ -28,6 +28,17 @@ Vue.prototype.$onCopyError = () => {
Dialog.tipError((window.lang && window.lang['Copy Fail']) ? window.lang['Copy Fail'] : 'Copy Fail')
}
Vue.prototype.$highlight = (words, query) =>{
words = HtmlUtil.specialchars(words)
if (!query) {
return words
}
const iQuery = new RegExp(query, "ig");
return words.toString().replace(iQuery, function (matchedTxt, a, b) {
return ('<span data-highlight class="tw-text-red-500">' + matchedTxt + '</span>');
});
}
import routie from 'webix-routie'
const HashRouter = {
......
......@@ -34,6 +34,41 @@ export const DatetimeFormat = {
}
}
export const HtmlUtil = {
specialchars: function (str) {
var s = [];
if (!str) {
return '';
}
if (str.length == 0) {
return '';
}
for (var i = 0; i < str.length; i++) {
switch (str.substr(i, 1)) {
case "<":
s.push("&lt;");
break;
case ">":
s.push("&gt;");
break;
case "&":
s.push("&amp;");
break;
case " ":
s.push("&nbsp;");
break;
case "\"":
s.push("&quot;");
break;
default:
s.push(str.substr(i, 1));
break;
}
}
return s.join('');
}
}
export const FormatUtil = {
telephone(number) {
if (!number) {
......
......@@ -20,7 +20,11 @@ class AdminMenu
if ($item instanceof \Closure) {
$item = call_user_func($item);
}
$menu = array_merge($menu, $item);
if (isset($item['title'])) {
$menu = array_merge($menu, [$item]);
} else {
$menu = array_merge($menu, $item);
}
}
return $menu;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册