自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(6)
  • 资源 (37)
  • 收藏
  • 关注

原创 Ultools在线工具平台【在线聊天室 】上线了

在线聊天室工具可以在公共聊天室一起聊天,也可以创建单独的房间与好友一起聊天 访问地址:https://ultools.com/life/chat/index Ultools在线工具平台是功能最全的网页工具平台 平台包含生活中常见的小工具,开发者常用开发工具与数据爬虫和重要数据的下载。 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-09-14 16:38:15 233

原创 Ultools在线工具平台【在线时钟 】上线啦!

在线时钟包含闹钟,计时器,秒表,世界时间4个功能, 访问地址:https://ultools.com/life/clock/alarm Ultools在线工具平台是功能最全的网页工具平台 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-09-11 19:51:38 753

原创 Ultools在线工具平台【网站截全图 】

访问地址:http://ultools.com/life/image/pageshot Ultools在线工具平台是功能最全的网页工具平台 平台包含生活中常见的小工具,开发者常用开发工具与数据爬虫和重要数据的下载。 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-06-06 14:46:40 151

原创 Ultools在线工具平台【字帖生成器 】

访问地址:http://ultools.com/life/font/copybook Ultools在线工具平台是功能最全的网页工具平台 平台包含生活中常见的小工具,开发者常用开发工具与数据爬虫和重要数据的下载。 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-06-04 22:01:13 688

原创 Ultools在线工具平台【图片裁剪工具】

访问地址:http://ultools.com/life/image/crop Ultools在线工具平台是功能最全的网页工具平台 平台包含生活中常见的小工具,开发者常用开发工具与数据爬虫和重要数据的下载。 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-06-04 21:57:17 208

原创 2020-06-04

Ultools在线工具平台是功能最全的网页工具平台 网站地址:http://ultools.com 平台包含生活中常见的小工具,开发者常用开发工具与数据爬虫和重要数据的下载。 平台由专业的开发团队开发,界面美观,使用简单,让体验者完美体验。 功能在不断更新优化中,如果好的想法请联系QQ:123211858 ...

2020-06-04 16:53:20 80

安卓抓包小工具非常好用

安卓抓包小工具非常好用

2022-10-24

抓包精灵1.0.3 sslCaptureDatd

抓包精灵1.0.3

2022-10-24

社区信息管理系统.(毕业设计优化版)

社区信息管理系统.(毕业设计优化版)

2019-06-28

社区管理系统(SSH架构)完美测试通过.rar

社区管理系统(SSH架构)完美测试通过.rar

2019-06-28

淘宝API重新封装

淘宝API重新封装

2019-06-27

ERP源文件+程序.zip

ERP源文件+程序.zip

2019-06-05

Android 简单的机票预订系统源码.zip

Android 简单的机票预订系统源码.zip

2019-06-05

图书管理系统毕业设计

图书管理系统毕业设计

2019-06-04

扫雷游戏java源码

扫雷游戏java源码

2019-06-04

基于java语言开发的提醒簿程序源码

基于java语言开发的提醒簿程序源码

2019-06-04

Java黑白棋源码

Java黑白棋源码

2019-06-04

宾馆管理系统.rar

宾馆管理系统.rar

2019-06-04

java拼图游戏(含源码).rar

java拼图游戏(含源码).rar

2019-06-04

struts+hibernate+spring+avalon+Mysql超市资源管理系统

struts+hibernate+spring+avalon+Mysql超市资源管理系统

2019-06-04

2019在线考试系统(毕业设计 J2EE 附源码)

2019在线考试系统(毕业设计 J2EE 附源码)

2019-06-03

企业进销存管理系统.rar

企业进销存管理系统

2019-05-22

JAVA开发的ERP源码,进销存财务

JAVA开发的ERP源码,进销存财务

2019-05-22

Sortable前端框架

# Sortable Sortable is a <s>minimalist</s> JavaScript library for reorderable drag-and-drop lists. Demo: http://rubaxa.github.io/Sortable/ ## Features * Supports touch devices and [modern](http://caniuse.com/#search=drag) browsers (including IE9) * Can drag from one list to another or within the same list * CSS animation when moving items * Supports drag handles *and selectable text* (better than voidberg's html5sortable) * Smart auto-scrolling * Built using native HTML5 drag and drop API * Supports * [Meteor](https://github.com/SortableJS/meteor-sortablejs) * AngularJS * [2.0+](https://github.com/SortableJS/angular-sortablejs) * [1.*](https://github.com/SortableJS/angular-legacy-sortablejs) * React * [ES2015+](https://github.com/SortableJS/react-sortablejs) * [Mixin](https://github.com/SortableJS/react-mixin-sortablejs) * [Knockout](https://github.com/SortableJS/knockout-sortablejs) * [Polymer](https://github.com/SortableJS/polymer-sortablejs) * [Vue](https://github.com/SortableJS/Vue.Draggable) * Supports any CSS library, e.g. [Bootstrap](#bs) * Simple API * [CDN](#cdn) * No jQuery (but there is [support](#jq)) <br/> ### Articles * [Sortable v1.0 — New capabilities](https://github.com/RubaXa/Sortable/wiki/Sortable-v1.0-—-New-capabilities/) (December 22, 2014) * [Sorting with the help of HTML5 Drag'n'Drop API](https://github.com/RubaXa/Sortable/wiki/Sorting-with-the-help-of-HTML5-Drag'n'Drop-API/) (December 23, 2013) <br/> ### Install Via npm ```bash $ npm install sortablejs --save ``` Via bower: ```bash $ bower install --save sortablejs ``` <br/> ### Usage ```html <ul id="items"> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> ``` ```js var el = document.getElementById('items'); var sortable = Sortable.create(el); ``` You can use any element for the list and its elements, not just `ul`/`li`. Here is an [example with `div`s](http://jsbin.com/qumuwe/edit?html,js,output). --- ### Options ```js var sortable = new Sortable(el, { group: "name", // or { name: "...", pull: [true, false, clone], put: [true, false, array] } sort: true, // sorting inside list delay: 0, // time in milliseconds to define when the sorting should start touchStartThreshold: 0, // px, how many pixels the point should move before cancelling a delayed drag event disabled: false, // Disables the sortable if set to true. store: null, // @see Store animation: 150, // ms, animation speed moving items when sorting, `0` — without animation handle: ".my-handle", // Drag handle selector within list items filter: ".ignore-elements", // Selectors that do not lead to dragging (String or Function) preventOnFilter: true, // Call `event.preventDefault()` when triggered `filter` draggable: ".item", // Specifies which items inside the element should be draggable ghostClass: "sortable-ghost", // Class name for the drop placeholder chosenClass: "sortable-chosen", // Class name for the chosen item dragClass: "sortable-drag", // Class name for the dragging item dataIdAttr: 'data-id', forceFallback: false, // ignore the HTML5 DnD behaviour and force the fallback to kick in fallbackClass: "sortable-fallback", // Class name for the cloned DOM Element when using forceFallback fallbackOnBody: false, // Appends the cloned DOM Element into the Document's Body fallbackTolerance: 0, // Specify in pixels how far the mouse should move before it's considered as a drag. scroll: true, // or HTMLElement scrollFn: function(offsetX, offsetY, originalEvent, touchEvt, hoverTargetEl) { ... }, // if you have custom scrollbar scrollFn may be used for autoscrolling scrollSensitivity: 30, // px, how near the mouse must be to an edge to start scrolling. scrollSpeed: 10, // px setData: function (/** DataTransfer */dataTransfer, /** HTMLElement*/dragEl) { dataTransfer.setData('Text', dragEl.textContent); // `dataTransfer` object of HTML5 DragEvent }, // Element is chosen onChoose: function (/**Event*/evt) { evt.oldIndex; // element index within parent }, // Element dragging started onStart: function (/**Event*/evt) { evt.oldIndex; // element index within parent }, // Element dragging ended onEnd: function (/**Event*/evt) { var itemEl = evt.item; // dragged HTMLElement evt.to; // target list evt.from; // previous list evt.oldIndex; // element's old index within old parent evt.newIndex; // element's new index within new parent }, // Element is dropped into the list from another list onAdd: function (/**Event*/evt) { // same properties as onEnd }, // Changed sorting within list onUpdate: function (/**Event*/evt) { // same properties as onEnd }, // Called by any change to the list (add / update / remove) onSort: function (/**Event*/evt) { // same properties as onEnd }, // Element is removed from the list into another list onRemove: function (/**Event*/evt) { // same properties as onEnd }, // Attempt to drag a filtered element onFilter: function (/**Event*/evt) { var itemEl = evt.item; // HTMLElement receiving the `mousedown|tapstart` event. }, // Event when you move an item in the list or between lists onMove: function (/**Event*/evt, /**Event*/originalEvent) { // Example: http://jsbin.com/tuyafe/1/edit?js,output evt.dragged; // dragged HTMLElement evt.draggedRect; // TextRectangle {left, top, right и bottom} evt.related; // HTMLElement on which have guided evt.relatedRect; // TextRectangle originalEvent.clientY; // mouse position // return false; — for cancel }, // Called when creating a clone of element onClone: function (/**Event*/evt) { var origEl = evt.item; var cloneEl = evt.clone; } }); ``` --- #### `group` option To drag elements from one list into another, both lists must have the same `group` value. You can also define whether lists can give away, give and keep a copy (`clone`), and receive elements. * name: `String` — group name * pull: `true|false|'clone'|function` — ability to move from the list. `clone` — copy the item, rather than move. * put: `true|false|["foo", "bar"]|function` — whether elements can be added from other lists, or an array of group names from which elements can be taken. * revertClone: `boolean` — revert cloned element to initial position after moving to a another list. Demo: - http://jsbin.com/naduvo/edit?js,output - http://jsbin.com/rusuvot/edit?js,output — use of complex logic in the `pull` and` put` - http://jsbin.com/magogub/edit?js,output — use `revertClone: true` --- #### `sort` option Sorting inside list. Demo: http://jsbin.com/videzob/edit?html,js,output --- #### `delay` option Time in milliseconds to define when the sorting should start. Demo: http://jsbin.com/xizeh/edit?html,js,output --- #### `touchStartThreshold` option This option is similar to `fallbackTolerance` option. When the `delay` option is set, some phones with very sensitive touch displays like the Samsung Galaxy S8 will fire unwanted touchmove events even when your finger is not moving, resulting in the sort not triggering. This option sets the minimum pointer movement that must occur before the delayed sorting is cancelled. Values between 3 to 5 are good. --- #### `disabled` options Disables the sortable if set to `true`. Demo: http://jsbin.com/xiloqu/edit?html,js,output ```js var sortable = Sortable.create(list); document.getElementById("switcher").onclick = function () { var state = sortable.option("disabled"); // get sortable.option("disabled", !state); // set }; ``` --- #### `handle` option To make list items draggable, Sortable disables text selection by the user. That's not always desirable. To allow text selection, define a drag handler, which is an area of every list element that allows it to be dragged around. Demo: http://jsbin.com/newize/edit?html,js,output ```js Sortable.create(el, { handle: ".my-handle" }); ``` ```html <ul> <li><span class="my-handle">::</span> list item text one <li><span class="my-handle">::</span> list item text two </ul> ``` ```css .my-handle { cursor: move; cursor: -webkit-grabbing; } ``` --- #### `filter` option ```js Sortable.create(list, { filter: ".js-remove, .js-edit", onFilter: function (evt) { var item = evt.item, ctrl = evt.target; if (Sortable.utils.is(ctrl, ".js-remove")) { // Click on remove button item[removed].removeChild(item); // remove sortable item } else if (Sortable.utils.is(ctrl, ".js-edit")) { // Click on edit link // ... } } }) ``` --- #### `ghostClass` option Class name for the drop placeholder (default `sortable-ghost`). Demo: http://jsbin.com/hunifu/4/edit?css,js,output ```css .ghost { opacity: 0.4; } ``` ```js Sortable.create(list, { ghostClass: "ghost" }); ``` --- #### `chosenClass` option Class name for the chosen item (default `sortable-chosen`). Demo: http://jsbin.com/hunifu/3/edit?html,css,js,output ```css .chosen { color: #fff; background-color: #c00; } ``` ```js Sortable.create(list, { delay: 500, chosenClass: "chosen" }); ``` --- #### `forceFallback` option If set to `true`, the Fallback for non HTML5 Browser will be used, even if we are using an HTML5 Browser. This gives us the possibility to test the behaviour for older Browsers even in newer Browser, or make the Drag 'n Drop feel more consistent between Desktop , Mobile and old Browsers. On top of that, the Fallback always generates a copy of that DOM Element and appends the class `fallbackClass` defined in the options. This behaviour controls the look of this 'dragged' Element. Demo: http://jsbin.com/yacuqib/edit?html,css,js,output --- #### `fallbackTolerance` option Emulates the native drag threshold. Specify in pixels how far the mouse should move before it's considered as a drag. Useful if the items are also clickable like in a list of links. When the user clicks inside a sortable element, it's not uncommon for your hand to move a little between the time you press and the time you release. Dragging only starts if you move the pointer past a certain tolerance, so that you don't accidentally start dragging every time you click. 3 to 5 are probably good values. --- #### `scroll` option If set to `true`, the page (or sortable-area) scrolls when coming to an edge. Demo: - `window`: http://jsbin.com/tutuzeh/edit?html,js,output - `overflow: hidden`: http://jsbin.com/kolisu/edit?html,js,output --- #### `scrollFn` option Defines function that will be used for autoscrolling. el.scrollTop/el.scrollLeft is used by default. Useful when you have custom scrollbar with dedicated scroll function. --- #### `scrollSensitivity` option Defines how near the mouse must be to an edge to start scrolling. --- #### `scrollSpeed` option The speed at which the window should scroll once the mouse pointer gets within the `scrollSensitivity` distance. --- ### Event object ([demo](http://jsbin.com/xedusu/edit?js,output)) - to:`HTMLElement` — list, in which moved element. - from:`HTMLElement` — previous list - item:`HTMLElement` — dragged element - clone:`HTMLElement` - oldIndex:`Number|undefined` — old index within parent - newIndex:`Number|undefined` — new index within parent #### `move` event object - to:`HTMLElement` - from:`HTMLElement` - dragged:`HTMLElement` - draggedRect:` TextRectangle` - related:`HTMLElement` — element on which have guided - relatedRect:` TextRectangle` --- ### Method ##### option(name:`String`[, value:`*`]):`*` Get or set the option. ##### closest(el:`String`[, selector:`HTMLElement`]):`HTMLElement|null` For each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree. ##### toArray():`String[]` Serializes the sortable's item `data-id`'s (`dataIdAttr` option) into an array of string. ##### sort(order:`String[]`) Sorts the elements according to the array. ```js var order = sortable.toArray(); sortable.sort(order.reverse()); // apply ``` ##### save() Save the current sorting (see [store](#store)) ##### destroy() Removes the sortable functionality completely. --- <a name="store"></a> ### Store Saving and restoring of the sort. ```html <ul> <li data-id="1">order</li> <li data-id="2">save</li> <li data-id="3">restore</li> </ul> ``` ```js Sortable.create(el, { group: "localStorage-example", store: { /** * Get the order of elements. Called once during initialization. * @param {Sortable} sortable * @returns {Array} */ get: function (sortable) { var order = localStorage.getItem(sortable.options.group.name); return order ? order.split('|') : []; }, /** * Save the order of elements. Called onEnd (when the item is dropped). * @param {Sortable} sortable */ set: function (sortable) { var order = sortable.toArray(); localStorage.setItem(sortable.options.group.name, order.join('|')); } } }) ``` --- <a name="bs"></a> ### Bootstrap Demo: http://jsbin.com/qumuwe/edit?html,js,output ```html &lt;!-- Latest compiled and minified CSS --&gt; &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"/&gt; &lt;!-- Latest Sortable --&gt; [removed][removed] &lt;!-- Simple List --&gt; <ul id="simpleList" class="list-group"> <li class="list-group-item">This is <a href="http://rubaxa.github.io/Sortable/">Sortable</a></li> <li class="list-group-item">It works with Bootstrap...</li> <li class="list-group-item">...out of the box.</li> <li class="list-group-item">It has support for touch devices.</li> <li class="list-group-item">Just drag some elements around.</li> </ul> [removed] // Simple list Sortable.create(simpleList, { /* options */ }); [removed] ``` --- ### Static methods & properties ##### Sortable.create(el:`HTMLElement`[, options:`Object`]):`Sortable` Create new instance. --- ##### Sortable.active:`Sortable` Link to the active instance. --- ##### Sortable.utils * on(el`:HTMLElement`, event`:String`, fn`:Function`) — attach an event handler function * off(el`:HTMLElement`, event`:String`, fn`:Function`) — remove an event handler * css(el`:HTMLElement`)`:Object` — get the values of all the CSS properties * css(el`:HTMLElement`, prop`:String`)`:Mixed` — get the value of style properties * css(el`:HTMLElement`, prop`:String`, value`:String`) — set one CSS properties * css(el`:HTMLElement`, props`:Object`) — set more CSS properties * find(ctx`:HTMLElement`, tagName`:String`[, iterator`:Function`])`:Array` — get elements by tag name * bind(ctx`:Mixed`, fn`:Function`)`:Function` — Takes a function and returns a new one that will always have a particular context * is(el`:HTMLElement`, selector`:String`)`:Boolean` — check the current matched set of elements against a selector * closest(el`:HTMLElement`, selector`:String`[, ctx`:HTMLElement`])`:HTMLElement|Null` — for each element in the set, get the first element that matches the selector by testing the element itself and traversing up through its ancestors in the DOM tree * clone(el`:HTMLElement`)`:HTMLElement` — create a deep copy of the set of matched elements * toggleClass(el`:HTMLElement`, name`:String`, state`:Boolean`) — add or remove one classes from each element --- <a name="cdn"></a> ### CDN ```html &lt;!-- jsDelivr :: Sortable (https://www.jsdelivr.com/package/npm/sortablejs) --&gt; [removed][removed] &lt;!-- jsDelivr :: Sortable :: Latest (https://www.jsdelivr.com/package/npm/sortablejs) --&gt; [removed][removed] ``` --- <a name="jq"></a> ### jQuery compatibility To assemble plugin for jQuery, perform the following steps: ```bash cd Sortable npm install grunt jquery ``` Now you can use `jquery.fn.sortable.js`:<br/> (or `jquery.fn.sortable.min.js` if you run `grunt jquery:min`) ```js $("#list").sortable({ /* options */ }); // init $("#list").sortable("widget"); // get Sortable instance $("#list").sortable("destroy"); // destroy Sortable instance $("#list").sortable("{method-name}"); // call an instance method $("#list").sortable("{method-name}", "foo", "bar"); // call an instance method with parameters ``` And `grunt jquery:mySortableFunc` → `jquery.fn.mySortableFunc.js` --- ### Contributing (Issue/PR) Please, [read this](CONTRIBUTING.md). --- ## MIT LICENSE Copyright 2013-2017 Lebedev Konstantin <[email protected]> http://rubaxa.github.io/Sortable/ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

2018-06-28

springboot用thymeleaf模板引擎

# spring-boot-thymeleaf 在springboot用thymeleaf模板引擎

2018-06-28

SpringBoot+Mysql+MyBatis+Thymeleaf+Amaze UI+ECharts

### BabyLog 岁月如风,唯有此忆。 任凭时光匆匆,记录点点滴滴。 当爸爸了,就多陪陪孩子,有事没事的记些东西,不要总把心思放在程序编码上,也多陪陪孩子! 记录了那么多条数据,是时候,为孩子做个数据,也许将来某一天,你也会翻翻看看。 本人菜鸟一个,Java的爱好者,并非专业码农,程序问题难免,请各位大侠轻拍。 ### 介绍 本程序采用 SpringBoot+Mysql+MyBatis+Thymeleaf+Amaze UI+ECharts 等框架技术支持。 友情提示:[hutool ](https://git.oschina.net/loolly/hutool) 国产最佳Java 工具类! BabyLog是用来记录孩子成长过程的日记,她包括:日记,语言,认知等,还包括身高,体重,并使用图表展示。 ### 预览 ![输入图片说明](https://git.oschina.net/uploads/images/2017/0622/011446_a31308f8_125848.jpeg "首页预览") ![输入图片说明](https://git.oschina.net/uploads/images/2017/0622/011519_95062e58_125848.jpeg "后台预览") ![输入图片说明](https://git.oschina.net/uploads/images/2017/0622/011721_cd764a83_125848.jpeg "在这里输入图片标题")![输入图片说明](https://git.oschina.net/uploads/images/2017/0622/011735_274869e7_125848.jpeg "在这里输入图片标题") ### 启动 建立mysql数据库,导入DOC/下的sql文件 默认管理员帐号及密码:admin

2018-06-28

spring-cloud-books

#spring-cloud-books ## **使用** 1.根目录执行mvn clean install后,将所有war包放在document/run文件夹下 2.点击run-all.bat批量按顺序执行war包 启动时请等待,直到启动完一个,再按回车继续启动下一个 3.也可以按照自己需求启动每个项目的bat文件 以下按照启动顺序依次介绍各项目 ### **配置中心** 访问svn上配置文件所处位置,比如svn上某个地址 svn://xxx.xxx.xxx.xxx/project_name/docs 访问 http://localhost:8000/api/dev/docs 即显示docs目录下api-dev.properties文件中相关配置信息 ### **服务发现** 访问http://localhost:8001/discovery/ 界面如下: ![输入图片说明](http://git.oschina.net/uploads/images/2016/1121/181013_db44c0d2_43183.jpeg "在这里输入图片标题") 之后相应的服务启动后,刷新页面后可见已被发现的服务 ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/094700_ac4d9ecb_43183.jpeg "在这里输入图片标题") ### **服务端** 访问http://localhost:8002/swagger-ui.html 可以查看swagger文档,如下图: ![输入图片说明](http://git.oschina.net/uploads/images/2016/1121/181042_2d280d46_43183.jpeg "在这里输入图片标题") 相应技术为springboot+mysql+mybatis+hikariCP ### **API网关** 访问http://localhost:8005/swagger-ui.html ,如下图: ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/101922_61f72a16_43183.jpeg "在这里输入图片标题") 可查看相关接口,目前这里只是利用json web token做了一个鉴定请求是否有权调用服务端的安全验证功能,还有就是路由功能 ### **客户端** 访问http://localhost:8004/consumer/10 返回的json数据结果如下图: ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/102304_d351bed6_43183.jpeg "在这里输入图片标题") 这里是通过访问api网关,获取token放入请求的header中,然后请求服务端接口获取数据。 目前只做了查询bookID的功能,可自行扩展其它crud操作,如 http://localhost:8002/swagger-ui.html 中的各接口 这里还包括了负载均衡和熔断器功能,如果服务端访问不了,会访问相关故障信息,如下: ​ ``` { "code": -99, "message": "无法访问服务,该服务可能由于某种未知原因被关闭。请重启服务!", "data": null } ``` swagger文档,如下图: ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/101906_41ee44ef_43183.jpeg "在这里输入图片标题") ### **服务监控控制台** 访问http://localhost:8005/hystrix.steam 可以查看某服务在一个server节点或多个server节点上的实时运行情况 比如在搜索框输入 http://localhost:8004/hystrix.stream ,并在title输入框取名hystrix-8004 (注意在点击monitor stream按钮前,先运行 http://localhost:8004/consumer/10 ),结果如下图 ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/094900_506a714c_43183.jpeg "在这里输入图片标题") ### **聚合服务节点** 可在 http://localhost:8005/hystrix.steam 搜索框输入 http://localhost:8006/turbine.stream , 并在title输入框取名turbine-8006,看下列结果 ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/094949_b4459472_43183.jpeg "在这里输入图片标题") 这里因为服务只在我本机上部署,因此上述两张图是一样的,如果服务还部署在另外一台或多台server上,第二张图会显示多个server运行服务情况。如果此时有很多访问 http://localhost:8004/consumer/10 的请求,我们可以看见实时运行情况,如下图 ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/095115_0092d6cc_43183.jpeg "在这里输入图片标题") ### **Actuator** 每个项目的info信息都是直接从maven的pom文件中读取,具体可参考各个项目的resources目录下的application和application-test属性文件 ``` #查看info信息配置 [email protected]@ [email protected]@ [email protected]@ ``` 下列这些图是展示服务端,API网关,消费端的info信息 ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/102852_06e87b19_43183.jpeg "服务端") ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/102908_3eb87ba2_43183.jpeg "API网关") ![输入图片说明](http://git.oschina.net/uploads/images/2016/1123/103141_a10b809a_43183.jpeg "消费端")

2018-06-28

QQ网页授权、微信公众号相关接口

# weixin-dubbo-springboot QQ网页授权、微信公众号相关接口、企业微信相关接口,如消息推送等功能。基于17年6月最新api开发。使用 dubbo, spring boot, redis 实现的通用项目。 # 环境 jdk1.8,maven,redis等。 注意: ``` &lt;!-- qqSDK --&gt; <dependency> <groupId>qq</groupId> <artifactId>sdk4j</artifactId> <version>2.0</version> </dependency> ``` **qq的sdk** 需要自己下载,然后加到自己本地仓库或者私服。 这个jar已打包到项目目录中,[qqSDK官方下载地址](http://qzonestyle.gtimg.cn/qzone/vas/opensns/res/doc/qqConnect_Server_SDK_java_v2.0.zip) # 项目结构 ![项目结构](https://git.oschina.net/uploads/images/2017/0817/122249_33e85f50_1069272.png "QQ20170817-122217.png") # 需要改的配置 ## 1.redis服务地址、公众号信息配置 ![redis服务地址和公众号信息](https://git.oschina.net/uploads/images/2017/0817/131800_3d2bc2f6_1069272.png "QQ20170817-131711.png") ## 2.QQ授权配置 ![QQ授权配置](https://git.oschina.net/uploads/images/2017/0817/131923_99087e75_1069272.png "QQ20170817-131406.png") ## 3.企业号信息配置 ![企业号信息配置](https://git.oschina.net/uploads/images/2017/0817/132009_a302c7cc_1069272.png "QQ20170817-131025.png") # 时序图 以微信登录授权为例: ![微信授权时序图](https://git.oschina.net/uploads/images/2017/0818/193202_e1f76126_1069272.png "WX20170818-193151.png")

2018-06-28

MCloud - OAuth2 认证中心

# MCloud - OAuth2 认证中心 [![Build Status](https://www.travis-ci.org/heyuxian/mcloud-oauth2-server.svg?branch=master)](https://www.travis-ci.org/heyuxian/mcloud-oauth2-server) [![Coverage Status](https://coveralls.io/repos/github/heyuxian/mcloud-oauth2-server/badge.svg?branch=master)](https://coveralls.io/github/heyuxian/mcloud-oauth2-server?branch=master) [![License](https://img.shields.io/badge/License-Apache 2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) ## 简介 `mcloud-oauth-server` 基于**Spring OAuth2**,实现了**OAuth2**认证服务器以及资源服务器,并以 **Restful API** 的方式提供了**OAuth** 客户端以及用户的管理功能。 项目中主要使用了以下技术: - **Java8** - **Spring 相关** Spring, Spring Mvc, Spring Cloud, Spring data jpa, Spring Boot,Hibernate - **mapstruct** 主要用于DTO 与 Entity 之间的转换 - **flywaydb** 以版本化的方式管理数据库脚本 - **thymeleaf** 模板框架,用于实现后台管理界面 - **Redis** 主要用作缓存实现 (暂未实现) - **lombok** ## 认证流程 **OAuth2**认证流程可参考博客 [理解OAuth 2.0](http://www.ruanyifeng.com/blog/2014/05/oauth_2_0.html) ,此处不再赘述。 ## Features - **认证服务器** 使用Spring Security 结合 JWT Token 实现认证服务,提供了功能完整的 OAuth2 认证服务器。 - **资源服务器** 实现了以下两种方式进行OAuth2 相关资源的管理 - 以 RestAPI 形式提供服务来管理资源:`http://localhost:8043/uaa/swagger-ui.html` - 以 Thymeleaf + [AdminBSBMaterialDesign](https://github.com/gurayyarar/AdminBSBMaterialDesign) 实现的管理端: ​ **用户端** ![image](https://user-images.githubusercontent.com/30259465/33719089-a021befc-db9a-11e7-9a59-179f531dcfe4.png) **管理员** ![image](https://user-images.githubusercontent.com/30259465/33719145-c7c0af54-db9a-11e7-8c52-f92df2cdd7a1.png) ## 快速使用 **创建数据库** 请使用 mysql 客户端或是其他你喜欢的工具创建数据库,默认的数据库名称为 `db_oauth` **使用flywaydb初始化数据库** 修改 `pom.xml`中 **flywaydb** 插件的数据库名,用户名以及密码: **pom.xml** ```xml <plugin> <groupId>org.flywaydb</groupId> <artifactId>flyway-maven-plugin</artifactId> <version>4.2.0</version> <configuration> <user>root</user> <password>你的数据库密码</password> <driver>com.mysql.jdbc.Driver</driver> <url>jdbc:mysql://localhost:3306/数据库名称</url> </configuration> </plugin> ``` 修改相关配置之后,请在项目根目录下执行maven命令: ``` mvn flyway:clean flyway:migrate ``` 修改项目的数据库配置: **application.yml** ```yaml spring: datasource: url: jdbc:mysql://localhost/数据库名称 username: 用户 password: 密码 driver-class-name: com.mysql.jdbc.Driver ``` **启动OAuth2认证服务** 所有准备工作已经完成,现在,让我们启动服务,在项目根目录下运行maven命令: ``` mvn clean install mvn spring-boot:run ``` 如果你使用的是 Idea 或 eclipse 开发,请直接运行 **OAuthServerApplication** 这个方法即可启动服务。 **访问地址** ``` http://localhost:8043/uaa/swagger-ui.html ``` ![uaa](https://user-images.githubusercontent.com/30259465/31441550-16f2053e-aec6-11e7-9568-93cd35dbc1dd.png) ## 使用 Postman 调试API **前提:** 了解Postman并且安装了 **Chrome** 的 **Postman** 插件 首先自然是启动服务,然后我们在Postman中请求 `http://localhost:8043/uaa/api/v1/users/` ,此时因为还未进行认证,所以服务器返回的是 `401` 的状态码: ![OAuth fail](https://user-images.githubusercontent.com/30259465/31854106-e2270cf6-b6c6-11e7-91e3-f66ec6fef9fd.png) 现在我们通过Postman 自带的OAuth认证功能进行认证: ![qq 20171022011928](https://user-images.githubusercontent.com/30259465/31854237-11da1e38-b6c8-11e7-90b0-40dc54325b67.png) ![qq 20171022012054](https://user-images.githubusercontent.com/30259465/31854178-c1ad282e-b6c7-11e7-95a8-e2b5b006fcab.png) 相关项: - **Token Name** access_token - **Auth URL**: http://localhost:8043/uaa/oauth/authorize - **Access Token URL**: http://localhost:8043/uaa/oauth/token - **Client ID**: mcloud-blog - **Client Secret**: 123456 - **Scope**: 可以为空,此处不填 - **Grant Type**: Authorization code ![qq 20171126221612](https://user-images.githubusercontent.com/30259465/33240822-6c0d75ee-d2f7-11e7-810c-5dd523714c86.jpg) 默认用户: - **用户名** user - **密码** 123456 ![qq 20171022012701](https://user-images.githubusercontent.com/30259465/31854253-51b0a55e-b6c8-11e7-8415-d0ff4a242a85.png) 当我们授权之后,就可以得到 **access_token**,此时选中并点击 Use Token,然后我们再次访问之前无权限的 API ![qq 20171022013209](https://user-images.githubusercontent.com/30259465/31854294-d78b8fae-b6c8-11e7-8c77-46878e9159ef.png) 服务器已成功返回 `200` 的状态码,并返回了用户列表。 ## 其他 1. 因本项目使用了 **lombok** 进行开发,在开发之前需要安装插件,若使用的是 **IDEA** 进行开发,请自行搜索并安装 **lombok** 插件,否则会导致编译错误 2. 若是进行二次开发,请替换 `keystore.jks` **(非常重要)** ,否则会导致安全风险,`keystore.jks` 可使用jdk 工具生成,也可自行使用其他工具生成非对称密钥对。 ## 问题及建议 如果你有任何好的意见以及建议,请提 [Issue](https://github.com/heyuxian/mcloud-oauth2-server/issues/new)。 如果你觉得此项目对你有所帮助,欢迎点赞支持。

2018-06-28

Spring Security oauth2

#OAuth2-Defender ##主要技术 Maven Spring Boot Spring Security Spring Security OAuth2.0 MySQL ##修改数据库配置 修改defender-oauth2-authorization\src\main\resources\application.properties中MySQL的主机配置 修改defender-oauth2-resource\src\main\resources\application.properties中MySQL的主机配置 ##初始化数据库 在MySQL客户端执行SQL脚本: defender-oauth2-authorization\doc\schema.sql defender-oauth2-authorization\doc\data.sql ##启动服务器 ###启动认证服务器 运行defender-oauth2-authorization模块下AuthorizationApplication类的main方法。 ###启动资源服务器 运行defender-oauth2-resource模块下ResourceApplication类的main方法。 ###启动客户端服务器 运行defender-oauth2-client模块下ClientApplication类的main方法。 ##访问客户端主页面 在浏览器访问:localhost:8882/defender,测试5中不同授权模式。 ##后期工作 支持缓存 添加Spring Security防御功能

2018-06-28

nginx-1.14.0

nginx-1.14.0开发工具,64位 nginx-1.14.0开发工具,64位 nginx-1.14.0开发工具,64位

2018-06-28

ActiveMQ+Spring

ActiveMQ+SpringActiveMQ+SpringActiveMQ+SpringActiveMQ+Spring

2018-05-21

SpringBoot+Bolg+ SSM

SpringBoot+Bolg+ SSMSpringBoot+Bolg+ SSMSpringBoot+Bolg+ SSM

2018-05-21

微信开发-各种开发工具类

微信开发-各种开发工具类微信开发-各种开发工具类微信开发-各种开发工具类微信开发-各种开发工具类

2018-05-21

SSM+Maven+Jfinal+仓库管理系统

SSM+Maven+Jfinal+仓库管理系统SSM+Maven+Jfinal+仓库管理系统

2018-05-21

SSM+ehcache+Maven+ERP管理系统

SSM+ehcache+Maven+ERP管理系统 EasyUi+Jquery+Html5

2018-05-21

微信砸金蛋HTML5源码

微信砸金蛋HTML5源码微信砸金蛋HTML5源码微信砸金蛋HTML5源码微信砸金蛋HTML5源码

2017-10-14

微信砸金蛋源码

砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋砸金蛋

2017-10-14

微信刮刮乐大转盘源码

微信刮刮乐大转盘源码微信刮刮乐大转盘源码微信刮刮乐大转盘源码微信刮刮乐大转盘源码微信刮刮乐大转盘源码

2017-10-14

微信大转盘源码2

微信大转盘源码2微信大转盘源码2微信大转盘源码2微信大转盘源码2微信大转盘源码2

2017-10-14

微信大转盘源码

微信大转盘源码微信大转盘源码微信大转盘源码微信大转盘源码微信大转盘源码

2017-10-14

j2ee企业进销存软件(公司内部代码)

j2ee企业进销存软件(公司内部代码) struts+spring+hibernate

2012-05-08

毕业设计(图书管理系统)源代码

毕业设计(图书管理系统)源代码 struts+spring+hibernate

2012-05-08

毕业设计(网上花店)源代码

毕业设计(网上花店)源代码 struts+spring+hibertate

2012-05-08

代理商管理系统(J2ee)

代理商管理系统(J2ee) hibernate+spring+struts

2012-05-08

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除