File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,17 @@ const io = feathers()
1818io . configure ( feathers . socketio ( socket ) )
1919io . configure ( feathers . authentication ( ) )
2020
21+ const socketAuthUsers = sio ( 'https://auth.vueplay.io' , {
22+ transports : [ 'websocket' , 'polling' ]
23+ } )
24+ const authUsers = feathers ( )
25+ const socketClient = feathers . socketio ( socketAuthUsers )
26+ authUsers . configure ( socketClient )
27+ authUsers . configure ( feathers . authentication ( ) )
28+ authUsers . use ( 'users' , socketClient . service ( 'users' ) , {
29+ methods : [ 'count' ]
30+ } )
31+
2132let boot = async ( ) => {
2233
2334 try {
@@ -33,6 +44,7 @@ let boot = async () => {
3344 } )
3445
3546 app . provide ( 'io' , io )
47+ app . provide ( 'authUsers' , authUsers )
3648 app . provide ( 'user' , computed ( ( ) => user ?. value ) )
3749 app . provide ( 'reAuthenticate' , async ( ) => {
3850 try {
Original file line number Diff line number Diff line change 216216 style =" margin-bottom :100px ;color :#15244fff ;margin-top :75px ;width :calc (100% - 40px );margin-left :20px "
217217 class =" text-4xl md:text-slate-900 font-bold"
218218 >
219- 2500+ Registered Users 🚀
219+ {{count}} Registered Users 🚀
220220 </h2 >
221221 <h2
222222 style =" margin-bottom :50px ;max-width :450px ;color :#15244fff "
332332 import Footer from " @/components/Footer.vue" ;
333333 import Meta from " @/components/Meta.vue" ;
334334 export default {
335+ inject: [' authUsers' ],
335336 components: {
336337 VueNavigator,
337338 Footer,
338339 Meta
339340 },
340- data : () => ({}),
341+ data : () => ({
342+ count: ' 2500+'
343+ }),
344+ async created () {
345+ try {
346+ this .count = (await this .authUsers .service (' users' )
347+ .count ({}))
348+ ? .count ;
349+ } catch (e) {
350+ console .log (' err' , e);
351+ }
352+ },
341353 methods: {
342354 open (url ) {
343355 location .href = url;
You can’t perform that action at this time.
0 commit comments