diff --git a/composer.json b/composer.json index 4df0562..96c4fb4 100755 --- a/composer.json +++ b/composer.json @@ -2,6 +2,7 @@ "require": { "matyhtf/framework": ">=3.0.0", "symfony/console": "^4.3", - "swoole/ide-helper": "~4.4.7" + "swoole/ide-helper": "~4.4.7", + "ext-json": "*" } } diff --git a/configs/db.php b/configs/db.php index 3a377c1..ad78d15 100755 --- a/configs/db.php +++ b/configs/db.php @@ -1,14 +1,14 @@ SPF\Database::TYPE_MYSQLi, - 'host' => "127.0.0.1", + 'host' => "mysql", 'port' => 3306, 'dbms' => 'mysql', - 'engine' => 'MyISAM', + 'engine' => 'InnoDB', 'user' => "root", 'password' => "root", 'database' => "webim", - 'charset' => "utf8", + 'charset' => "utf8mb4", 'setname' => true, 'persistent' => false, //MySQL长连接 ); diff --git a/configs/login.php b/configs/login.php index 7000880..375e7f5 100755 --- a/configs/login.php +++ b/configs/login.php @@ -1,6 +1,6 @@ BASE_URL . '/api/get_user_info/', - 'passport' => BASE_URL.'/page/login/', + 'get_user_info' => BASE_URL . '/api/get_user_info', + 'passport' => BASE_URL.'/page/login', ); \ No newline at end of file diff --git a/configs/redis.php b/configs/redis.php index b62bace..d01a61c 100755 --- a/configs/redis.php +++ b/configs/redis.php @@ -1,5 +1,5 @@ '127.0.0.1', + 'host' => 'redis', ); return $redis; \ No newline at end of file diff --git a/configs/webim.php b/configs/webim.php index 814e5df..00868e7 100755 --- a/configs/webim.php +++ b/configs/webim.php @@ -1,13 +1,13 @@ '127.0.0.1', + 'host' => '0.0.0.0', //监听的端口 'port' => '9503', //WebSocket的URL地址,供浏览器使用的 'url' => 'ws://127.0.0.1:9503', //用于Comet跨域,必须设置为html所在的URL - 'origin' => 'http://im.swoole.com:8888', + 'origin' => 'http://127.0.0.1:9503', ); $config['swoole'] = array( diff --git a/resources/static/facebox/README.txt b/resources/static/facebox/README.txt new file mode 100644 index 0000000..56bf703 --- /dev/null +++ b/resources/static/facebox/README.txt @@ -0,0 +1,23 @@ +Facebox for Prototype, version 2.0 +By Robert Gaal - http://wakoopa.com +-------------------------------------------------------------------------- + +Heavily based on Facebox by Chris Wanstrath - http://famspam.com/facebox +First ported to Prototype by Phil Burrows - http://blog.philburrows.com + +Licensed under the MIT: +http://www.opensource.org/licenses/mit-license.php + +Need help? Join the Google Groups mailing list: +http://groups.google.com/group/facebox/ + +-------------------------------------------------------------------------- + +Dependencies: prototype & script.aculo.us + images & CSS files from original facebox +Usage: Append 'rel="facebox"' to an element to call it inside a so-called facebox. + + You can also call it directly through the following code: + + facebox.loading(); + facebox.reveal('Facebox contents here', null); + new Effect.Appear(facebox.facebox, {duration: .3}); \ No newline at end of file diff --git a/resources/static/facebox/b.png b/resources/static/facebox/b.png new file mode 100644 index 0000000..f184e62 Binary files /dev/null and b/resources/static/facebox/b.png differ diff --git a/resources/static/facebox/bl.png b/resources/static/facebox/bl.png new file mode 100644 index 0000000..f627185 Binary files /dev/null and b/resources/static/facebox/bl.png differ diff --git a/resources/static/facebox/br.png b/resources/static/facebox/br.png new file mode 100644 index 0000000..31f204f Binary files /dev/null and b/resources/static/facebox/br.png differ diff --git a/resources/static/facebox/closelabel.gif b/resources/static/facebox/closelabel.gif new file mode 100755 index 0000000..87b4f8b Binary files /dev/null and b/resources/static/facebox/closelabel.gif differ diff --git a/resources/static/facebox/facebox.css b/resources/static/facebox/facebox.css new file mode 100644 index 0000000..1529036 --- /dev/null +++ b/resources/static/facebox/facebox.css @@ -0,0 +1,95 @@ +#facebox .b { + background:url(b.png); +} + +#facebox .tl { + background:url(tl.png); +} + +#facebox .tr { + background:url(tr.png); +} + +#facebox .bl { + background:url(bl.png); +} + +#facebox .br { + background:url(br.png); +} + +#facebox { + position: absolute; + top: 0; + left: 0; + z-index: 100; + text-align: left; +} + +#facebox .popup { + position: relative; +} + +#facebox table { + border-collapse: collapse; +} + +#facebox td { + border-bottom: 0; + padding: 0; +} + +#facebox .body { + padding: 10px; + background: #fff; + width: 370px; +} + +#facebox .loading { + text-align: center; +} + +#facebox .image { + text-align: center; +} + +#facebox img { + border: 0; + margin: 0; +} + +#facebox .footer { + border-top: 1px solid #DDDDDD; + padding-top: 5px; + margin-top: 10px; + text-align: right; +} + +#facebox .tl, #facebox .tr, #facebox .bl, #facebox .br { + height: 10px; + width: 10px; + overflow: hidden; + padding: 0; +} + +#facebox_overlay { + position: fixed; + top: 0px; + left: 0px; + height:100%; + width:100%; +} + +.facebox_hide { + z-index:-100; +} + +.facebox_overlayBG { + background-color: #000; + z-index: 99; +} + +* html #facebox_overlay { /* ie6 hack */ + position: absolute; + height: expression(document.body.scrollHeight > document.body.offsetHeight ? document.body.scrollHeight : document.body.offsetHeight + 'px'); +} diff --git a/resources/static/facebox/facebox.js b/resources/static/facebox/facebox.js new file mode 100644 index 0000000..43dafa6 --- /dev/null +++ b/resources/static/facebox/facebox.js @@ -0,0 +1,189 @@ +/* Facebox for Prototype, version 2.0 + * By Robert Gaal - http://wakoopa.com + * + * Heavily based on Facebox by Chris Wanstrath - http://famspam.com/facebox + * First ported to Prototype by Phil Burrows - http://blog.philburrows.com + * + * Licensed under the MIT: + * http://www.opensource.org/licenses/mit-license.php + * + * Need help? Join the Google Groups mailing list: + * http://groups.google.com/group/facebox/ + * + * Dependencies: prototype & script.aculo.us + images & CSS files from original facebox + * Usage: Append 'rel="facebox"' to an element to call it inside a so-called facebox + * + *--------------------------------------------------------------------------*/ + + +var Facebox = Class.create({ + initialize : function(extra_set){ + this.settings = { + loading_image : '/facebox/loading.gif', + close_image : '/facebox/closelabel.gif', + image_types : new RegExp('\.' + ['png', 'jpg', 'jpeg', 'gif'].join('|') + '$', 'i'), + inited : true, + facebox_html : '\ +
' + }; + if (extra_set) Object.extend(this.settings, extra_set); + $(document.body).insert({bottom: this.settings.facebox_html}); + + this.preload = [ new Image(), new Image() ]; + this.preload[0].src = this.settings.close_image; + this.preload[1].src = this.settings.loading_image; + + f = this; + $$('#facebox .b:first, #facebox .bl, #facebox .br, #facebox .tl, #facebox .tr').each(function(elem){ + f.preload.push(new Image()); + f.preload.slice(-1).src = elem.getStyle('background-image').replace(/url\((.+)\)/, '$1'); + }); + + this.facebox = $('facebox'); + this.keyPressListener = this.watchKeyPress.bindAsEventListener(this); + + this.watchClickEvents(); + fb = this; + Event.observe($$('#facebox .close').first(), 'click', function(e){ + Event.stop(e); + fb.close() + }); + Event.observe($$('#facebox .close_image').first(), 'click', function(e){ + Event.stop(e); + fb.close() + }); + }, + + watchKeyPress : function(e){ + // Close if espace is pressed or if there's a click outside of the facebox + if (e.keyCode == 27 || !Event.element(e).descendantOf(this.facebox)) this.close(); + }, + + watchClickEvents : function(e){ + var f = this; + $$('a[rel=facebox]').each(function(elem,i){ + Event.observe(elem, 'click', function(e){ + Event.stop(e); + f.click_handler(elem, e); + }); + }); + }, + + loading : function() { + if ($$('#facebox .loading').length == 1) return true; + + contentWrapper = $$('#facebox .content').first(); + contentWrapper.childElements().each(function(elem, i){ + elem.remove(); + }); + contentWrapper.insert({bottom: '