auth.js 1012 Bytes
/**
 * 路由接口映射
 * @author h1bomb
 */
var connfig=require("../staticConfig.js");
var env = process.env.NODE_ENV || 'development';
//接口主域
exports.domain = 'http://localhost:30012';
//路由配置
exports.res =
[{
    route: '/login',
    method: 'POST',
    view: 'pages/login',
    url:'/auth',
    isJsonRaw: false,
    params: [{
        name: 'user',
        type: 'String',
        maxLength: 16,
        minLength: 6,
        reg: /^\S{5,10}$/,
        message: '必须是6-16位的字符'
    },{
        name:'password',
        type: 'String',
        maxLength: 16,
        minLength: 6,
        reg: /[0-9A-Za-z]{6,16}/,
        message: '必须是6-16位的字符'
    }]
},{
    route:'/login',
    method:'GET',
    view: 'pages/index',
    data:{
        __pathsrc:"xxxx"//connfig.staticDir[env]?connfig.staticDir[env].path:"/dist"
    }
},{
    route:'/logout',
    method:'GET',
    noApi:true
},
{
    route: '/',
    method: 'GET',
    view: 'pages/index',
    noApi:true
}];