
Yuapp.config(["w5cValidatorProvider", function (w5cValidatorProvider) {

    // 全局配置
    w5cValidatorProvider.config({
        blurTrig: false,
        showError: true,
        removeError: true

    })
    w5cValidatorProvider.setRules({
        email: {
            required      : "该选项不能为空",
            maxlength     : "该选项输入值长度不能大于{maxlength}",
            minlength     : "该选项输入值长度不能小于{minlength}",
            email         : "输入邮件的格式不正确",
            repeat        : "两次输入不一致",
            pattern       : "该选项输入格式不正确",
            number        : "必须输入数字",
            w5cuniquecheck: "该输入值已经存在，请重新输入",
            url           : "输入URL格式不正确",
            max           : "该选项输入值不能大于{max}",
            min           : "该选项输入值不能小于{min}"
        },
    })
}]).config(['flowFactoryProvider', function (flowFactoryProvider) {
    flowFactoryProvider.defaults = {
        target: 'yu/upload',
        permanentErrors: [404, 500, 501],
        maxChunkRetries: 1,
        chunkRetryInterval: 5000,
        simultaneousUploads: 4,
        uploadMethod:'post',
        testChunks:false
    };
}]);


Yuapp.config(function ($stateProvider, $urlRouterProvider, $httpProvider) {
    $urlRouterProvider.otherwise("/home");
    $httpProvider.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded;charset=utf-8";
    $httpProvider.defaults.headers.post["Accept"] = "*/*";
    $httpProvider.defaults.transformRequest = function (data) {
        if (data) {
            return jQuery.param(data);
        }
        return data;
    };
    $stateProvider
        .state('home', {
            url: '/home',
            templateUrl: "lky/app/page/home.html",
            controller: 'home'
        })
        .state('system', {
            url: '/system',
            templateUrl: "lky/app/page/common-2.html",
            controller: 'yu'
        })

        .state('system.menu_list', {
            url: '/menu',
            templateUrl: "lky/app/page/adminmenu/list.html",
            controller: 'system.menu'
        })
        .state('system.menu_edit', {
            url: '/menu_edit',
            templateUrl: "lky/app/page/adminmenu/edit.html",
            controller: 'system.menu',
            params: {'id': null},
        })

        .state('system.role_list', {
            url: '/role',
            templateUrl: "lky/app/page/adminrole/list.html",
            controller: 'system.role'
        })
        .state('system.role_edit', {
            url: '/role_edit',
            templateUrl: "lky/app/page/adminrole/edit.html",
            controller: 'system.role',
            params: {'id': null},
        })

        .state('system.admin_list', {
            url: '/admin',
            templateUrl: "lky/app/page/adminadmin/list.html",
            controller: 'system.admin'
        })
        .state('system.admin_edit', {
            url: '/admin_edit',
            templateUrl: "lky/app/page/adminadmin/edit.html",
            controller: 'system.admin',
            params: {'id': null},
        })


});

