codecamp

路由

WTM框架本身为你配置了标准的路由,如果需要自定义,可以修改Program.cs文件配置自己的路由

定义数据路由
  1. public class Program
  2. {
  3. public static void Main(string[] args)
  4. {
  5. BuildWebHost(args).Run();
  6. }
  7. public static IWebHost BuildWebHost(string[] args) =>
  8. WebHost.CreateDefaultBuilder(args)
  9. .ConfigureServices(x =>
  10. {
  11. x.AddFrameworkService(dataPrivilegeSettings: pris);
  12. x.AddLayui();
  13. })
  14. .Configure(x =>
  15. {
  16. x.UseFrameworkService(routes =>
  17. {
  18. routes.MapRoute(
  19. name: "areaRoute",
  20. template: "{area:exists}/{controller=Home}/{action=Index}/{id?}");
  21. routes.MapRoute(
  22. name: "default",
  23. template: "{controller=Home}/{action=Index}/{id?}");
  24. });
  25. })
  26. .Build();
  27. }


数据权限
创建模型
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

控制器

数据层

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }