const TaskBase = require("../../task.base");
const system = require("../../../system");
var settings = require("../../../../config/settings");
class Taskpannongtoken extends TaskBase {
  constructor() {
    super(TaskBase.getServiceName(Taskpannongtoken));
    this.restclient = system.getObject("util.restClient");
    this.gsbDeliverlUrl = settings.gsbDeliver();
  }
  async beforeTask(params) {
    console.log("前置操作......", this.serviceName);
    //this.isThrough=true; 
    //console.log(this.cacheManager);
  }
  async subDoTask() {
    var obj = {}
    try {
      if(!this.gsbDeliverlUrl) {
        console.log("web/auth/authCtl/refreshToken gsbDeliverlUrl is empty")
        return;
      }
      var url = this.gsbDeliverlUrl + "web/auth/authCtl/refreshToken";
      // 2020 1112 lin 新增 这里写死的字符串是由兴业提供 作为请求校验用
      this.restclient.execPostpannong(obj, url,"5ae2da88-0ced-4b7a-98ea-60d5e1ff7e2e");
      return system.getResultSuccess();
    } catch (error) {
      console.log("error",error);
      return null;
    }
  }
}
module.exports = Taskpannongtoken;