Chinaunix首页 | 论坛 | 博客
  • 博客访问: 864329
  • 博文数量: 286
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 1841
  • 用 户 组: 普通用户
  • 注册时间: 2015-05-09 16:26
文章分类

全部博文(286)

文章存档

2016年(38)

2015年(248)

我的朋友

分类: LINUX

2015-06-27 10:16:03

方法一:直接定义不经过admin这个顶层,如:

点击(此处)折叠或打开

  1. --文件位置:/luci/controller/myapp/

  2. module("luci.controller.myapp.mymodule", package.seeall)

  3. function index()
  4.     entry({"listome", "up"}, call("action_tryme"), "Click here", 10).dependent=false
  5.     end

  6.      function action_tryme()
  7.      local h=require "luci.http"
  8.      local username=h.formvalue("username")
  9.          luci.http.prepare_content("text/plain")
  10.              luci.http.write("Haha, nihao ...")
  11.              h.write("my name is "..username)
  12.                  --luci.sys.reboot()
  13.                  end

方法二:手动设置无需认证

点击(此处)折叠或打开

  1. x = entry({"admin","system","test"}, template("myApp/overview"), "Some Page", 65)
  2. x.dependant = false
  3. x.sysauth = false
  4. x.sysauth_authenticator = "htmlauth"



阅读(2398) | 评论(2) | 转发(0) |
给主人留下些什么吧!~~

tay872022-09-18 11:29:42

sheepbao:。。。。。。。。。。。博客自身源码都出来了

大佬,能不能有偿咨询下openwrt问题

回复 | 举报

sheepbao2015-07-05 18:49:10

。。。。。。。。。。。博客自身源码都出来了