lrf 1 tahun lalu
induk
melakukan
690614683a

+ 4 - 5
app/controller/yunjiuye.js

@@ -5,11 +5,11 @@ class YunjiuyeController extends Controller {
     super(ctx);
     this.service = this.ctx.service.yunjiuye;
   }
-
+  // http://127.0.0.1:7001/api/train/y/login?code=中心&org=0
   async login() {
-    const body = this.ctx.request.body;
-    const { code, org } = body;
-    const res = await this.service.checkUserIsConnect(body);
+    const query = this.ctx.query;
+    const { code, org } = query;
+    const res = await this.service.checkUserIsConnect(query);
     const { toBindPage, toDealTokenPage } = this.app.config.yunjiuye;
     // 没关联,转到登录页面
     if (!res) {
@@ -19,7 +19,6 @@ class YunjiuyeController extends Controller {
       const token = await this.service.userToken(res);
       this.ctx.redirect(`${toDealTokenPage}?token=${token}`);
     }
-
   }
 
   async userBind() {

+ 1 - 0
app/middleware/logs.js

@@ -34,6 +34,7 @@ module.exports = (options, app) => {
       }
     } catch (error) {
       console.error(`${moment().format('YYYY-MM-DD HH:mm:ss')}日志生成发生错误!`);
+      console.error(error);
     } finally {
       await next();
     }

+ 1 - 1
app/router.js

@@ -7,7 +7,7 @@ module.exports = app => {
   const { router, controller } = app;
   router.get('/', controller.home.index);
   // 云就业登录
-  router.post('/api/train/y/login', controller.yunjiuye.login);
+  router.get('/api/train/y/login', controller.yunjiuye.login);
   // 云就业登录
   router.post('/api/train/y/userBind', controller.yunjiuye.userBind);
   // 共通查询单条记录方法

+ 1 - 0
app/utils/routerword.js

@@ -53,6 +53,7 @@ module.exports = (route, method) => {
     groupscore: '学生小组分',
     cerconfirm: '校验学生证书资格',
     talented: '新人才报',
+    y: '云就业相关',
   };
   let word = routeWord[keys[0]];
   if (method === 'DELETE') {

+ 4 - 0
config/config.default.js

@@ -146,6 +146,10 @@ module.exports = appInfo => {
     expiresIn: '1d',
     issuer: 'train',
   };
+  config.yunjiuye = {
+    toBindPage: 'http://jytz.jilinjobs.cn/y/', // 云就业绑定页面
+    toDealTokenPage: 'http://jytz.jilinjobs.cn/y/deal', // 云就业免登录处理token路由
+  };
 
   return {
     ...config,

+ 2 - 2
config/config.prod.js

@@ -68,8 +68,8 @@ module.exports = () => {
     },
   };
   config.yunjiuye = {
-    toBindPage: 'http://jytz.jilinjobs.cn/train/y/', // 云就业绑定页面
-    toDealTokenPage: 'http://jytz.jilinjobs.cn/train/y/deal', // 云就业免登录处理token路由
+    toBindPage: 'http://jytz.jilinjobs.cn/y/', // 云就业绑定页面
+    toDealTokenPage: 'http://jytz.jilinjobs.cn/y/deal', // 云就业免登录处理token路由
   };
 
   return config;