var system = require("../../../system");
var settings = require("../../../../config/settings");
const AppServiceBase = require("../../app.base");
const logCtl = system.getObject("service.common.oplogSve");
//渠道用户权限操作
class UtilsChannelAuthService extends AppServiceBase {
  constructor() {
    super();
    this.centerAppUrl = settings.centerAppUrl();
  }
  //---------------登录-----------------------------------------------------

  async getH5AliDingUserByCode(pobj, actionBody) { //渠道通过账户进行登录，有则返回用户信息，没有则创建用户
    if (!actionBody.code) {
      return system.getResult(null, "actionBody.code can not be empty");
    }
    var result = await this.restPostUrl(pobj, this.centerAppUrl + "auth/channelAccessAuth/getH5AliDingUserByCode");
    return result;
  }

  async getDingJsApiAuthInfo(pobj, actionBody) { //获取token
    var result = await this.restPostUrl(pobj, this.centerAppUrl + "auth/channelAccessAuth/getDingJsApiAuthInfo");
    return result;
  }

}
module.exports = UtilsChannelAuthService;
