UNPKG

youzanyun-devtool-worker

Version:

- web - ws - proxy

48 lines (47 loc) 1.94 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const spring4js_nodejs_1 = require("spring4js-nodejs"); const BaseController_1 = tslib_1.__importDefault(require("../BaseController")); let LoginController = class LoginController extends BaseController_1.default { async optionLoginInfo(ctx, next) { ctx.append('Access-Control-Allow-Headers', 'x-third-info, x-requested-with, content-type'); ctx.append('Access-Control-Allow-Origin', 'https://diy.youzanyun.com'); ctx.append('Access-Control-Allow-Methods', 'POST, OPTIONS'); ctx.body = { code: 200, data: {}, message: 'success', success: true, msg: 'success' }; } async getLoginInfo(ctx, next) { ctx.append('Access-Control-Allow-Headers', 'x-third-info, x-requested-with, content-type'); ctx.append('Access-Control-Allow-Origin', 'https://diy.youzanyun.com'); ctx.append('Access-Control-Allow-Methods', 'POST'); const sid = ctx.header['x-third-info']; const { userName } = ctx.request.body; await this.userService.changeUserInfo(sid, userName); ctx.body = { code: 200, data: {}, message: 'success', success: true, msg: 'success' }; } }; tslib_1.__decorate([ spring4js_nodejs_1.Resource() ], LoginController.prototype, "userService", void 0); tslib_1.__decorate([ spring4js_nodejs_1.Path("info", spring4js_nodejs_1.HttpMethod.OPTIONS) ], LoginController.prototype, "optionLoginInfo", null); tslib_1.__decorate([ spring4js_nodejs_1.Path("info", spring4js_nodejs_1.HttpMethod.POST) ], LoginController.prototype, "getLoginInfo", null); LoginController = tslib_1.__decorate([ spring4js_nodejs_1.Controller("/api/third-login") ], LoginController); exports.default = LoginController;