SysConfigService.js 1.3 KB
"use strict";
var SysConfigService = angular.module('SysConfigService',[]);

SysConfigService.service("SysConfigService", [
	'$rootScope',
	'BaseService',
	function ($rootScope,BaseService) {
		var _service = {
            loanSysConfig:function() {
                BaseService.request({
                    url:BaseService.url.sysConfig_gain_url,
                    method: 'post',
                    mark: true,
                    fn: function (response) {
                        _service.period = response.data;
                        $rootScope.$broadcast('sys.period');
                    }
                });
            },
            updatePeriodConfiguration:function(val) {
                BaseService.request({
                    url:BaseService.url.updatePeriodConfiguration_url,
                    method: 'post',
                    mark: true,
                    data:{type:0,content:val},
                    fn: function (response) {
                        if(response.code =="0"){
                            BaseService.updateAlert("修改成功");
                            window.location.reload();
                        }else{
                            BaseService.updateAlert(response.message);
                        }
                    }
                });
            }
        };
		return _service;
	}
]);