lrf 1 year ago
parent
commit
5db2464a9d
2 changed files with 5 additions and 7 deletions
  1. 3 3
      app/controller/yunjiuye.js
  2. 2 4
      app/service/yunjiuye.js

+ 3 - 3
app/controller/yunjiuye.js

@@ -7,7 +7,7 @@ class YunjiuyeController extends Controller {
     this.service = this.ctx.service.yunjiuye;
 
   }
-  // http://127.0.0.1:7001/api/train/y/login?code=中心&org=0
+  // http://127.0.0.1:7001/api/train/y/login?params=
   async login() {
     this.service.getDomain();
     const pstr = this.ctx.request.querystring;
@@ -42,8 +42,8 @@ class YunjiuyeController extends Controller {
     const { id } = query;
     const data = await this.service.getBindInfo(id);
     const encDataStr = this.service.encryptData(data);
-    await this.service.yLogout(encDataStr);
-    this.ctx.ok();
+    const url = await this.service.yLogout(encDataStr);
+    this.ctx.ok({ data: url });
   }
 }
 module.exports = YunjiuyeController;

+ 2 - 4
app/service/yunjiuye.js

@@ -115,10 +115,8 @@ class YunjiuyeService extends Service {
   async yLogout(params) {
     const domain = await this.app.redis.get('yjyDomain');
     if (!domain) throw new BusinessError(ErrorCode.SERVICE_FAULT, '缺少登录时的域名');
-    const uri = `${domain}/auth/logout?params=${params}`;
-    const result = await this.ctx.curl(uri, {
-      dataType: 'json',
-    });
+    const url = `${domain}/auth/logout?params=${params}`;
+    return url;
   }
   // 加密,使用云就业提供的公钥对数据进行加密,供退出登录加密参数使用
   encryptData(data) {