<commit_before>/**
 *
 * @authors liwb (<EMAIL>)
 * @date    2016/12/11 22:19
 * @version $ IIFE
 */

/* name module */
var modalOptions = require('jsDir/modal_options');

Api.$inject = ['$state', '$cookies', '$http', 'modalService'];

function Api($cookies, $http, modalService) {

  var params = {
    successCallback: function (result) {
      console.log('success' + JSON.stringify(result))
    },

    failCallback: function (response) {

      var errorOptions = angular.copy(modalOptions);

      errorOptions.modalTitle = '失败';

      if (i18n.global[response.error_no]) {
        errorOptions.modalInfo = i18n.global.error[response.error_no];
      } else if (!response.error_info) {
        errorOptions.modalInfo = i18n.global.error[response.error_no];
      } else {
        errorOptions.modalInfo = response.error_info;
      }

      modalService.openModal(errorOptions);
    },

    disconnectCallback: function (response) {
      console.log("访问失败")
    }
  }


  /**
   * 扩展不同url前缀
   * 如根域名是'muziso.com'， 有不同扩展，client, common等，方法可随着项目更改
   * @param type
   * @returns {*}
   */
  function appendUrlPrefix(type) {
    if (type == 1) {
      return LOCAL_CONFIG.API_HOME;
    }
  }
<commit_msg>fix bugs<commit_after>/**
 *
 * @authors liwb (<EMAIL>)
 * @date    2016/12/11 22:19
 * @version $ IIFE
 */

/* name module */
var modalOptions = require('jsDir/modal_options');
var config = require('../config');

Api.$inject = ['$state', '$cookies', '$http', 'modalService'];

function Api($cookies, $http, modalService) {

  var params = {
    successCallback: function (result) {
      console.log('success' + JSON.stringify(result))
    },

    failCallback: function (response) {

      var errorOptions = angular.copy(modalOptions);

      errorOptions.modalTitle = '失败';

      if (i18n.global[response.error_no]) {
        errorOptions.modalInfo = i18n.global.error[response.error_no];
      } else if (!response.error_info) {
        errorOptions.modalInfo = i18n.global.error[response.error_no];
      } else {
        errorOptions.modalInfo = response.error_info;
      }

      modalService.openModal(errorOptions);
    },

    disconnectCallback: function (response) {
      console.log("访问失败")
    }
  }


  /**
   * 扩展不同url前缀
   * 如根域名是'muziso.com'， 有不同扩展，client, common等，方法可随着项目更改
   * @param type
   * @returns {*}
   */
  function appendUrlPrefix(type) {
    if (type == 1) {
      return LOCAL_CONFIG.API_HOME + config.OPEN_API;
    }
  }

{'fraction_non_alphanumeric': 0.14870340356564019, 'fraction_numerical': 0.01539708265802269, 'mean_word_length': 2.969453376205788, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5509150', 'n_tokens_mistral': 887, 'n_tokens_neox': 866, 'n_words': 143}