Файловый менеджер - Редактировать - /home/freeclou/app.optimyar.com/front-web/build/assets/fonts/iran-yekan/beflpn/user-session.zip
Назад
PK �Kj[I�>� � config/routes.jsonnu �[��� { "routes": [ { "method": "GET", "path": "/user-sessions", "handler": "user-session.find", "config": { "policies": [] } }, { "method": "GET", "path": "/user-sessions/count", "handler": "user-session.count", "config": { "policies": [] } }, { "method": "GET", "path": "/user-sessions/:id", "handler": "user-session.findOne", "config": { "policies": [] } }, { "method": "POST", "path": "/user-sessions", "handler": "user-session.create", "config": { "policies": [] } }, { "method": "PUT", "path": "/user-sessions/:id", "handler": "user-session.update", "config": { "policies": [] } }, { "method": "DELETE", "path": "/user-sessions/:id", "handler": "user-session.delete", "config": { "policies": [] } } ] } PK �Kj[i� � controllers/user-session.jsnu �[��� 'use strict'; const requestIp = require('request-ip'); const {sanitizeEntity} = require('strapi-utils'); /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/controllers.html#core-controllers) * to customize this controller */ module.exports = { async create(ctx) { const {user} = ctx.state; //if user has 2 active session throw error const byUser = await strapi.services["user-session"].find({user: user.id, activeCode_null: false}); if (byUser && byUser.filter(x => x.isActive).length < 2) { const data = ctx.request.body; data.user = user.id; data.ip = requestIp.getClientIp(ctx.request.req); data.isActive = true; const entity = await strapi.services["user-session"].create(data); return ctx.send(entity.id); } else { return ctx.badRequest(null, "errors.moreThanNBrowser"); } }, async findOne(ctx) { try { const {id} = ctx.params; const {user} = ctx.state; const byId = await strapi.services["user-session"].findOne({user: user.id,activeCode: id}); if (byId === null) { return ctx.send(false); } //save last access await strapi.services["user-session"].update({id: byId.id}, {lastAccess: new Date(), playWithUser: user.id}); return sanitizeEntity(byId, {model: strapi.models["user-session"]}); } catch (ex) { return ctx.send(false); } } }; PK �Kj[*tq0�I �I % documentation/1.0.0/user-session.jsonnu �[��� { "paths": { "/user-sessions": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "parameters": [ { "name": "_limit", "in": "query", "required": false, "description": "Maximum number of results possible", "schema": { "type": "integer" }, "deprecated": false }, { "name": "_sort", "in": "query", "required": false, "description": "Sort according to a specific field.", "schema": { "type": "string" }, "deprecated": false }, { "name": "_start", "in": "query", "required": false, "description": "Skip a specific number of entries (especially useful for pagination)", "schema": { "type": "integer" }, "deprecated": false }, { "name": "=", "in": "query", "required": false, "description": "Get entries that matches exactly your input", "schema": { "type": "string" }, "deprecated": false }, { "name": "_ne", "in": "query", "required": false, "description": "Get records that are not equals to something", "schema": { "type": "string" }, "deprecated": false }, { "name": "_lt", "in": "query", "required": false, "description": "Get record that are lower than a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_lte", "in": "query", "required": false, "description": "Get records that are lower than or equal to a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_gt", "in": "query", "required": false, "description": "Get records that are greater than a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_gte", "in": "query", "required": false, "description": "Get records that are greater than or equal a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_contains", "in": "query", "required": false, "description": "Get records that contains a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_containss", "in": "query", "required": false, "description": "Get records that contains (case sensitive) a value", "schema": { "type": "string" }, "deprecated": false }, { "name": "_in", "in": "query", "required": false, "description": "Get records that matches any value in the array of values", "schema": { "type": "array", "items": { "type": "string" } }, "deprecated": false }, { "name": "_nin", "in": "query", "required": false, "description": "Get records that doesn't match any value in the array of values", "schema": { "type": "array", "items": { "type": "string" } }, "deprecated": false } ] }, "post": { "deprecated": false, "description": "Create a new record", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "requestBody": { "description": "", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewUser-session" } } } } } }, "/user-sessions/count": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "parameters": [] } }, "/user-sessions/{id}": { "get": { "deprecated": false, "description": "", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] }, "put": { "deprecated": false, "description": "Update a record", "responses": { "200": { "description": "response", "content": { "application/json": { "schema": { "properties": { "foo": { "type": "string" } } } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "requestBody": { "description": "", "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/NewUser-session" } } } }, "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] }, "delete": { "deprecated": false, "description": "Delete a record", "responses": { "200": { "description": "deletes a single record based on the ID supplied", "content": { "application/json": { "schema": { "type": "integer", "format": "int64" } } } }, "403": { "description": "Forbidden", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "404": { "description": "Not found", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } }, "default": { "description": "unexpected error", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Error" } } } } }, "summary": "", "tags": [ "User-session" ], "parameters": [ { "name": "id", "in": "path", "description": "", "deprecated": false, "required": true, "schema": { "type": "string" } } ] } } }, "components": { "schemas": { "User-session": { "required": [ "id" ], "properties": { "id": { "type": "string" }, "user": { "required": [ "id", "username", "email", "name", "phoneNo" ], "properties": { "id": { "type": "string" }, "username": { "type": "string" }, "email": { "type": "string" }, "provider": { "type": "string" }, "password": { "type": "string" }, "resetPasswordToken": { "type": "string" }, "confirmed": { "type": "boolean" }, "blocked": { "type": "boolean" }, "role": { "type": "string" }, "name": { "type": "string" }, "family": { "type": "string" }, "phoneNo": { "type": "integer" }, "avatarImage": { "type": "string" }, "nationalCode": { "type": "string" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } }, "screenSize": { "type": "string" }, "browser": { "type": "string" }, "browserVersion": { "type": "string" }, "os": { "type": "string" }, "osVersion": { "type": "string" }, "cookieEnabled": { "type": "boolean" }, "isMobile": { "type": "boolean" }, "activeCode": { "type": "string" }, "ip": { "type": "string" }, "isActive": { "type": "boolean" }, "lastAccess": { "type": "string", "format": "date-time" }, "playWithUser": { "required": [ "id", "username", "email", "name", "phoneNo" ], "properties": { "id": { "type": "string" }, "username": { "type": "string" }, "email": { "type": "string" }, "provider": { "type": "string" }, "password": { "type": "string" }, "resetPasswordToken": { "type": "string" }, "confirmed": { "type": "boolean" }, "blocked": { "type": "boolean" }, "role": { "type": "string" }, "name": { "type": "string" }, "family": { "type": "string" }, "phoneNo": { "type": "integer" }, "avatarImage": { "type": "string" }, "nationalCode": { "type": "string" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } }, "published_at": { "type": "string", "format": "date-time" } } }, "NewUser-session": { "properties": { "user": { "type": "string" }, "screenSize": { "type": "string" }, "browser": { "type": "string" }, "browserVersion": { "type": "string" }, "os": { "type": "string" }, "osVersion": { "type": "string" }, "cookieEnabled": { "type": "boolean" }, "isMobile": { "type": "boolean" }, "activeCode": { "type": "string" }, "ip": { "type": "string" }, "isActive": { "type": "boolean" }, "lastAccess": { "type": "string", "format": "date-time" }, "playWithUser": { "type": "string" }, "published_at": { "type": "string", "format": "date-time" }, "created_by": { "type": "string" }, "updated_by": { "type": "string" } } } } }, "tags": [] }PK �Kj[��ٮ � models/user-session.jsnu �[��� 'use strict'; /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/models.html#lifecycle-hooks) * to customize this model */ module.exports = {}; PK �Kj[��� � ! models/user-session.settings.jsonnu �[��� { "kind": "collectionType", "collectionName": "user_sessions", "info": { "name": "UserSession", "description": "" }, "options": { "increments": true, "timestamps": true, "draftAndPublish": true }, "attributes": { "user": { "plugin": "users-permissions", "model": "user" }, "screenSize": { "type": "string" }, "browser": { "type": "string" }, "browserVersion": { "type": "string" }, "os": { "type": "string" }, "osVersion": { "type": "string" }, "cookieEnabled": { "type": "boolean" }, "isMobile": { "type": "boolean" }, "activeCode": { "type": "string" }, "ip": { "type": "string" }, "isActive": { "type": "boolean" }, "lastAccess": { "type": "datetime" }, "playWithUser": { "plugin": "users-permissions", "model": "user" } } } PK �Kj[3wl� � services/user-session.jsnu �[��� 'use strict'; /** * Read the documentation (https://strapi.io/documentation/v3.x/concepts/services.html#core-services) * to customize this service */ module.exports = {}; PK �Kj[I�>� � config/routes.jsonnu �[��� PK �Kj[i� � controllers/user-session.jsnu �[��� PK �Kj[*tq0�I �I % � documentation/1.0.0/user-session.jsonnu �[��� PK �Kj[��ٮ � T models/user-session.jsnu �[��� PK �Kj[��� � ! �T models/user-session.settings.jsonnu �[��� PK �Kj[3wl� � Y services/user-session.jsnu �[��� PK ! �Y
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка