├── public
├── favicon.ico
├── robots.txt
├── images
│ ├── go.png
│ ├── php.png
│ ├── sw.png
│ ├── clear.png
│ ├── noimg.png
│ ├── face
│ │ ├── 0_1.gif
│ │ ├── 1_2.gif
│ │ ├── 2_3.gif
│ │ ├── 3_4.gif
│ │ ├── 4_5.gif
│ │ ├── 5_6.gif
│ │ ├── 6_7.gif
│ │ ├── 7_8.gif
│ │ ├── 8_睡.gif
│ │ ├── 9_9.gif
│ │ ├── 10_10.gif
│ │ ├── 11_11.gif
│ │ ├── 12_12.gif
│ │ ├── 13_13.gif
│ │ ├── 14_14.gif
│ │ ├── 15_15.gif
│ │ ├── 16_16.gif
│ │ ├── 17_17.gif
│ │ ├── 18_18.gif
│ │ ├── 19_19.gif
│ │ ├── 20_20.gif
│ │ ├── 21_21.gif
│ │ ├── 22_22.gif
│ │ ├── 23_23.gif
│ │ ├── 24_24.gif
│ │ ├── 25_25.gif
│ │ ├── 26_26.gif
│ │ ├── 27_27.gif
│ │ ├── 28_28.gif
│ │ ├── 29_29.gif
│ │ ├── 30_30.gif
│ │ ├── 31_31.gif
│ │ ├── 32_32.gif
│ │ ├── 33_33.gif
│ │ ├── 34_34.gif
│ │ ├── 35_35.gif
│ │ ├── 36_36.gif
│ │ ├── 37_37.gif
│ │ ├── 38_38.gif
│ │ ├── 39_39.gif
│ │ ├── 40_40.gif
│ │ ├── 41_41.gif
│ │ ├── 42_42.gif
│ │ ├── 43_43.gif
│ │ ├── 44_44.gif
│ │ ├── 45_45.gif
│ │ ├── 46_46.gif
│ │ ├── 47_47.gif
│ │ ├── 48_48.gif
│ │ ├── 49_49.gif
│ │ ├── 50_50.gif
│ │ ├── 51_51.gif
│ │ ├── 52_52.gif
│ │ ├── 53_53.gif
│ │ ├── 54_54.gif
│ │ ├── 55_55.gif
│ │ ├── 56_56.gif
│ │ ├── 57_57.gif
│ │ ├── 58_58.gif
│ │ ├── 59_59.gif
│ │ ├── 78_78.gif
│ │ └── 81_81.gif
│ ├── main-bg.png
│ ├── avatar
│ │ └── f1
│ │ │ ├── f_1.jpg
│ │ │ ├── f_2.jpg
│ │ │ ├── f_3.jpg
│ │ │ ├── f_4.jpg
│ │ │ ├── f_5.jpg
│ │ │ ├── f_6.jpg
│ │ │ ├── f_7.jpg
│ │ │ ├── f_8.jpg
│ │ │ ├── f_9.jpg
│ │ │ ├── f_10.jpg
│ │ │ ├── f_11.jpg
│ │ │ └── f_12.jpg
│ ├── header_logo.png
│ └── forkme_right_orange_ff7600.png
├── fonts
│ └── iconfont.woff
├── voices
│ ├── notify.mp3
│ ├── notify.ogg
│ └── notify.wav
├── mix-manifest.json
├── js
│ ├── init.js
│ ├── functions.js
│ ├── xlyjs.js
│ ├── face.js
│ └── create.div.js
├── .htaccess
├── web.config
├── index.php
└── svg
│ ├── 404.svg
│ ├── 503.svg
│ └── 403.svg
├── storage
├── laravels.pid
├── logs
│ └── .gitignore
├── app
│ ├── public
│ │ └── .gitignore
│ └── .gitignore
└── framework
│ ├── testing
│ └── .gitignore
│ ├── views
│ └── .gitignore
│ ├── cache
│ ├── data
│ │ └── .gitignore
│ └── .gitignore
│ ├── sessions
│ └── .gitignore
│ └── .gitignore
├── database
├── .gitignore
├── seeds
│ └── DatabaseSeeder.php
├── migrations
│ ├── 2014_10_12_100000_create_password_resets_table.php
│ └── 2014_10_12_000000_create_users_table.php
└── factories
│ └── UserFactory.php
├── bootstrap
├── cache
│ └── .gitignore
└── app.php
├── resources
├── sass
│ ├── app.scss
│ └── _variables.scss
├── lang
│ └── en
│ │ ├── pagination.php
│ │ ├── auth.php
│ │ ├── passwords.php
│ │ └── validation.php
├── js
│ ├── components
│ │ └── ExampleComponent.vue
│ ├── app.js
│ └── bootstrap.js
└── views
│ └── index.blade.php
├── .gitattributes
├── tests
├── TestCase.php
├── Unit
│ └── ExampleTest.php
├── Feature
│ └── ExampleTest.php
└── CreatesApplication.php
├── .gitignore
├── .editorconfig
├── app
├── Http
│ ├── Middleware
│ │ ├── EncryptCookies.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ ├── Authenticate.php
│ │ ├── VerifyCsrfToken.php
│ │ └── RedirectIfAuthenticated.php
│ ├── Controllers
│ │ ├── Controller.php
│ │ └── Auth
│ │ │ ├── ForgotPasswordController.php
│ │ │ ├── LoginController.php
│ │ │ ├── ResetPasswordController.php
│ │ │ ├── VerificationController.php
│ │ │ └── RegisterController.php
│ └── Kernel.php
├── Providers
│ ├── BroadcastServiceProvider.php
│ ├── AppServiceProvider.php
│ ├── AuthServiceProvider.php
│ ├── EventServiceProvider.php
│ └── RouteServiceProvider.php
├── User.php
├── Console
│ └── Kernel.php
├── Exceptions
│ └── Handler.php
├── ChatTask
│ ├── ServerChanTask.php
│ └── ChatTask.php
└── Services
│ ├── WebSocketService.php
│ ├── ChatUsersService.php
│ └── ChatService.php
├── config
├── serverchan.php
├── view.php
├── services.php
├── hashing.php
├── broadcasting.php
├── filesystems.php
├── logging.php
├── queue.php
├── cache.php
├── auth.php
├── mail.php
├── database.php
├── laravels.php
├── chat.php
├── session.php
└── app.php
├── routes
├── api.php
├── web.php
├── channels.php
└── console.php
├── webpack.mix.js
├── server.php
├── .env.example
├── package.json
├── phpunit.xml
├── composer.json
├── artisan
├── Dockerfile
└── readme.md
/public/favicon.ico:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/storage/laravels.pid:
--------------------------------------------------------------------------------
1 | 2388
--------------------------------------------------------------------------------
/database/.gitignore:
--------------------------------------------------------------------------------
1 | *.sqlite
2 |
--------------------------------------------------------------------------------
/bootstrap/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/logs/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow:
3 |
--------------------------------------------------------------------------------
/storage/app/public/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/app/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !public/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/storage/framework/testing/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/views/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/data/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/sessions/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !.gitignore
3 |
--------------------------------------------------------------------------------
/storage/framework/cache/.gitignore:
--------------------------------------------------------------------------------
1 | *
2 | !data/
3 | !.gitignore
4 |
--------------------------------------------------------------------------------
/public/images/go.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/go.png
--------------------------------------------------------------------------------
/public/images/php.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/php.png
--------------------------------------------------------------------------------
/public/images/sw.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/sw.png
--------------------------------------------------------------------------------
/resources/sass/app.scss:
--------------------------------------------------------------------------------
1 |
2 | // webim css
3 | @import "style.css";
4 | @import "shake.css";
--------------------------------------------------------------------------------
/public/images/clear.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/clear.png
--------------------------------------------------------------------------------
/public/images/noimg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/noimg.png
--------------------------------------------------------------------------------
/public/fonts/iconfont.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/fonts/iconfont.woff
--------------------------------------------------------------------------------
/public/images/face/0_1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/0_1.gif
--------------------------------------------------------------------------------
/public/images/face/1_2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/1_2.gif
--------------------------------------------------------------------------------
/public/images/face/2_3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/2_3.gif
--------------------------------------------------------------------------------
/public/images/face/3_4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/3_4.gif
--------------------------------------------------------------------------------
/public/images/face/4_5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/4_5.gif
--------------------------------------------------------------------------------
/public/images/face/5_6.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/5_6.gif
--------------------------------------------------------------------------------
/public/images/face/6_7.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/6_7.gif
--------------------------------------------------------------------------------
/public/images/face/7_8.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/7_8.gif
--------------------------------------------------------------------------------
/public/images/face/8_睡.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/8_睡.gif
--------------------------------------------------------------------------------
/public/images/face/9_9.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/9_9.gif
--------------------------------------------------------------------------------
/public/images/main-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/main-bg.png
--------------------------------------------------------------------------------
/public/voices/notify.mp3:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/voices/notify.mp3
--------------------------------------------------------------------------------
/public/voices/notify.ogg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/voices/notify.ogg
--------------------------------------------------------------------------------
/public/voices/notify.wav:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/voices/notify.wav
--------------------------------------------------------------------------------
/public/images/face/10_10.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/10_10.gif
--------------------------------------------------------------------------------
/public/images/face/11_11.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/11_11.gif
--------------------------------------------------------------------------------
/public/images/face/12_12.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/12_12.gif
--------------------------------------------------------------------------------
/public/images/face/13_13.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/13_13.gif
--------------------------------------------------------------------------------
/public/images/face/14_14.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/14_14.gif
--------------------------------------------------------------------------------
/public/images/face/15_15.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/15_15.gif
--------------------------------------------------------------------------------
/public/images/face/16_16.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/16_16.gif
--------------------------------------------------------------------------------
/public/images/face/17_17.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/17_17.gif
--------------------------------------------------------------------------------
/public/images/face/18_18.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/18_18.gif
--------------------------------------------------------------------------------
/public/images/face/19_19.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/19_19.gif
--------------------------------------------------------------------------------
/public/images/face/20_20.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/20_20.gif
--------------------------------------------------------------------------------
/public/images/face/21_21.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/21_21.gif
--------------------------------------------------------------------------------
/public/images/face/22_22.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/22_22.gif
--------------------------------------------------------------------------------
/public/images/face/23_23.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/23_23.gif
--------------------------------------------------------------------------------
/public/images/face/24_24.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/24_24.gif
--------------------------------------------------------------------------------
/public/images/face/25_25.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/25_25.gif
--------------------------------------------------------------------------------
/public/images/face/26_26.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/26_26.gif
--------------------------------------------------------------------------------
/public/images/face/27_27.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/27_27.gif
--------------------------------------------------------------------------------
/public/images/face/28_28.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/28_28.gif
--------------------------------------------------------------------------------
/public/images/face/29_29.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/29_29.gif
--------------------------------------------------------------------------------
/public/images/face/30_30.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/30_30.gif
--------------------------------------------------------------------------------
/public/images/face/31_31.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/31_31.gif
--------------------------------------------------------------------------------
/public/images/face/32_32.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/32_32.gif
--------------------------------------------------------------------------------
/public/images/face/33_33.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/33_33.gif
--------------------------------------------------------------------------------
/public/images/face/34_34.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/34_34.gif
--------------------------------------------------------------------------------
/public/images/face/35_35.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/35_35.gif
--------------------------------------------------------------------------------
/public/images/face/36_36.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/36_36.gif
--------------------------------------------------------------------------------
/public/images/face/37_37.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/37_37.gif
--------------------------------------------------------------------------------
/public/images/face/38_38.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/38_38.gif
--------------------------------------------------------------------------------
/public/images/face/39_39.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/39_39.gif
--------------------------------------------------------------------------------
/public/images/face/40_40.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/40_40.gif
--------------------------------------------------------------------------------
/public/images/face/41_41.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/41_41.gif
--------------------------------------------------------------------------------
/public/images/face/42_42.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/42_42.gif
--------------------------------------------------------------------------------
/public/images/face/43_43.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/43_43.gif
--------------------------------------------------------------------------------
/public/images/face/44_44.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/44_44.gif
--------------------------------------------------------------------------------
/public/images/face/45_45.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/45_45.gif
--------------------------------------------------------------------------------
/public/images/face/46_46.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/46_46.gif
--------------------------------------------------------------------------------
/public/images/face/47_47.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/47_47.gif
--------------------------------------------------------------------------------
/public/images/face/48_48.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/48_48.gif
--------------------------------------------------------------------------------
/public/images/face/49_49.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/49_49.gif
--------------------------------------------------------------------------------
/public/images/face/50_50.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/50_50.gif
--------------------------------------------------------------------------------
/public/images/face/51_51.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/51_51.gif
--------------------------------------------------------------------------------
/public/images/face/52_52.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/52_52.gif
--------------------------------------------------------------------------------
/public/images/face/53_53.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/53_53.gif
--------------------------------------------------------------------------------
/public/images/face/54_54.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/54_54.gif
--------------------------------------------------------------------------------
/public/images/face/55_55.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/55_55.gif
--------------------------------------------------------------------------------
/public/images/face/56_56.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/56_56.gif
--------------------------------------------------------------------------------
/public/images/face/57_57.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/57_57.gif
--------------------------------------------------------------------------------
/public/images/face/58_58.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/58_58.gif
--------------------------------------------------------------------------------
/public/images/face/59_59.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/59_59.gif
--------------------------------------------------------------------------------
/public/images/face/78_78.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/78_78.gif
--------------------------------------------------------------------------------
/public/images/face/81_81.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/face/81_81.gif
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_1.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_2.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_3.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_3.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_4.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_4.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_5.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_5.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_6.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_6.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_7.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_7.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_8.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_8.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_9.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_9.jpg
--------------------------------------------------------------------------------
/public/images/header_logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/header_logo.png
--------------------------------------------------------------------------------
/public/mix-manifest.json:
--------------------------------------------------------------------------------
1 | {
2 | "/js/app.js": "/js/app.js",
3 | "/css/app.css": "/css/app.css"
4 | }
5 |
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_10.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_10.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_11.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_11.jpg
--------------------------------------------------------------------------------
/public/images/avatar/f1/f_12.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/avatar/f1/f_12.jpg
--------------------------------------------------------------------------------
/public/js/init.js:
--------------------------------------------------------------------------------
1 | var config = {
2 | 'domain' : "http://192.168.10.10:9090",
3 | 'wsserver' : "ws://192.168.10.10:9090",
4 | }
--------------------------------------------------------------------------------
/public/images/forkme_right_orange_ff7600.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/shisiying/webim/HEAD/public/images/forkme_right_orange_ff7600.png
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text=auto
2 | *.css linguist-vendored
3 | *.scss linguist-vendored
4 | *.js linguist-vendored
5 | CHANGELOG.md export-ignore
6 |
--------------------------------------------------------------------------------
/storage/framework/.gitignore:
--------------------------------------------------------------------------------
1 | config.php
2 | routes.php
3 | schedule-*
4 | compiled.php
5 | services.json
6 | events.scanned.php
7 | routes.scanned.php
8 | down
9 |
--------------------------------------------------------------------------------
/tests/TestCase.php:
--------------------------------------------------------------------------------
1 | call(UsersTableSeeder::class);
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/app/Http/Middleware/EncryptCookies.php:
--------------------------------------------------------------------------------
1 | assertTrue(true);
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/config/serverchan.php:
--------------------------------------------------------------------------------
1 | 'SCU17044T7eafa406fe38e6d908e392c1d02929c15b4c4233d17f5',
10 | 'a'=>'6739-83848e2aa45a74b30aca15d71ec5e961', //sw群组
11 | 'b'=>'6741-7c0b0355d0485e7e2e86cc6edcdbc7bd',//php群组
12 | 'c'=>'6740-023ed3224f89c6e3d0e4b268a762622a'//go群组
13 | ];
--------------------------------------------------------------------------------
/resources/sass/_variables.scss:
--------------------------------------------------------------------------------
1 |
2 | // Body
3 | $body-bg: #f8fafc;
4 |
5 | // Typography
6 | $font-family-sans-serif: "Nunito", sans-serif;
7 | $font-size-base: 0.9rem;
8 | $line-height-base: 1.6;
9 |
10 | // Colors
11 | $blue: #3490dc;
12 | $indigo: #6574cd;
13 | $purple: #9561e2;
14 | $pink: #f66D9b;
15 | $red: #e3342f;
16 | $orange: #f6993f;
17 | $yellow: #ffed4a;
18 | $green: #38c172;
19 | $teal: #4dc0b5;
20 | $cyan: #6cb2eb;
21 |
--------------------------------------------------------------------------------
/app/Http/Controllers/Controller.php:
--------------------------------------------------------------------------------
1 | get('/');
18 |
19 | $response->assertStatus(200);
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/routes/api.php:
--------------------------------------------------------------------------------
1 | make(Kernel::class)->bootstrap();
19 |
20 | return $app;
21 | }
22 | }
23 |
--------------------------------------------------------------------------------
/app/Providers/BroadcastServiceProvider.php:
--------------------------------------------------------------------------------
1 | expectsJson()) {
18 | return route('login');
19 | }
20 | }
21 | }
22 |
--------------------------------------------------------------------------------
/routes/channels.php:
--------------------------------------------------------------------------------
1 | id === (int) $id;
16 | });
17 |
--------------------------------------------------------------------------------
/webpack.mix.js:
--------------------------------------------------------------------------------
1 | const mix = require('laravel-mix');
2 |
3 | /*
4 | |--------------------------------------------------------------------------
5 | | Mix Asset Management
6 | |--------------------------------------------------------------------------
7 | |
8 | | Mix provides a clean, fluent API for defining some Webpack build steps
9 | | for your Laravel application. By default, we are compiling the Sass
10 | | file for the application as well as bundling up all the JS files.
11 | |
12 | */
13 |
14 | mix.js('resources/js/app.js', 'public/js')
15 | .sass('resources/sass/app.scss', 'public/css');
16 |
--------------------------------------------------------------------------------
/app/Http/Middleware/VerifyCsrfToken.php:
--------------------------------------------------------------------------------
1 | '« Previous',
17 | 'next' => 'Next »',
18 |
19 | ];
20 |
--------------------------------------------------------------------------------
/routes/console.php:
--------------------------------------------------------------------------------
1 | comment(Inspiring::quote());
18 | })->describe('Display an inspiring quote');
19 |
--------------------------------------------------------------------------------
/server.php:
--------------------------------------------------------------------------------
1 |
8 | */
9 |
10 | $uri = urldecode(
11 | parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH)
12 | );
13 |
14 | // This file allows us to emulate Apache's "mod_rewrite" functionality from the
15 | // built-in PHP web server. This provides a convenient way to test a Laravel
16 | // application without having installed a "real" web server software here.
17 | if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
18 | return false;
19 | }
20 |
21 | require_once __DIR__.'/public/index.php';
22 |
--------------------------------------------------------------------------------
/app/Http/Middleware/RedirectIfAuthenticated.php:
--------------------------------------------------------------------------------
1 | check()) {
21 | return redirect('/home');
22 | }
23 |
24 | return $next($request);
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/public/.htaccess:
--------------------------------------------------------------------------------
1 |
',
23 | "[尴尬]" => '
',
24 | "[发怒]" => '
',
25 | "[调皮]" => '
',
26 | "[龇牙]" => '
',
27 | "[惊讶]" => '
',
28 | "[难过]" => '
',
29 | "[酷]" => '
',
30 | "[冷汗]" => '
',
31 | "[抓狂]" => '
',
32 | "[吐]" => '
',
33 | "[撇嘴]" => '
',
34 | "[偷笑]" => '
',
35 | "[可爱]" => '
',
36 | "[白眼]" => '
',
37 | "[傲慢]" => '
',
38 | "[饥饿]" => '
',
39 | "[困]" => '
',
40 | "[惊恐]" => '
',
41 | "[流汗]" => '
',
42 | "[憨笑]" => '
',
43 | "[大兵]" => '
',
44 | "[色]" => '
',
45 | "[奋斗]" => '
',
46 | "[咒骂]" => '
',
47 | "[疑问]" => '
',
48 | "[嘘]" => '
',
49 | "[晕]" => '
',
50 | "[折磨]" => '
',
51 | "[衰]" => '
',
52 | "[骷髅]" => '
',
53 | "[敲打]" => '
',
54 | "[再见]" => '
',
55 | "[发呆]" => '
',
56 | "[擦汗]" => '
',
57 | "[抠鼻]" => '
',
58 | "[鼓掌]" => '
',
59 | "[糗大了]" => '
',
60 | "[坏笑]" => '
',
61 | "[左哼哼]" => '
',
62 | "[右哼哼]" => '
',
63 | "[哈欠]" => '
',
64 | "[鄙视]" => '
',
65 | "[委屈]" => '
',
66 | "[得意]" => '
',
67 | "[快哭了]" => '
',
68 | "[阴险]" => '
',
69 | "[亲亲]" => '
',
70 | "[吓]" => '
',
71 | "[可怜]" => '
',
72 | "[菜刀]" => '
',
73 | "[西瓜]" => '
',
74 | "[啤酒]" => '
',
75 | "[篮球]" => '
',
76 | "[乒乓]" => '
',
77 | "[流泪]" => '
',
78 | "[害羞]" => '
',
79 | "[拥抱]" => '
',
80 | "[闭嘴]" => '
',
81 | "[握手]" => '
',
82 | "[大哭]" => '
',
83 | )
84 | ];
85 |
--------------------------------------------------------------------------------
/public/svg/503.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/public/js/create.div.js:
--------------------------------------------------------------------------------
1 | /*创建div dom*/
2 | var cdiv = {
3 | userlists : function(roomid,is_none){
4 | var arr = [];
5 | arr = [ ''];
6 | return arr.join('');
7 | },
8 | chatlists : function(roomid,is_none){
9 | var arr = [];
10 | arr = [ ''];
11 | return arr.join('');
12 | },
13 | render : function(template,params){
14 | var arr = [];
15 | switch(template){
16 | case 'mymessage':
17 | arr = [
18 | '', params.newmessage,'
', params.newmessage,'
',params.newmessage,'
',params.newmessage,'
',params.name,'
' 56 | ]; 57 | break; 58 | case 'secretChat': 59 | arr = [ 60 | '',params.name,'
',params.send_name,'
}})
sw群组
}})
php群组
}})
go群组
99 |
100 |
101 |
102 |
103 |
--------------------------------------------------------------------------------
/public/svg/403.svg:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/config/session.php:
--------------------------------------------------------------------------------
1 | env('SESSION_DRIVER', 'file'),
22 |
23 | /*
24 | |--------------------------------------------------------------------------
25 | | Session Lifetime
26 | |--------------------------------------------------------------------------
27 | |
28 | | Here you may specify the number of minutes that you wish the session
29 | | to be allowed to remain idle before it expires. If you want them
30 | | to immediately expire on the browser closing, set that option.
31 | |
32 | */
33 |
34 | 'lifetime' => env('SESSION_LIFETIME', 120),
35 |
36 | 'expire_on_close' => false,
37 |
38 | /*
39 | |--------------------------------------------------------------------------
40 | | Session Encryption
41 | |--------------------------------------------------------------------------
42 | |
43 | | This option allows you to easily specify that all of your session data
44 | | should be encrypted before it is stored. All encryption will be run
45 | | automatically by Laravel and you can use the Session like normal.
46 | |
47 | */
48 |
49 | 'encrypt' => false,
50 |
51 | /*
52 | |--------------------------------------------------------------------------
53 | | Session File Location
54 | |--------------------------------------------------------------------------
55 | |
56 | | When using the native session driver, we need a location where session
57 | | files may be stored. A default has been set for you but a different
58 | | location may be specified. This is only needed for file sessions.
59 | |
60 | */
61 |
62 | 'files' => storage_path('framework/sessions'),
63 |
64 | /*
65 | |--------------------------------------------------------------------------
66 | | Session Database Connection
67 | |--------------------------------------------------------------------------
68 | |
69 | | When using the "database" or "redis" session drivers, you may specify a
70 | | connection that should be used to manage these sessions. This should
71 | | correspond to a connection in your database configuration options.
72 | |
73 | */
74 |
75 | 'connection' => env('SESSION_CONNECTION', null),
76 |
77 | /*
78 | |--------------------------------------------------------------------------
79 | | Session Database Table
80 | |--------------------------------------------------------------------------
81 | |
82 | | When using the "database" session driver, you may specify the table we
83 | | should use to manage the sessions. Of course, a sensible default is
84 | | provided for you; however, you are free to change this as needed.
85 | |
86 | */
87 |
88 | 'table' => 'sessions',
89 |
90 | /*
91 | |--------------------------------------------------------------------------
92 | | Session Cache Store
93 | |--------------------------------------------------------------------------
94 | |
95 | | When using the "apc" or "memcached" session drivers, you may specify a
96 | | cache store that should be used for these sessions. This value must
97 | | correspond with one of the application's configured cache stores.
98 | |
99 | */
100 |
101 | 'store' => env('SESSION_STORE', null),
102 |
103 | /*
104 | |--------------------------------------------------------------------------
105 | | Session Sweeping Lottery
106 | |--------------------------------------------------------------------------
107 | |
108 | | Some session drivers must manually sweep their storage location to get
109 | | rid of old sessions from storage. Here are the chances that it will
110 | | happen on a given request. By default, the odds are 2 out of 100.
111 | |
112 | */
113 |
114 | 'lottery' => [2, 100],
115 |
116 | /*
117 | |--------------------------------------------------------------------------
118 | | Session Cookie Name
119 | |--------------------------------------------------------------------------
120 | |
121 | | Here you may change the name of the cookie used to identify a session
122 | | instance by ID. The name specified here will get used every time a
123 | | new session cookie is created by the framework for every driver.
124 | |
125 | */
126 |
127 | 'cookie' => env(
128 | 'SESSION_COOKIE',
129 | Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
130 | ),
131 |
132 | /*
133 | |--------------------------------------------------------------------------
134 | | Session Cookie Path
135 | |--------------------------------------------------------------------------
136 | |
137 | | The session cookie path determines the path for which the cookie will
138 | | be regarded as available. Typically, this will be the root path of
139 | | your application but you are free to change this when necessary.
140 | |
141 | */
142 |
143 | 'path' => '/',
144 |
145 | /*
146 | |--------------------------------------------------------------------------
147 | | Session Cookie Domain
148 | |--------------------------------------------------------------------------
149 | |
150 | | Here you may change the domain of the cookie used to identify a session
151 | | in your application. This will determine which domains the cookie is
152 | | available to in your application. A sensible default has been set.
153 | |
154 | */
155 |
156 | 'domain' => env('SESSION_DOMAIN', null),
157 |
158 | /*
159 | |--------------------------------------------------------------------------
160 | | HTTPS Only Cookies
161 | |--------------------------------------------------------------------------
162 | |
163 | | By setting this option to true, session cookies will only be sent back
164 | | to the server if the browser has a HTTPS connection. This will keep
165 | | the cookie from being sent to you if it can not be done securely.
166 | |
167 | */
168 |
169 | 'secure' => env('SESSION_SECURE_COOKIE', false),
170 |
171 | /*
172 | |--------------------------------------------------------------------------
173 | | HTTP Access Only
174 | |--------------------------------------------------------------------------
175 | |
176 | | Setting this value to true will prevent JavaScript from accessing the
177 | | value of the cookie and the cookie will only be accessible through
178 | | the HTTP protocol. You are free to modify this option if needed.
179 | |
180 | */
181 |
182 | 'http_only' => true,
183 |
184 | /*
185 | |--------------------------------------------------------------------------
186 | | Same-Site Cookies
187 | |--------------------------------------------------------------------------
188 | |
189 | | This option determines how your cookies behave when cross-site requests
190 | | take place, and can be used to mitigate CSRF attacks. By default, we
191 | | do not enable this as other CSRF protection services are in place.
192 | |
193 | | Supported: "lax", "strict"
194 | |
195 | */
196 |
197 | 'same_site' => null,
198 |
199 | ];
200 |
--------------------------------------------------------------------------------
/resources/lang/en/validation.php:
--------------------------------------------------------------------------------
1 | 'The :attribute must be accepted.',
17 | 'active_url' => 'The :attribute is not a valid URL.',
18 | 'after' => 'The :attribute must be a date after :date.',
19 | 'after_or_equal' => 'The :attribute must be a date after or equal to :date.',
20 | 'alpha' => 'The :attribute may only contain letters.',
21 | 'alpha_dash' => 'The :attribute may only contain letters, numbers, dashes and underscores.',
22 | 'alpha_num' => 'The :attribute may only contain letters and numbers.',
23 | 'array' => 'The :attribute must be an array.',
24 | 'before' => 'The :attribute must be a date before :date.',
25 | 'before_or_equal' => 'The :attribute must be a date before or equal to :date.',
26 | 'between' => [
27 | 'numeric' => 'The :attribute must be between :min and :max.',
28 | 'file' => 'The :attribute must be between :min and :max kilobytes.',
29 | 'string' => 'The :attribute must be between :min and :max characters.',
30 | 'array' => 'The :attribute must have between :min and :max items.',
31 | ],
32 | 'boolean' => 'The :attribute field must be true or false.',
33 | 'confirmed' => 'The :attribute confirmation does not match.',
34 | 'date' => 'The :attribute is not a valid date.',
35 | 'date_format' => 'The :attribute does not match the format :format.',
36 | 'different' => 'The :attribute and :other must be different.',
37 | 'digits' => 'The :attribute must be :digits digits.',
38 | 'digits_between' => 'The :attribute must be between :min and :max digits.',
39 | 'dimensions' => 'The :attribute has invalid image dimensions.',
40 | 'distinct' => 'The :attribute field has a duplicate value.',
41 | 'email' => 'The :attribute must be a valid email address.',
42 | 'exists' => 'The selected :attribute is invalid.',
43 | 'file' => 'The :attribute must be a file.',
44 | 'filled' => 'The :attribute field must have a value.',
45 | 'gt' => [
46 | 'numeric' => 'The :attribute must be greater than :value.',
47 | 'file' => 'The :attribute must be greater than :value kilobytes.',
48 | 'string' => 'The :attribute must be greater than :value characters.',
49 | 'array' => 'The :attribute must have more than :value items.',
50 | ],
51 | 'gte' => [
52 | 'numeric' => 'The :attribute must be greater than or equal :value.',
53 | 'file' => 'The :attribute must be greater than or equal :value kilobytes.',
54 | 'string' => 'The :attribute must be greater than or equal :value characters.',
55 | 'array' => 'The :attribute must have :value items or more.',
56 | ],
57 | 'image' => 'The :attribute must be an image.',
58 | 'in' => 'The selected :attribute is invalid.',
59 | 'in_array' => 'The :attribute field does not exist in :other.',
60 | 'integer' => 'The :attribute must be an integer.',
61 | 'ip' => 'The :attribute must be a valid IP address.',
62 | 'ipv4' => 'The :attribute must be a valid IPv4 address.',
63 | 'ipv6' => 'The :attribute must be a valid IPv6 address.',
64 | 'json' => 'The :attribute must be a valid JSON string.',
65 | 'lt' => [
66 | 'numeric' => 'The :attribute must be less than :value.',
67 | 'file' => 'The :attribute must be less than :value kilobytes.',
68 | 'string' => 'The :attribute must be less than :value characters.',
69 | 'array' => 'The :attribute must have less than :value items.',
70 | ],
71 | 'lte' => [
72 | 'numeric' => 'The :attribute must be less than or equal :value.',
73 | 'file' => 'The :attribute must be less than or equal :value kilobytes.',
74 | 'string' => 'The :attribute must be less than or equal :value characters.',
75 | 'array' => 'The :attribute must not have more than :value items.',
76 | ],
77 | 'max' => [
78 | 'numeric' => 'The :attribute may not be greater than :max.',
79 | 'file' => 'The :attribute may not be greater than :max kilobytes.',
80 | 'string' => 'The :attribute may not be greater than :max characters.',
81 | 'array' => 'The :attribute may not have more than :max items.',
82 | ],
83 | 'mimes' => 'The :attribute must be a file of type: :values.',
84 | 'mimetypes' => 'The :attribute must be a file of type: :values.',
85 | 'min' => [
86 | 'numeric' => 'The :attribute must be at least :min.',
87 | 'file' => 'The :attribute must be at least :min kilobytes.',
88 | 'string' => 'The :attribute must be at least :min characters.',
89 | 'array' => 'The :attribute must have at least :min items.',
90 | ],
91 | 'not_in' => 'The selected :attribute is invalid.',
92 | 'not_regex' => 'The :attribute format is invalid.',
93 | 'numeric' => 'The :attribute must be a number.',
94 | 'present' => 'The :attribute field must be present.',
95 | 'regex' => 'The :attribute format is invalid.',
96 | 'required' => 'The :attribute field is required.',
97 | 'required_if' => 'The :attribute field is required when :other is :value.',
98 | 'required_unless' => 'The :attribute field is required unless :other is in :values.',
99 | 'required_with' => 'The :attribute field is required when :values is present.',
100 | 'required_with_all' => 'The :attribute field is required when :values are present.',
101 | 'required_without' => 'The :attribute field is required when :values is not present.',
102 | 'required_without_all' => 'The :attribute field is required when none of :values are present.',
103 | 'same' => 'The :attribute and :other must match.',
104 | 'size' => [
105 | 'numeric' => 'The :attribute must be :size.',
106 | 'file' => 'The :attribute must be :size kilobytes.',
107 | 'string' => 'The :attribute must be :size characters.',
108 | 'array' => 'The :attribute must contain :size items.',
109 | ],
110 | 'string' => 'The :attribute must be a string.',
111 | 'timezone' => 'The :attribute must be a valid zone.',
112 | 'unique' => 'The :attribute has already been taken.',
113 | 'uploaded' => 'The :attribute failed to upload.',
114 | 'url' => 'The :attribute format is invalid.',
115 | 'uuid' => 'The :attribute must be a valid UUID.',
116 |
117 | /*
118 | |--------------------------------------------------------------------------
119 | | Custom Validation Language Lines
120 | |--------------------------------------------------------------------------
121 | |
122 | | Here you may specify custom validation messages for attributes using the
123 | | convention "attribute.rule" to name the lines. This makes it quick to
124 | | specify a specific custom language line for a given attribute rule.
125 | |
126 | */
127 |
128 | 'custom' => [
129 | 'attribute-name' => [
130 | 'rule-name' => 'custom-message',
131 | ],
132 | ],
133 |
134 | /*
135 | |--------------------------------------------------------------------------
136 | | Custom Validation Attributes
137 | |--------------------------------------------------------------------------
138 | |
139 | | The following language lines are used to swap our attribute placeholder
140 | | with something more reader friendly such as "E-Mail Address" instead
141 | | of "email". This simply helps us make our message more expressive.
142 | |
143 | */
144 |
145 | 'attributes' => [],
146 |
147 | ];
148 |
--------------------------------------------------------------------------------
/config/app.php:
--------------------------------------------------------------------------------
1 | env('APP_NAME', 'Laravel'),
17 |
18 | /*
19 | |--------------------------------------------------------------------------
20 | | Application Environment
21 | |--------------------------------------------------------------------------
22 | |
23 | | This value determines the "environment" your application is currently
24 | | running in. This may determine how you prefer to configure various
25 | | services the application utilizes. Set this in your ".env" file.
26 | |
27 | */
28 |
29 | 'env' => env('APP_ENV', 'production'),
30 |
31 | /*
32 | |--------------------------------------------------------------------------
33 | | Application Debug Mode
34 | |--------------------------------------------------------------------------
35 | |
36 | | When your application is in debug mode, detailed error messages with
37 | | stack traces will be shown on every error that occurs within your
38 | | application. If disabled, a simple generic error page is shown.
39 | |
40 | */
41 |
42 | 'debug' => env('APP_DEBUG', false),
43 |
44 | /*
45 | |--------------------------------------------------------------------------
46 | | Application URL
47 | |--------------------------------------------------------------------------
48 | |
49 | | This URL is used by the console to properly generate URLs when using
50 | | the Artisan command line tool. You should set this to the root of
51 | | your application so that it is used when running Artisan tasks.
52 | |
53 | */
54 |
55 | 'url' => env('APP_URL', 'http://localhost'),
56 |
57 | /*
58 | |--------------------------------------------------------------------------
59 | | Application Timezone
60 | |--------------------------------------------------------------------------
61 | |
62 | | Here you may specify the default timezone for your application, which
63 | | will be used by the PHP date and date-time functions. We have gone
64 | | ahead and set this to a sensible default for you out of the box.
65 | |
66 | */
67 |
68 | 'timezone' => 'UTC',
69 |
70 | /*
71 | |--------------------------------------------------------------------------
72 | | Application Locale Configuration
73 | |--------------------------------------------------------------------------
74 | |
75 | | The application locale determines the default locale that will be used
76 | | by the translation service provider. You are free to set this value
77 | | to any of the locales which will be supported by the application.
78 | |
79 | */
80 |
81 | 'locale' => 'en',
82 |
83 | /*
84 | |--------------------------------------------------------------------------
85 | | Application Fallback Locale
86 | |--------------------------------------------------------------------------
87 | |
88 | | The fallback locale determines the locale to use when the current one
89 | | is not available. You may change the value to correspond to any of
90 | | the language folders that are provided through your application.
91 | |
92 | */
93 |
94 | 'fallback_locale' => 'en',
95 |
96 | /*
97 | |--------------------------------------------------------------------------
98 | | Faker Locale
99 | |--------------------------------------------------------------------------
100 | |
101 | | This locale will be used by the Faker PHP library when generating fake
102 | | data for your database seeds. For example, this will be used to get
103 | | localized telephone numbers, street address information and more.
104 | |
105 | */
106 |
107 | 'faker_locale' => 'en_US',
108 |
109 | /*
110 | |--------------------------------------------------------------------------
111 | | Encryption Key
112 | |--------------------------------------------------------------------------
113 | |
114 | | This key is used by the Illuminate encrypter service and should be set
115 | | to a random, 32 character string, otherwise these encrypted strings
116 | | will not be safe. Please do this before deploying an application!
117 | |
118 | */
119 |
120 | 'key' => env('APP_KEY'),
121 |
122 | 'cipher' => 'AES-256-CBC',
123 |
124 | /*
125 | |--------------------------------------------------------------------------
126 | | Autoloaded Service Providers
127 | |--------------------------------------------------------------------------
128 | |
129 | | The service providers listed here will be automatically loaded on the
130 | | request to your application. Feel free to add your own services to
131 | | this array to grant expanded functionality to your applications.
132 | |
133 | */
134 |
135 | 'providers' => [
136 |
137 | /*
138 | * Laravel Framework Service Providers...
139 | */
140 | Illuminate\Auth\AuthServiceProvider::class,
141 | Illuminate\Broadcasting\BroadcastServiceProvider::class,
142 | Illuminate\Bus\BusServiceProvider::class,
143 | Illuminate\Cache\CacheServiceProvider::class,
144 | Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
145 | Illuminate\Cookie\CookieServiceProvider::class,
146 | Illuminate\Database\DatabaseServiceProvider::class,
147 | Illuminate\Encryption\EncryptionServiceProvider::class,
148 | Illuminate\Filesystem\FilesystemServiceProvider::class,
149 | Illuminate\Foundation\Providers\FoundationServiceProvider::class,
150 | Illuminate\Hashing\HashServiceProvider::class,
151 | Illuminate\Mail\MailServiceProvider::class,
152 | Illuminate\Notifications\NotificationServiceProvider::class,
153 | Illuminate\Pagination\PaginationServiceProvider::class,
154 | Illuminate\Pipeline\PipelineServiceProvider::class,
155 | Illuminate\Queue\QueueServiceProvider::class,
156 | Illuminate\Redis\RedisServiceProvider::class,
157 | Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
158 | Illuminate\Session\SessionServiceProvider::class,
159 | Illuminate\Translation\TranslationServiceProvider::class,
160 | Illuminate\Validation\ValidationServiceProvider::class,
161 | Illuminate\View\ViewServiceProvider::class,
162 |
163 | /*
164 | * Package Service Providers...
165 | */
166 |
167 | /*
168 | * Application Service Providers...
169 | */
170 | App\Providers\AppServiceProvider::class,
171 | App\Providers\AuthServiceProvider::class,
172 | // App\Providers\BroadcastServiceProvider::class,
173 | App\Providers\EventServiceProvider::class,
174 | App\Providers\RouteServiceProvider::class,
175 |
176 | SwooleTW\Http\LaravelServiceProvider::class,
177 |
178 |
179 | ],
180 |
181 | /*
182 | |--------------------------------------------------------------------------
183 | | Class Aliases
184 | |--------------------------------------------------------------------------
185 | |
186 | | This array of class aliases will be registered when this application
187 | | is started. However, feel free to register as many as you wish as
188 | | the aliases are "lazy" loaded so they don't hinder performance.
189 | |
190 | */
191 |
192 | 'aliases' => [
193 |
194 | 'App' => Illuminate\Support\Facades\App::class,
195 | 'Artisan' => Illuminate\Support\Facades\Artisan::class,
196 | 'Auth' => Illuminate\Support\Facades\Auth::class,
197 | 'Blade' => Illuminate\Support\Facades\Blade::class,
198 | 'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
199 | 'Bus' => Illuminate\Support\Facades\Bus::class,
200 | 'Cache' => Illuminate\Support\Facades\Cache::class,
201 | 'Config' => Illuminate\Support\Facades\Config::class,
202 | 'Cookie' => Illuminate\Support\Facades\Cookie::class,
203 | 'Crypt' => Illuminate\Support\Facades\Crypt::class,
204 | 'DB' => Illuminate\Support\Facades\DB::class,
205 | 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
206 | 'Event' => Illuminate\Support\Facades\Event::class,
207 | 'File' => Illuminate\Support\Facades\File::class,
208 | 'Gate' => Illuminate\Support\Facades\Gate::class,
209 | 'Hash' => Illuminate\Support\Facades\Hash::class,
210 | 'Lang' => Illuminate\Support\Facades\Lang::class,
211 | 'Log' => Illuminate\Support\Facades\Log::class,
212 | 'Mail' => Illuminate\Support\Facades\Mail::class,
213 | 'Notification' => Illuminate\Support\Facades\Notification::class,
214 | 'Password' => Illuminate\Support\Facades\Password::class,
215 | 'Queue' => Illuminate\Support\Facades\Queue::class,
216 | 'Redirect' => Illuminate\Support\Facades\Redirect::class,
217 | 'Redis' => Illuminate\Support\Facades\Redis::class,
218 | 'Request' => Illuminate\Support\Facades\Request::class,
219 | 'Response' => Illuminate\Support\Facades\Response::class,
220 | 'Route' => Illuminate\Support\Facades\Route::class,
221 | 'Schema' => Illuminate\Support\Facades\Schema::class,
222 | 'Session' => Illuminate\Support\Facades\Session::class,
223 | 'Storage' => Illuminate\Support\Facades\Storage::class,
224 | 'URL' => Illuminate\Support\Facades\URL::class,
225 | 'Validator' => Illuminate\Support\Facades\Validator::class,
226 | 'View' => Illuminate\Support\Facades\View::class,
227 |
228 | ],
229 |
230 | ];
231 |
--------------------------------------------------------------------------------
/readme.md:
--------------------------------------------------------------------------------
1 | # 基于laravel+swoole的在线聊天室
2 |
3 |
4 | ## 目录
5 |
6 | - [介绍](#introduction)
7 | - [技术栈](#versions)
8 | - [安装](#installation)
9 | - [配置](#configuration)
10 | - [启动](#run)
11 |
12 | ## Introduction
13 |
14 | 想法参考了这个[项目](https://github.com/hellosee/swoole-webim-demo)这个项目没有任何框架直接使用扩展来开发,并且以文本形式存储用户数据,
15 | 本项目参考了其前端页面样式以及部分逻辑使用laravel以及使用laravel-swoole的package [laravel-x](https://github.com/hhxsv5/laravel-s)
16 | 重构了整个项目,其中使用了swoole的http_server,swoole_websocket_server,异步任务,和swoole_table。
17 |
18 | - 用户数据使用了swoole_table进行存储,一旦重启所有数据都消失了
19 | - 所有ws请求都是用异步任务进行处理
20 | - 使用http_server代替nginx
21 | - 使用swoole_websocket_server搭建ws服务
22 |
23 | 主要代码在以下几个目录
24 |
25 | - app/ChatTask 异步任务
26 | - app/Services wbsocket服务处理
27 | - public 静态资源目录
28 |
29 |
30 | 以上知识点均可在[swoole](https://www.swoole.com/)官网进行查看
31 |
32 | **目前实现的功能有** :
33 |
34 | > * 支持群聊
35 | > * 支持发送文字
36 | > * 支持登出
37 | > * 支持切换房间聊天功能
38 | > * 支持私聊,可以点点私聊
39 | > * 显示未读消息数
40 | > * 接入server酱,使用的是我开发的[sevenshi-serverchan](https://github.com/shisiying/sevenshi-serverchan),订阅过后可以收到群聊的推送
41 |
42 | 你可以直接看一下最终的效果,请查看 [http://webim.xhzyxed.cn/](http://webim.xhzyxed.cn/) 。
43 |
44 | 如果想看看代码原理,请请查看三篇文章:
45 |
46 | # Versions
47 | > Laravel 5.5
48 | > swoole
49 |
50 | 因为使用 `swoole`扩展 所以需要一些基本的安装需求:
51 |
52 | * [swoole扩展的安装](https://www.swoole.com/)
53 |
54 | ## installation
55 |
56 | ```bash
57 | git clone https://github.com/shisiying/webim
58 | composer install
59 | php artisan laravels publish
60 | 选择laravel-s和sevenshi-serverchan进行发布
61 |
62 | ```
63 |
64 | ## configuration
65 |
66 | 在config路径下
67 |
68 |
69 | - laravels.php
70 | ```bash
71 | env('LARAVELS_LISTEN_IP', '0.0.0.0'),
78 | 'listen_port' => env('LARAVELS_LISTEN_PORT', 你的端口),
79 | 'socket_type' => env('LARAVELS_SOCKET_TYPE', defined('SWOOLE_SOCK_TCP') ? \SWOOLE_SOCK_TCP : 1),
80 | 'enable_gzip' => env('LARAVELS_ENABLE_GZIP', false),
81 | 'enable_coroutine_runtime' => false,
82 | 'server' => env('LARAVELS_SERVER', 'LaravelS'),
83 | 'handle_static' => env('LARAVELS_HANDLE_STATIC', true),
84 | 'laravel_base_path' => env('LARAVEL_BASE_PATH', base_path()),
85 | 'inotify_reload' => [
86 | 'enable' => env('LARAVELS_INOTIFY_RELOAD', false),
87 | 'watch_path' => base_path(),
88 | 'file_types' => ['.php'],
89 | 'excluded_dirs' => [],
90 | 'log' => true,
91 | ],
92 | 'websocket' => [
93 | 'enable' => true,
94 | 'handler' => \App\Services\WebSocketService::class,
95 | ],
96 | 'sockets' => [
97 | ],
98 | 'processes' => [
99 | ],
100 | 'timer' => [
101 | 'enable' => false,
102 | 'jobs' => [
103 | // Enable LaravelScheduleJob to run `php artisan schedule:run` every 1 minute, replace Linux Crontab
104 | //\Hhxsv5\LaravelS\Illuminate\LaravelScheduleJob::class,
105 | // Two ways to configure parameters:
106 | // [\App\Jobs\XxxCronJob::class, [1000, true]], // Pass in parameters when registering
107 | // \App\Jobs\XxxCronJob::class, // Override the corresponding method to return the configuration
108 | ],
109 | ],
110 | 'events' => [
111 | ],
112 | 'swoole_tables' => [
113 | //定义登陆用户的信息
114 | 'ws_users' =>[
115 | 'size' => 102400,//Table的最大行数
116 | 'column' => [// Table的列定义$roomid,$fd,$name,$email,$avatar
117 | ['name' => 'roomid', 'type' => \swoole_table::TYPE_STRING, 'size' => 8],
118 | ['name' => 'fd', 'type' => \swoole_table::TYPE_INT, 'size' => 8],
119 | ['name' => 'name', 'type' => \swoole_table::TYPE_STRING, 'size' => 100],
120 | ['name' => 'email', 'type' => \swoole_table::TYPE_STRING, 'size' => 100],
121 | ['name' => 'avatar', 'type' => \swoole_table::TYPE_STRING, 'size' => 100],
122 | ['name' => 'time', 'type' => \swoole_table::TYPE_STRING, 'size' => 50],
123 | ]
124 | ],
125 | 'ws_rooms'=>[
126 | 'size' => 102400,//Table的最大行数
127 | 'column' => [// Table的列定义$roomid,$fd,$name,$email,$avatar
128 | ['name' => 'users', 'type' => \swoole_table::TYPE_STRING, 'size' => 1024],
129 | ]
130 | ],
131 | 'ws_roomUsers'=>[
132 | 'size' => 102400,//Table的最大行数
133 | 'column' => [// Table的列定义$roomid,$fd,$name,$email,$avatar
134 | ['name' => 'infos', 'type' => \swoole_table::TYPE_STRING, 'size' => 1024],
135 | ]
136 | ],
137 | ],
138 | 'register_providers' => [
139 | ],
140 | 'swoole' => [
141 | 'daemonize' => env('LARAVELS_DAEMONIZE', false),
142 | 'dispatch_mode' => 2,
143 | 'reactor_num' => function_exists('\swoole_cpu_num') ? \swoole_cpu_num() * 2 : 4,
144 | 'worker_num' => function_exists('\swoole_cpu_num') ? \swoole_cpu_num() * 2 : 8,
145 | 'task_worker_num' => function_exists('\swoole_cpu_num') ? \swoole_cpu_num() * 2 : 8,
146 | 'task_ipc_mode' => 1,
147 | 'task_max_request' => 5000,
148 | 'task_tmpdir' => @is_writable('/dev/shm/') ? '/dev/shm' : '/tmp',
149 | 'message_queue_key' => ftok(base_path('public/index.php'), 1),
150 | 'max_request' => 3000,
151 | 'open_tcp_nodelay' => true,
152 | 'pid_file' => storage_path('laravels.pid'),
153 | 'log_file' => storage_path(sprintf('logs/swoole-%s.log', date('Y-m'))),
154 | 'log_level' => 4,
155 | 'document_root' => base_path('public'),
156 | 'buffer_output_size' => 16 * 1024 * 1024,
157 | 'socket_buffer_size' => 128 * 1024 * 1024,
158 | 'package_max_length' => 4 * 1024 * 1024,
159 | 'reload_async' => true,
160 | 'max_wait_time' => 60,
161 | 'enable_reuse_port' => true,
162 | 'enable_coroutine' => false,
163 |
164 | /**
165 | * More settings of Swoole
166 | * @see https://wiki.swoole.com/wiki/page/274.html Chinese
167 | * @see https://www.swoole.co.uk/docs/modules/swoole-server/configuration English
168 | */
169 | ],
170 | ];
171 |
172 |
173 | ```
174 |
175 | 记住,websocket_server跟http_server监听同个端口,只不过协议不同而已
176 |
177 | - chat.php
178 | ```bash
179 | define("DOMAIN","域名或者刚才设置的ip和端口");
180 | ```
181 |
182 | - serverchan.php
183 |
184 | ```bash
185 |
186 | 设置推送给群组的server配置
187 | return [
188 | 'a'=>'6739-83848e2xxxxdfd5a74b30aca15d71ec5e961', //sw群组
189 | 'b'=>'6741-7c0b0355xxx85e7e2e86cc6edcdbc7bd',//php群组
190 | 'c'=>'6740-023ed322xxxxfds9c6e3d0e4b268a762622a'//go群组
191 | ];
192 | ```
193 |
194 |
195 | - init.js
196 |
197 | 配置public目录下的init.js
198 | ```bash
199 | var config = {
200 | 'domain' : "http://192.168.10.10:9090",//你的ip和端口,也就是laravel-s上设置的
201 | 'wsserver' : "ws://192.168.10.10:9090",//除了协议不同,其他ip跟端口是一致的
202 | }
203 | ```
204 |
205 | - nginx配置
206 |
207 | 可参考以下配置
208 | ```bash
209 | map $http_upgrade $connection_upgrade {
210 | default upgrade;
211 | '' close;
212 | }
213 | upstream laravels {
214 | # 通过 IP:Port 连接
215 | server 127.0.0.1:5200 weight=5 max_fails=3 fail_timeout=30s;
216 | # 通过 UnixSocket Stream 连接,小诀窍:将socket文件放在/dev/shm目录下,可获得更好的性能
217 | #server unix:/xxxpath/laravel-s-test/storage/laravels.sock weight=5 max_fails=3 fail_timeout=30s;
218 | #server 192.168.1.1:5200 weight=3 max_fails=3 fail_timeout=30s;
219 | #server 192.168.1.2:5200 backup;
220 | keepalive 16;
221 | }
222 | server {
223 | listen 80;
224 | # 别忘了绑Host哟
225 | server_name laravels.com;
226 | root /xxxpath/laravel-s-test/public;
227 | access_log /yyypath/log/nginx/$server_name.access.log main;
228 | autoindex off;
229 | index index.html index.htm;
230 | # Nginx处理静态资源(建议开启gzip),LaravelS处理动态资源。
231 | location / {
232 | try_files $uri @laravels;
233 | }
234 | # 当请求PHP文件时直接响应404,防止暴露public/*.php
235 | #location ~* \.php$ {
236 | # return 404;
237 | #}
238 | # Http和WebSocket共存,Nginx通过location区分
239 | # !!! WebSocket连接时路径为/ws
240 | # Javascript: var ws = new WebSocket("ws://laravels.com/ws");
241 | location =/ws {
242 | proxy_http_version 1.1;
243 | # proxy_connect_timeout 60s;
244 | # proxy_send_timeout 60s;
245 | # proxy_read_timeout:如果60秒内被代理的服务器没有响应数据给Nginx,那么Nginx会关闭当前连接;同时,Swoole的心跳设置也会影响连接的关闭
246 | # proxy_read_timeout 60s;
247 | proxy_set_header X-Real-IP $remote_addr;
248 | proxy_set_header X-Real-PORT $remote_port;
249 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
250 | proxy_set_header Host $http_host;
251 | proxy_set_header Scheme $scheme;
252 | proxy_set_header Server-Protocol $server_protocol;
253 | proxy_set_header Server-Name $server_name;
254 | proxy_set_header Server-Addr $server_addr;
255 | proxy_set_header Server-Port $server_port;
256 | proxy_set_header Upgrade $http_upgrade;
257 | proxy_set_header Connection $connection_upgrade;
258 | proxy_pass http://laravels;
259 | }
260 | location @laravels {
261 | proxy_http_version 1.1;
262 | # proxy_connect_timeout 60s;
263 | # proxy_send_timeout 60s;
264 | # proxy_read_timeout 60s;
265 | proxy_set_header X-Real-IP $remote_addr;
266 | proxy_set_header X-Real-PORT $remote_port;
267 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
268 | proxy_set_header Host $http_host;
269 | proxy_set_header Scheme $scheme;
270 | proxy_set_header Server-Protocol $server_protocol;
271 | proxy_set_header Server-Name $server_name;
272 | proxy_set_header Server-Addr $server_addr;
273 | proxy_set_header Server-Port $server_port;
274 | proxy_set_header Connection "";
275 | proxy_pass http://laravels;
276 | }
277 | }
278 | ```
279 | ## run
280 | ```bash
281 |
282 | 直接项目根目录下执行,加d可以守护态运行
283 |
284 | php artisan laravels start -d
285 |
286 |
287 | ```
288 |
289 |
290 | ## License
291 |
292 | The MIT License (MIT).
293 |
294 |
295 |
296 |
297 |
298 |
299 |
300 |
--------------------------------------------------------------------------------
/app/Services/ChatService.php:
--------------------------------------------------------------------------------
1 | $_v){
41 | $roomss[] = array(
42 | 'roomid' => $_k,
43 | 'roomname' => $_v
44 | );
45 | }
46 | return $roomss;
47 | }
48 |
49 | /**
50 | * @return array|mixed
51 | * swoole_table版本
52 | */
53 | public static function getOnlineUsers(){
54 | $user = new ChatUsersService();
55 | $lists = $user->getOnlineUsers();
56 | return $lists;
57 | }
58 |
59 | //登陆
60 | public static function doLogin($data)
61 | {
62 | $domain = config('chat.domain');
63 | $pushMsg['code'] = 1;
64 | $pushMsg['msg'] = $data['params']['name']."加入了群聊";
65 |
66 | $pushMsg['data']['roomid'] = $data['roomid'];
67 | $pushMsg['data']['fd'] = $data['fd'];
68 | $pushMsg['data']['name'] = $data['params']['name'];
69 | $pushMsg['data']['avatar'] = $domain.'images/avatar/f1/f_'.rand(1,12).'.jpg';
70 | $pushMsg['data']['time'] = date("H:i",time());
71 | //增加房间的名字
72 | $pushMsg['data']['roomname'] = config('chat.rooms')[$data['roomid']];
73 |
74 | self::login($data['roomid'],$data['fd'],$data['params']['name'],$data['params']['email'],$pushMsg['data']['avatar']);
75 | unset( $data );
76 | return $pushMsg;
77 | }
78 |
79 | //登陆写入swoole_table中
80 | public static function login($roomid,$fd,$name,$email,$avatar){
81 | if($name == ""){
82 | $name = '游客'.time();
83 | }
84 | if($email == ""){
85 | $email = 'xxx@qq.com';
86 | }
87 | if(!$name || !$email){
88 |
89 | throw new Exception('Fill in all the required fields.');
90 | }
91 | $user = new ChatUsersService(array(
92 | 'roomid' => $roomid,
93 | 'fd' => $fd,
94 | 'name' => htmlspecialchars($name),
95 | 'email' => $email,
96 | 'avatar' => $avatar
97 | ));
98 | if(!$user->save()){
99 | throw new Exception('This nick is in use.');
100 | }
101 | }
102 |
103 | //登出
104 | public static function doLogout($data)
105 | {
106 | echo "退出################";
107 | var_dump($data);
108 | $roomid = $data['params']['roomid'];
109 |
110 | //从房间里删除用户
111 | $userArr = app('swoole')->ws_roomsTable->get($roomid);
112 | if ($userArr){
113 | $userArr = json_decode($userArr['users'],true);
114 | $key=array_search($data['fd'],$userArr);
115 | array_splice($userArr,$key,1);
116 | app('swoole')->ws_roomsTable->set($roomid, ['users' => json_encode($userArr)]);
117 | }
118 |
119 |
120 | //从房间用户信息删除
121 | $infos = app('swoole')->ws_roomUsersTable->get('roomUsersInfo'.$roomid);
122 | var_dump($infos);
123 | if ($infos){
124 | $infos = json_decode($infos['infos'],true);
125 | if (!empty($infos)){
126 | foreach ($infos as $info_key => $row){
127 | if ($row['fd']==$data['fd']){
128 | array_splice($infos,$info_key,1);
129 | break;
130 | }
131 | }
132 | var_dump($infos);
133 | app('swoole')->ws_roomUsersTable->set('roomUsersInfo'.$roomid,['infos'=>json_encode($infos)]);
134 | }
135 | }
136 | echo "退出结束################";
137 |
138 |
139 | //删除用户
140 | app('swoole')->ws_usersTable->del('user'.$data['fd']);
141 |
142 | $pushMsg['code'] = 3;
143 | $pushMsg['msg'] = $data['params']['name']."退出了群聊";
144 | $pushMsg['data']['fd'] = $data['fd'];
145 | $pushMsg['data']['name'] = $data['params']['name'];
146 | $pushMsg['data']['roomid'] = $roomid;
147 | unset( $data );
148 | return $pushMsg;
149 | }
150 |
151 | //改变房间
152 | public static function change( $data ){
153 | $pushMsg['code'] = 6;
154 | $pushMsg['msg'] = '换房成功';
155 | $user = new ChatUsersService(array(
156 | 'roomid' => $data['roomid'],//新的房间号
157 | 'fd' => $data['fd'],
158 | 'name' => htmlspecialchars($data['params']['name']),
159 | 'email' => $data['params']['email'],
160 | 'avatar' => $data['params']['avatar']
161 | ));
162 |
163 | $is_copyed = $user->changeUser($data['oldroomid'],$data['fd'],$data['roomid']);
164 |
165 | if($is_copyed){
166 | $pushMsg['data']['oldroomid'] = $data['oldroomid'];
167 | $pushMsg['data']['roomid'] = $data['roomid'];
168 | $pushMsg['data']['mine'] = 0;
169 | $pushMsg['data']['fd'] = $data['fd'];
170 | $pushMsg['data']['name'] = $data['params']['name'];
171 | $pushMsg['data']['avatar'] = $data['params']['avatar'];
172 | $pushMsg['data']['time'] = date("H:i",time());
173 | unset( $data );
174 | return $pushMsg;
175 | }
176 |
177 | return false;
178 |
179 | }
180 |
181 | //发送消息
182 | public static function sendNewMsg( $data ){
183 | $pushMsg['code'] = 2;
184 | $pushMsg['msg'] = "";
185 | $pushMsg['data']['roomid'] = $data['roomid'];
186 | $pushMsg['data']['fd'] = $data['fd'];
187 | $pushMsg['data']['name'] = $data['params']['name'];
188 | $pushMsg['data']['avatar'] = $data['params']['avatar'];
189 | $pushMsg['data']['newmessage'] = self::escape(htmlspecialchars($data['message']));
190 | $pushMsg['data']['remains'] = array();
191 | if($data['c'] == 'img'){
192 | $pushMsg['data']['newmessage'] = '