mirror of
https://github.com/mindoc-org/mindoc.git
synced 2025-06-28 15:45:35 +08:00
Merge pull request #195 from DigitalUnion/master
This commit is contained in:
commit
9440aff51f
@ -1,40 +1,52 @@
|
||||
package controllers
|
||||
|
||||
import (
|
||||
"time"
|
||||
"strings"
|
||||
"regexp"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"net/smtp"
|
||||
"github.com/lifei6671/mindoc/conf"
|
||||
"github.com/lifei6671/mindoc/models"
|
||||
"github.com/lifei6671/mindoc/utils"
|
||||
|
||||
"github.com/astaxie/beego"
|
||||
"github.com/astaxie/beego/logs"
|
||||
"github.com/lifei6671/gocaptcha"
|
||||
"strconv"
|
||||
"github.com/lifei6671/mindoc/conf"
|
||||
"github.com/lifei6671/mindoc/models"
|
||||
"github.com/lifei6671/mindoc/utils"
|
||||
)
|
||||
|
||||
// AccountController 用户登录与注册.
|
||||
// AccountController 用户登录与注册
|
||||
type AccountController struct {
|
||||
BaseController
|
||||
}
|
||||
|
||||
// Login 用户登录.
|
||||
// Login 用户登录
|
||||
func (c *AccountController) Login() {
|
||||
c.Prepare()
|
||||
c.TplName = "account/login.tpl"
|
||||
|
||||
var remember struct { MemberId int ; Account string; Time time.Time}
|
||||
var remember struct {
|
||||
MemberId int
|
||||
Account string
|
||||
Time time.Time
|
||||
}
|
||||
|
||||
// 显式指定的 URL 参数优先;为了统一处理,将之更新到 Session 中
|
||||
turl := c.GetString("turl", "")
|
||||
if turl != "" {
|
||||
c.SetSession("turl", turl)
|
||||
}
|
||||
|
||||
beego.Info("AccountController.Login(): turl is: " + turl)
|
||||
|
||||
// 如果 Cookie 中存在登录信息
|
||||
if cookie, ok := c.GetSecureCookie(conf.GetAppKey(), "login"); ok {
|
||||
|
||||
if err := utils.Decode(cookie, &remember); err == nil {
|
||||
if member, err := models.NewMember().Find(remember.MemberId); err == nil {
|
||||
c.SetMember(*member)
|
||||
|
||||
c.Redirect(beego.URLFor("HomeController.Index"), 302)
|
||||
c.LoggedIn(false)
|
||||
c.StopRun()
|
||||
}
|
||||
}
|
||||
@ -48,14 +60,13 @@ func (c *AccountController) Login() {
|
||||
|
||||
// 如果开启了验证码
|
||||
if v, ok := c.Option["ENABLED_CAPTCHA"]; ok && strings.EqualFold(v, "true") {
|
||||
v,ok := c.GetSession(conf.CaptchaSessionName).(string);
|
||||
v, ok := c.GetSession(conf.CaptchaSessionName).(string)
|
||||
if !ok || !strings.EqualFold(v, captcha) {
|
||||
c.JsonResult(6001, "验证码不正确")
|
||||
}
|
||||
}
|
||||
member,err := models.NewMember().Login(account,password)
|
||||
|
||||
//如果没有数据
|
||||
member, err := models.NewMember().Login(account, password)
|
||||
if err == nil {
|
||||
member.LastLoginTime = time.Now()
|
||||
member.Update()
|
||||
@ -69,20 +80,45 @@ func (c *AccountController) Login() {
|
||||
if err == nil {
|
||||
c.SetSecureCookie(conf.GetAppKey(), "login", v)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
c.JsonResult(0,"ok")
|
||||
data := c.LoggedIn(true)
|
||||
c.JsonResult(0, "ok", data)
|
||||
} else {
|
||||
logs.Error("用户登录 =>", err)
|
||||
c.JsonResult(500, "账号或密码错误", nil)
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
//用户注册.
|
||||
// 登录成功后的操作,如重定向到原始请求页面
|
||||
func (c *AccountController) LoggedIn(isPost bool) interface{} {
|
||||
turl := ""
|
||||
value := c.GetSession("turl")
|
||||
if value != nil {
|
||||
turl = value.(string)
|
||||
}
|
||||
c.DelSession("turl")
|
||||
|
||||
beego.Info("AccountController.LoggedIn(): turl is: " + turl)
|
||||
|
||||
if !isPost {
|
||||
// 检查是否存在 turl 参数,如果有则重定向至 turl 处,否则进入 Home 页面
|
||||
if turl == "" {
|
||||
turl = beego.URLFor("HomeController.Index")
|
||||
}
|
||||
c.Redirect(turl, 302)
|
||||
return nil
|
||||
} else {
|
||||
var data struct {
|
||||
TURL string `json:"turl"`
|
||||
}
|
||||
data.TURL = turl
|
||||
return data
|
||||
}
|
||||
}
|
||||
|
||||
// 用户注册
|
||||
func (c *AccountController) Register() {
|
||||
c.TplName = "account/register.tpl"
|
||||
|
||||
@ -112,7 +148,7 @@ func (c *AccountController) Register() {
|
||||
}
|
||||
// 如果开启了验证码
|
||||
if v, ok := c.Option["ENABLED_CAPTCHA"]; ok && strings.EqualFold(v, "true") {
|
||||
v,ok := c.GetSession(conf.CaptchaSessionName).(string);
|
||||
v, ok := c.GetSession(conf.CaptchaSessionName).(string)
|
||||
if !ok || !strings.EqualFold(v, captcha) {
|
||||
c.JsonResult(6001, "验证码不正确")
|
||||
}
|
||||
@ -140,7 +176,7 @@ func (c *AccountController) Register() {
|
||||
}
|
||||
}
|
||||
|
||||
//找回密码.
|
||||
// 找回密码
|
||||
func (c *AccountController) FindPassword() {
|
||||
c.TplName = "account/find_password_setp1.tpl"
|
||||
mail_conf := conf.GetMailConfig()
|
||||
@ -159,7 +195,7 @@ func (c *AccountController) FindPassword() {
|
||||
|
||||
// 如果开启了验证码
|
||||
if v, ok := c.Option["ENABLED_CAPTCHA"]; ok && strings.EqualFold(v, "true") {
|
||||
v,ok := c.GetSession(conf.CaptchaSessionName).(string);
|
||||
v, ok := c.GetSession(conf.CaptchaSessionName).(string)
|
||||
if !ok || !strings.EqualFold(v, captcha) {
|
||||
c.JsonResult(6001, "验证码不正确")
|
||||
}
|
||||
@ -215,7 +251,7 @@ func (c *AccountController) FindPassword() {
|
||||
mail_conf.SmtpHost,
|
||||
)
|
||||
|
||||
mime := "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n";
|
||||
mime := "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
|
||||
subject := "Subject: 找回密码!\n"
|
||||
|
||||
err = smtp.SendMail(
|
||||
@ -230,7 +266,6 @@ func (c *AccountController) FindPassword() {
|
||||
}
|
||||
}(mail_conf, email, body)
|
||||
|
||||
|
||||
c.JsonResult(0, "ok", c.BaseUrl()+beego.URLFor("AccountController.Login"))
|
||||
}
|
||||
|
||||
@ -260,7 +295,7 @@ func (c *AccountController) FindPassword() {
|
||||
}
|
||||
}
|
||||
|
||||
//校验邮件并修改密码.
|
||||
// 校验邮件并修改密码
|
||||
func (c *AccountController) ValidEmail() {
|
||||
c.Prepare()
|
||||
password1 := c.GetString("password1")
|
||||
@ -284,7 +319,7 @@ func (c *AccountController) ValidEmail() {
|
||||
if captcha == "" {
|
||||
c.JsonResult(6004, "验证码不能为空")
|
||||
}
|
||||
v,ok := c.GetSession(conf.CaptchaSessionName).(string);
|
||||
v, ok := c.GetSession(conf.CaptchaSessionName).(string)
|
||||
if !ok || !strings.EqualFold(v, captcha) {
|
||||
c.JsonResult(6001, "验证码不正确")
|
||||
}
|
||||
@ -307,7 +342,7 @@ func (c *AccountController) ValidEmail() {
|
||||
beego.Error(err)
|
||||
c.JsonResult(6005, "用户不存在")
|
||||
}
|
||||
hash ,err := utils.PasswordHash(password1);
|
||||
hash, err := utils.PasswordHash(password1)
|
||||
|
||||
if err != nil {
|
||||
beego.Error(err)
|
||||
@ -328,17 +363,16 @@ func (c *AccountController) ValidEmail() {
|
||||
c.JsonResult(0, "ok", c.BaseUrl()+beego.URLFor("AccountController.Login"))
|
||||
}
|
||||
|
||||
|
||||
// Logout 退出登录.
|
||||
// Logout 退出登录
|
||||
func (c *AccountController) Logout() {
|
||||
c.SetMember(models.Member{});
|
||||
c.SetMember(models.Member{})
|
||||
|
||||
c.SetSecureCookie(conf.GetAppKey(), "login", "", -3600)
|
||||
|
||||
c.Redirect(beego.URLFor("AccountController.Login"), 302)
|
||||
}
|
||||
|
||||
//验证码.
|
||||
// 验证码
|
||||
func (c *AccountController) Captcha() {
|
||||
c.Prepare()
|
||||
|
||||
@ -361,7 +395,6 @@ func (c *AccountController) Captcha() {
|
||||
captchaImage.DrawBorder(gocaptcha.ColorToRGB(0x17A7A7A))
|
||||
// captchaImage.DrawHollowLine()
|
||||
|
||||
|
||||
captchaImage.SaveImage(c.Ctx.ResponseWriter, gocaptcha.ImageFormatJpeg)
|
||||
c.StopRun()
|
||||
}
|
@ -99,6 +99,11 @@ func isUserLoggedIn(c *DocumentController) bool {
|
||||
}
|
||||
|
||||
func promptUserToLogIn(c *DocumentController) {
|
||||
beego.Info("Access " + c.Ctx.Request.URL.RequestURI() + " not permitted.")
|
||||
beego.Info(" Access will be redirected to login page(SessionId: " + c.CruSession.SessionID() + ").")
|
||||
|
||||
c.SetSession("turl", c.Ctx.Request.URL.RequestURI())
|
||||
|
||||
if c.IsAjax() {
|
||||
c.JsonResult(6000, "需要[重]登录。")
|
||||
} else {
|
||||
|
@ -5,7 +5,7 @@ $(function () {
|
||||
height: "100%",
|
||||
path: "/static/editor.md/lib/",
|
||||
toolbar: true,
|
||||
placeholder: "本编辑器支持Markdown编辑,左边编写,右边预览",
|
||||
placeholder: "本编辑器支持 Markdown 编辑,左边编写,右边预览。",
|
||||
imageUpload: true,
|
||||
imageFormats: ["jpg", "jpeg", "gif", "png", "JPG", "JPEG", "GIF", "PNG"],
|
||||
imageUploadURL: window.imageUploadURL,
|
||||
@ -19,6 +19,7 @@ $(function () {
|
||||
tocStartLevel: 1,
|
||||
tocm: true,
|
||||
saveHTMLToTextarea: true,
|
||||
|
||||
onload: function() {
|
||||
this.hideToolbar();
|
||||
var keyMap = {
|
||||
@ -45,6 +46,7 @@ $(function () {
|
||||
loadDocument($select_node);
|
||||
}
|
||||
}
|
||||
|
||||
uploadImage("docEditor", function ($state, $res) {
|
||||
if ($state === "before") {
|
||||
return layer.load(1, {
|
||||
@ -78,7 +80,6 @@ $(function () {
|
||||
$("#documentTemplateModal").modal("show");
|
||||
} else if (name === "sidebar") {
|
||||
$("#manualCategory").toggle(0, "swing", function () {
|
||||
|
||||
var $then = $("#manualEditorContainer");
|
||||
var left = parseInt($then.css("left"));
|
||||
if (left > 0) {
|
||||
@ -94,22 +95,12 @@ $(function () {
|
||||
if ($("#markdown-save").hasClass('change')) {
|
||||
var comfirm_result = confirm("编辑内容未保存,需要保存吗?")
|
||||
if (comfirm_result) {
|
||||
saveDocument();
|
||||
saveDocument(false, releaseBook);
|
||||
return;
|
||||
}
|
||||
}
|
||||
$.ajax({
|
||||
url : window.releaseURL,
|
||||
data :{"identify" : window.book.identify },
|
||||
type : "post",
|
||||
dataType : "json",
|
||||
success : function (res) {
|
||||
if(res.errcode === 0){
|
||||
layer.msg("发布任务已推送到任务队列,稍后将在后台执行。");
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
releaseBook();
|
||||
} else {
|
||||
layer.msg("没有需要发布的文档")
|
||||
}
|
||||
@ -120,8 +111,7 @@ $(function () {
|
||||
|
||||
if (selection === "") {
|
||||
cm.replaceSelection("- [x] " + selection);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
var selectionText = selection.split("\n");
|
||||
|
||||
for (var i = 0, len = selectionText.length; i < len; i++) {
|
||||
@ -185,6 +175,7 @@ $(function () {
|
||||
layer.msg("获取当前文档信息失败");
|
||||
return;
|
||||
}
|
||||
|
||||
var doc_id = parseInt(node.id);
|
||||
|
||||
for (var i in window.documentCategory) {
|
||||
@ -232,8 +223,23 @@ $(function () {
|
||||
});
|
||||
}
|
||||
|
||||
function resetEditor($node) {
|
||||
function releaseBook() {
|
||||
$.ajax({
|
||||
url: window.releaseURL,
|
||||
data: { "identify": window.book.identify },
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
success: function (res) {
|
||||
if (res.errcode === 0) {
|
||||
layer.msg("发布任务已推送到任务队列,稍后将在后台执行。");
|
||||
} else {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function resetEditor($node) {
|
||||
}
|
||||
|
||||
/**
|
||||
@ -248,6 +254,7 @@ $(function () {
|
||||
}
|
||||
window.isLoad = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加顶级文档
|
||||
*/
|
||||
@ -262,13 +269,11 @@ $(function () {
|
||||
},
|
||||
success: function (res) {
|
||||
if (res.errcode === 0) {
|
||||
|
||||
var data = { "id": res.data.doc_id, 'parent': res.data.parent_id === 0 ? '#' : res.data.parent_id , "text": res.data.doc_name, "identify": res.data.identify, "version": res.data.version };
|
||||
|
||||
var node = window.treeCatalog.get_node(data.id);
|
||||
if (node) {
|
||||
window.treeCatalog.rename_node({ "id": data.id }, data.text);
|
||||
|
||||
} else {
|
||||
window.treeCatalog.create_node(data.parent, data);
|
||||
window.treeCatalog.deselect_all();
|
||||
@ -278,7 +283,7 @@ $(function () {
|
||||
$("#markdown-save").removeClass('change').addClass('disabled');
|
||||
$("#addDocumentModal").modal('hide');
|
||||
} else {
|
||||
showError(res.message,"#add-error-message")
|
||||
showError(res.message, "#add-error-message");
|
||||
}
|
||||
$("#btnSaveDocument").button("reset");
|
||||
}
|
||||
@ -311,7 +316,6 @@ $(function () {
|
||||
"label": "添加文档",
|
||||
"icon": "fa fa-plus",
|
||||
"action": function (data) {
|
||||
|
||||
var inst = $.jstree.reference(data.reference),
|
||||
node = inst.get_node(data.reference);
|
||||
|
||||
@ -355,8 +359,8 @@ $(function () {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
loadDocument(selected);
|
||||
|
||||
loadDocument(selected);
|
||||
}).on("move_node.jstree", jstree_save);
|
||||
|
||||
$("#documentTemplateModal").on("click", ".section>a[data-type]", function () {
|
||||
|
176
static/js/splitbar.js
Normal file
176
static/js/splitbar.js
Normal file
@ -0,0 +1,176 @@
|
||||
$(function () {
|
||||
var splitBar = {
|
||||
// 设置当前屏幕为 840px 时将分割条隐藏
|
||||
maxWidth: 840,
|
||||
|
||||
// 父元素选择器
|
||||
parentSelector: '.manual-body',
|
||||
|
||||
/**
|
||||
* 初始化分割条
|
||||
*/
|
||||
init: function () {
|
||||
var self = this;
|
||||
$(self.parentSelector)
|
||||
.append(
|
||||
$('\
|
||||
<div id="manual-vsplitbar" unselectable="on"\
|
||||
style="\
|
||||
z-index:301;\
|
||||
position: absolute;\
|
||||
user-select: none;\
|
||||
cursor: col-resize;\
|
||||
left: 275px;\
|
||||
height: 100%;\
|
||||
display: block;\
|
||||
width: 3px;\
|
||||
border-right: 1px solid #8f949a;">\
|
||||
<a href="javascript:void(0)" accesskey="" tabindex="0" title="vsplitbar"></a>\
|
||||
</div>\
|
||||
')
|
||||
.hover(
|
||||
function (event) {
|
||||
event.target.style.background = '#8f949ad8';
|
||||
},
|
||||
function (event) {
|
||||
event.target.style.background = '';
|
||||
}
|
||||
)
|
||||
);
|
||||
|
||||
self.loadingHtml();
|
||||
|
||||
// 设置媒体查询
|
||||
mediaMatcher.set();
|
||||
},
|
||||
|
||||
/**
|
||||
* 加载页面时设置分割条是否显示
|
||||
*/
|
||||
loadingHtml: function () {
|
||||
var self = this;
|
||||
var htmlWidth = document.body.clientWidth;
|
||||
if (htmlWidth <= self.maxWidth) $('#manual-vsplitbar').css('display', 'none');
|
||||
},
|
||||
|
||||
/**
|
||||
* 在打开关闭菜单事初始化左右窗口和分割条
|
||||
*/
|
||||
reset: function () {
|
||||
if (isFullScreen) {
|
||||
// 关闭菜单时,初始化左右窗口
|
||||
$('#manual-vsplitbar').css('display', 'none');
|
||||
splitBar.inMaxWidthReset();
|
||||
$('.manual-left').css('width', '0px');
|
||||
} else {
|
||||
// 打开菜单时,初始化左右窗口
|
||||
$('#manual-vsplitbar').css('display', 'block');
|
||||
splitBar.outMaxWidthReset();
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 屏幕小于等于 840px,重置左右窗口
|
||||
*/
|
||||
inMaxWidthReset: function () {
|
||||
$('#manual-vsplitbar').css('display', 'none');
|
||||
$('.m-manual.manual-reader .manual-right').css('left', '0');
|
||||
$('.manual-left').css('width', '280px');
|
||||
},
|
||||
|
||||
/**
|
||||
* 屏幕大于 840px,重置左右窗口
|
||||
*/
|
||||
outMaxWidthReset: function () {
|
||||
$('.manual-right').css('left', '279px');
|
||||
$('.manual-left').css('width', '279px');
|
||||
$('#manual-vsplitbar').css('left', '275px').css('display', 'block');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 设置媒体查询
|
||||
* 分割条隐藏
|
||||
*/
|
||||
var mediaMatcher = {
|
||||
mql: window.matchMedia('(max-width:' + splitBar.maxWidth + 'px)'),
|
||||
|
||||
/**
|
||||
* 添加媒体查询监听事件
|
||||
*/
|
||||
set: function () {
|
||||
var self = this;
|
||||
self.mql.addListener(self.mqCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 删除媒体查询监听事件
|
||||
*/
|
||||
remove: function () {
|
||||
var self = this;
|
||||
self.mql.removeListener(self.mqCallback);
|
||||
},
|
||||
|
||||
/**
|
||||
* 媒体查询回调函数
|
||||
*/
|
||||
mqCallback: function (event) {
|
||||
if (event.target.matches) { // 宽度小于等于 840 像素
|
||||
$(".m-manual").removeClass('manual-fullscreen-active');
|
||||
splitBar.inMaxWidthReset();
|
||||
} else { // 宽度大于 840 像素
|
||||
splitBar.outMaxWidthReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 初始化分割条
|
||||
splitBar.init();
|
||||
|
||||
/**
|
||||
* 控制菜单宽度
|
||||
* 最小为 140px
|
||||
*/
|
||||
$('#manual-vsplitbar').on('mousedown', function (e) {
|
||||
var bodyEle = $('.manual-body')[0];
|
||||
|
||||
var leftPane = $('.manual-left')[0];
|
||||
var splitBar = $('#manual-vsplitbar')[0];
|
||||
var rightPane = $('.manual-right')[0];
|
||||
|
||||
var disX = (e || event).clientX;
|
||||
|
||||
splitBar.left = splitBar.offsetLeft;
|
||||
|
||||
var docMouseMove = document.onmousemove;
|
||||
var docMouseUp = document.onmouseup;
|
||||
|
||||
document.onmousemove = function (e) {
|
||||
var curPos = splitBar.left + ((e || event).clientX - disX);
|
||||
var maxPos = bodyEle.clientWidth - splitBar.offsetWidth;
|
||||
|
||||
curPos > maxPos && (curPos = maxPos);
|
||||
curPos < 140 && (curPos = 140);
|
||||
|
||||
leftPane.style.width = curPos + "px";
|
||||
splitBar.style.left = curPos - 3 + "px";
|
||||
rightPane.style.left = curPos + 3 + "px";
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
document.onmouseup = function () {
|
||||
document.onmousemove = docMouseMove;
|
||||
document.onmouseup = docMouseUp;
|
||||
splitBar.releaseCapture && splitBar.releaseCapture();
|
||||
};
|
||||
|
||||
splitBar.setCapture && splitBar.setCapture();
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* 关闭侧边栏时,同步分割条;
|
||||
*/
|
||||
$(".manual-fullscreen-switch").on("click", splitBar.reset);
|
||||
});
|
@ -93,7 +93,7 @@
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$("#account,#passwd,#code").on('focus', function () {
|
||||
$(this).tooltip('destroy').parents('.form-group').removeClass('has-error');;
|
||||
$(this).tooltip('destroy').parents('.form-group').removeClass('has-error');
|
||||
});
|
||||
|
||||
$(document).keydown(function (e) {
|
||||
@ -102,19 +102,20 @@
|
||||
$("#btn-login").click();
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn-login").on('click', function () {
|
||||
var $btn = $(this).button('loading');
|
||||
|
||||
var account = $.trim($("#account").val());
|
||||
var password = $.trim($("#password").val());
|
||||
var code = $("#code").val();
|
||||
|
||||
if (account === "") {
|
||||
$("#account").tooltip({ placement: "auto", title: "账号不能为空", trigger: 'manual' })
|
||||
.tooltip('show')
|
||||
.parents('.form-group').addClass('has-error');
|
||||
$btn.button('reset');
|
||||
return false;
|
||||
|
||||
} else if (password === "") {
|
||||
$("#password").tooltip({ title: '密码不能为空', trigger: 'manual' })
|
||||
.tooltip('show')
|
||||
@ -134,16 +135,18 @@
|
||||
dataType: "json",
|
||||
type: "POST",
|
||||
success: function (res) {
|
||||
|
||||
if (res.errcode !== 0) {
|
||||
$("#captcha-img").click();
|
||||
$("#code").val('');
|
||||
layer.msg(res.message);
|
||||
$btn.button('reset');
|
||||
} else {
|
||||
window.location = "/";
|
||||
turl = res.data.turl;
|
||||
if (turl === "") {
|
||||
turl = "/";
|
||||
}
|
||||
window.location = turl;
|
||||
}
|
||||
|
||||
},
|
||||
error: function () {
|
||||
$("#captcha-img").click();
|
||||
@ -154,7 +157,6 @@
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
@ -230,11 +230,12 @@
|
||||
<script src="{{cdnjs "/static/bootstrap/js/bootstrap.min.js"}}"></script>
|
||||
<script src="{{cdnjs "/static/js/jquery.form.js"}}" type="text/javascript"></script>
|
||||
<script src="{{cdnjs "/static/jstree/3.3.4/jstree.min.js"}}" type="text/javascript"></script>
|
||||
<script type="text/javascript" src="{{cdnjs "/static/nprogress/nprogress.js"}}"></script>
|
||||
<script type="text/javascript" src="{{cdnjs "/static/highlight/highlight.js"}}"></script>
|
||||
<script type="text/javascript" src="{{cdnjs "/static/highlight/highlightjs-line-numbers.min.js"}}"></script>
|
||||
<script type="text/javascript" src="/static/js/jquery.highlight.js"></script>
|
||||
<script type="text/javascript" src="/static/js/kancloud.js"></script>
|
||||
<script src="{{cdnjs "/static/nprogress/nprogress.js"}}" type="text/javascript"></script>
|
||||
<script src="{{cdnjs "/static/highlight/highlight.js"}}" type="text/javascript"></script>
|
||||
<script src="{{cdnjs "/static/highlight/highlightjs-line-numbers.min.js"}}" type="text/javascript"></script>
|
||||
<script src="/static/js/jquery.highlight.js" type="text/javascript"></script>
|
||||
<script src="/static/js/kancloud.js" type="text/javascript"></script>
|
||||
<script src="/static/js/splitbar.js" type="text/javascript"></script>
|
||||
<script type="text/javascript">
|
||||
active_book_id = {{.Model.Identify}};
|
||||
active_doc_id = {{.DocumentId}};
|
||||
|
Loading…
Reference in New Issue
Block a user