var _avalon$define, _avalon$define2; function _defineProperty(e, t, s) { return t in e ? Object.defineProperty(e, t, { value: s, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = s, e } $(function() { window.__lk = "", $("#sysKeys").val() && (window.__lk = JSON.parse($("#sysKeys").val()), $("#sysKeys").remove()), $("#userLoginOut").click(function() { loginOut() }), $("#gotop").click(function() { return $("body,html").animate({ scrollTop: 0 }, 800), !1 }), $(window).scroll(function(e) { 200 < getScrollTop() ? $("#gotop").css("opacity", 1) : $("#gotop").css("opacity", 0) }) }); var msgTime = 800; function checkIfMobile() { return !!navigator.userAgent.match( /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i ) } function getAjaxData(e) { var t = 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : function() {}, s = 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : "get", n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {}, o = 4 < arguments.length && void 0 !== arguments[4] ? arguments[4] : function() {}; layer.load(2, { shade: [.3, "#000"] }); var a = { url: e, type: s.toLocaleUpperCase(), success: function(e) { layer.closeAll("loading"), 500 === e.status ? (layer.msg(e.message, { icon: 2, shade: [.001, "#000"], zIndex: 999999999, time: msgTime }), o && o()) : 401 === e.status ? layer.confirm(e.message, { title: getSysValueByKey("sys_layer_confirm_title"), btn: getSysValueByKey("sys_layer_confirm_btn_yes"), yes: function(e) { layer.close(e) } }) : t && t(e) }, error: function(e) { layer.closeAll("loading"); var t = e.message || "Server error!"; layer.msg(t, { icon: 2, time: msgTime }) } }; "post" == s ? a = Object.assign({}, a, { data: n }) : (e.indexOf("?"), a.url = e), $.ajax(a) } function getSysValueByKey(e) { return window.__lk ? window.__lk[e] : "" } function loginOut() { layer.confirm(getSysValueByKey("sys_layer_confirm_logOut"), { title: getSysValueByKey("sys_layer_confirm_title"), btn: getSysValueByKey("sys_layer_confirm_btn_yes"), yes: function(e) { layer.close(e), getAjaxData("/api/user/logOut", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }, function() { window.location = "/" }) }) } }) } function watchCreator(e, t) { getAjaxData("/api/user/followCreator?creatorId=" + e, function(e) { 200 == e.status && ($("#" + t).find("i").remove(), $("#" + t).text("宸插叧娉?), $("#" + t).attr("href", "javascript:void(0)")) }) } function reportDocument(e) { getAjaxData("/api/user/report", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime, anim: 1 }) }, "post", { contentId: e, type: 1 < arguments.length && void 0 !== arguments[1] ? arguments[1] : "0" }) } function getScrollTop() { return document.documentElement.scrollTop || window.pageYOffset || document.body.scrollTop } function initCheckModal(e, t, s) { $("#checkIfDo").on("show.bs.modal", function(e) { $(this).find(".modal-msg").text(t) }).on("hide.bs.modal", function(e) {}), $("#checkIfDo").modal("show"), e.confirmDo = function() { $("#checkIfDo").modal("hide"), s() } } function renderParams(e) { var t = ""; for (var s in e) t += "&" + s + "=" + e[s]; return t.substring(1, t.length) } function getQueryString(e) { var t = new RegExp("(^|&)" + e + "=([^&]*)(&|$)"), s = window.location.search.substr(1).match(t); return null != s ? unescape(s[2]) : null } layer.config({ extend: "blue/layer.css", skin: "layui-layer-blue" }), avalon.filters.cutwords = function(e, t) { return e ? e.replace(/[\u0391-\uFFE5]/g, "aa").length > t ? e.substring(0, t) + "..." : e : "" }, avalon.filters.formatDateByType = function(e, t) { var s = ""; return "mini" == t ? s = e.substring(e.length - 8, e.length - 3) : (t = "date") && (s = e.substring(0, 9)), s }, avalon.filters.renderJob = function(e, t) { var s = "", n = []; if (!e) return ""; "industry" == t ? n = personInfoVm.industryArr : "profession" == t ? n = personInfoVm.professionArr : "experience" == t && (n = personInfoVm.experienceArr); var o = !0, a = !1, r = void 0; try { for (var i, m = n[Symbol.iterator](); !(o = (i = m.next()).done); o = !0) { var l = i.value; if (l.value == e) { s = l.text; break } } } catch (e) { a = !0, r = e } finally { try { !o && m.return && m.return() } finally { if (a) throw r } } return s }; var searchVm = avalon.define({ $id: "headerCtr", lsk: [], searchkey: "", message: "", activeSearch: !1, showErr: !1, postArticel: function() { "true" == $("#logined").val() ? window.location.href = "/users/userAddContent" : window.location.href = "/users/login" }, searchMe: function() { searchVm.activeSearch = !searchVm.activeSearch }, searchOpt: function() { searchVm.searchkey ? window.location.href = "/search/" + searchVm.searchkey : layer.msg(getSysValueByKey( "sys_layer_validate_keyword"), { icon: 0, time: msgTime }) }, onKeyUp: function(e) { e && 13 === e.keyCode && searchVm.searchOpt() } }), postArticelVm = avalon.define({ $id: "documentInfo", message: "", showErr: !1 }), _oldValuesOfPersonInfoVM = {}, personInfoVm = avalon.define({ $id: "personInfo", message: "", showErr: !1, industry: "", introduction: "", profession: "1", experience: "1", comments: "", gender: "0", userName: "", userId: "", selected: "1", follow_num: 0, total_despiseNum: 0, total_likeNum: 0, total_reward_num: 0, approveCreatorIndentify: function() { layer.alert(getSysValueByKey("label_system_waitfor_update")) }, industryArr: [], professionArr: [], experienceArr: [], validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { if (e.length) console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), layer.msg(e[0].message, { icon: 2, shade: [.001, "#000"], time: msgTime }); else { console.log("鍏ㄩ儴閫氳繃"); var t = {}; personInfoVm.userName && (t.userName = personInfoVm.userName), personInfoVm.introduction && (t.introduction = personInfoVm.introduction), personInfoVm.gender && (t.gender = personInfoVm.gender), personInfoVm.profession && (t.profession = personInfoVm.profession), personInfoVm.industry && (t.industry = personInfoVm.industry), personInfoVm.experience && (t.experience = personInfoVm.experience), personInfoVm.label_introduction && (t.label_introduction = personInfoVm.label_introduction), personInfoVm.comments && (t.comments = personInfoVm.comments), $(".form_datetime").data("datetimepicker").getDate() && (t.birth = $( ".form_datetime").data("datetimepicker").getDate()), getAjaxData("/api/user/updateInfo", function(e) { 200 == e.status && (layer.msg(e.message, { icon: 1, time: msgTime }), personInfoVm.getUserInfo(personInfoVm.userId)) }, "post", t) } } }, getUserInfo: function(e) { getAjaxData("/api/user/getUserInfoById?id=" + e, function(e) { var t = e.data, s = t.id, n = t.industry, o = t.profession, a = t.experience, r = t.comments, i = t.gender, m = t.userName, l = t.birth, d = t.introduction, g = t.follow_num, c = t.total_despiseNum, u = t.total_likeNum, p = t.total_reward_num; personInfoVm.introduction = d || "", personInfoVm.industry = n || "", personInfoVm.profession = o || "", personInfoVm.experience = a || "", personInfoVm.comments = r || "", personInfoVm.gender = i, personInfoVm.userName = m, personInfoVm.userId = s, personInfoVm.follow_num = g, personInfoVm.total_despiseNum = c, personInfoVm.total_likeNum = u, personInfoVm.total_reward_num = p, l && $(".form_datetime").datetimepicker( "update", l) }) } }); function askContentThu(e) { getAjaxData("/api/user/askContentThumbsUp", function(e) {}) } var rcStaticlVm = avalon.define({ $id: "rcStatic", askLike: function(e, t, s) { var n = $("#thumbs_" + s).text(), o = ($("#reword_" + s).text(), $("#despises_" + s).text()), a = $("#favoriteCommunity_" + s).text(); "1" == t ? getAjaxData("/api/user/askContentThumbsUp?contentId=" + s, function(e) { 200 == e.status && $("#thumbs_" + s).text(Number(n) + 1) }) : "2" == t ? getAjaxData("/api/user/despiseContent?contentId=" + s, function(e) { 200 == e.status && $("#despises_" + s).text(Number(o) + 1) }) : "3" == t ? window.location.href = "/details/" + s + ".html?id=comments" : "4" == t && getAjaxData( "/api/user/favoriteContent?contentId=" + s, function(e) { 200 == e.status && $("#favoriteCommunity_" + s).text(Number(a) + 1) }) } }); function getAppendList() { var t = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : "1"; "1" == t ? (appendNewsVm.loadingState = !0, appendNewsVm.current++) : "2" == t && (appendNewsVm.current = 2, appendNewsVm.pageSize = appendNewsVm.current * appendNewsVm.pageSize); var e = $("#appendType").val(), s = ""; "reCommend" == e ? s = "/api/content/getList?type=1¤t=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize + "&isTop=1" : "hot" == e ? s = "/api/content/getList?type=1¤t=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize + "&sortby=clickNum" : "community" == e ? s = "/api/community/getCommunityContents?current=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize + appendNewsVm.current : "special" == e ? s = "/api/special/getList?current=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize : "search" == e ? s = "/api/content/getList?current=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize + "&searchkey=" + $( "#searchkey").val() : "tag" == e ? s = "/api/content/getList?current=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize + "&tagName=" + $("#tagName").val() : "creatorContents" == e && (s = "/api/content/getList?type=1¤t=" + appendNewsVm.current + "&pageSize=" + appendNewsVm.pageSize), getAjaxData(s, function(e) { "1" == t && (appendNewsVm.loadingState = !1), 0 < e.data.docs.length ? "1" == t ? appendNewsVm.appendDocumentList = appendNewsVm.appendDocumentList.concat(e.data.docs) : "2" == t && (appendNewsVm.appendDocumentList = e.data.docs) : appendNewsVm.current-- }) } var appendNewsVm = avalon.define({ $id: "appendItems", current: 1, pageSize: "", appendDocumentList: [], loadingState: !1, showAuthor: function(e, t, s) { var n = e[t]; return n ? n[s] : "" }, getMoreNews: function() { getAppendList() }, appLike: function(e, t) { "1" == e ? getAjaxData("/api/user/askContentThumbsUp?contentId=" + t, function(e) { 200 == e.status && getAppendList("2") }) : "0" == e ? getAjaxData("/api/user/rewordContent", function(e) { 200 == e.status && getAppendList("2") }, "post", { coins: 10, unit: "MEC", contentId: t }) : "2" == e ? getAjaxData("/api/user/despiseContent?contentId=" + t, function(e) { 200 == e.status && getAppendList("2") }) : "3" == e ? window.location.href = "/details/" + t + ".html?id=comments" : "4" == e && getAjaxData( "/api/user/favoriteContent?contentId=" + t, function(e) { 200 == e.status && getAppendList("2") }) } }), confirmEmailVm = avalon.define({ $id: "confirmEmail", email: "", message: "", showErr: !1, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), confirmEmailVm.showErr = !0, confirmEmailVm.message = e[0].message) : (console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/sentConfirmEmail", function(e) { 200 == e.status ? layer.msg(e.message, { icon: 1, anim: 1, time: msgTime }, function() { window.location.href = "/" }) : (confirmEmailVm.showErr = !0, confirmEmailVm.message = e.message) }, "post", { email: confirmEmailVm.email })) } } }), userTellLoginVm = avalon.define({ $id: "userTellLogin", phoneNum: "", countryCode: "", message: "", showErr: !1, basetime: 120, targetPanel: "1", reset: function() { userTellLoginVm.phoneNum = " ", userTellLoginVm.messageCode = " " }, messageCode: "", lateResendTxt: " s", reSendBtnTxt: getSysValueByKey("label_system_resend"), sendMsgCode: function() { if (120 != userTellLoginVm.basetime) return !1; /^[0-9]*$/.test(userTellLoginVm.phoneNum) ? ($("#get-v-code").prop("disabled", "disabled"), getAjaxData( "/api/user/sendVerificationCode", function(e) { var t = setInterval(function() { $("#get-v-code").html(--userTellLoginVm.basetime + userTellLoginVm.lateResendTxt) }, 1e3); setTimeout(function() { clearInterval(t), $("#get-v-code").removeAttr("disabled"), $("#get-v-code").html( getSysValueByKey("label_system_resend")), userTellLoginVm.basetime = 120 }, 1e3 * userTellLoginVm.basetime) }, "post", { phoneNum: userTellLoginVm.phoneNum, countryCode: userTellLoginVm.countryCode || "86", messageType: "1" })) : layer.open({ content: getSysValueByKey("sys_layer_validate_phoneNum"), skin: "msg", time: 1, anim: !1 }) }, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), layer.msg(e[0].message, { icon: 2, shade: [.001, "#000"], time: msgTime })) : (console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/doLogin", function(e) { 200 == e.status && layer.msg(e.message, _defineProperty({ icon: 1, time: 1 }, "time", msgTime), function() { window.location.href = "/ " }) }, "post", { loginType: "1", phoneNum: userTellLoginVm.phoneNum, messageCode: userTellLoginVm.messageCode, countryCode: userTellLoginVm.countryCode || "86" })) } } }), userPwdLoginVm = avalon.define({ $id: "userPwdLogin", password: "", countryCode: "", phoneNum: "", message: "", showErr: !1, reset: function() { userPwdLoginVm.phoneNum = " ", userPwdLoginVm.password = " " }, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), layer.msg(e[0].message, { icon: 2, shade: [.001, "#000"], time: msgTime })) : (console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/doLogin", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }, function() { window.location.href = "/ " }) }, "post", { loginType: "2", countryCode: userTellLoginVm.countryCode, phoneNum: userPwdLoginVm.phoneNum, password: userPwdLoginVm.password })) } } }), userEmailLoginVm = avalon.define({ $id: "userEmailLogin", email: "", message: "", showErr: !1, targetPanel: "3", reset: function() { userEmailLoginVm.email = " ", userEmailLoginVm.messageCode = " " }, password: "", validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? layer.msg(e[0].message, { icon: 2, shade: [.001, "#000"], time: msgTime }) : (console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/doLogin", function(e) { 200 == e.status && layer.msg(e.message, _defineProperty({ icon: 1, time: 1 }, "time", msgTime), function() { window.location.href = "/ " }) }, "post", { loginType: "3", email: userEmailLoginVm.email, password: userEmailLoginVm.password })) } } }); function getPostMessages() { getAjaxData("/api/contentMessage/getMessages?pageSize=100&contentId=" + $("#contentId").val(), function(e) { 200 == e.status && (postMsgVm.messageList = e.data.docs) }) } var postMsgVm = avalon.define({ $id: "postMessage", content: "", logined: !1, message: "", showErr: !1, messageList: [], replyState: !1, relationMsgId: "", replyAuthor: "", adminReplyAuthor: "", praise_num: 0, despises_num: 0, getAuthor: function(e, t, s) { if (e) { var n = e[t]; return n ? n : e[s] ? e[s] : "" } return "" }, reSetData: function() { postMsgVm.content = "", postMsgVm.relationMsgId = "", postMsgVm.replyAuthor = "", postMsgVm.adminReplyAuthor = "", postMsgVm.showErr = !1, postMsgVm.message = "" }, reply: function(e, t, s) { e && t && (postMsgVm.reSetData(), postMsgVm.replyState = !0, postMsgVm.relationMsgId = e, "0" == s ? postMsgVm.replyAuthor = t._id : postMsgVm.adminReplyAuthor = t._id, $("#msgSendBox").appendTo($( "#msglist_" + e))) }, cancelReply: function() { postMsgVm.reSetData(), postMsgVm.replyState = !1, $("#postMessage").prepend($("#msgSendBox")) }, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (postMsgVm.showErr = !0, postMsgVm.message = e[0].message) : (console.log("鍏ㄩ儴閫氳繃"), "true" == $( "#logined").val() ? getAjaxData("/api/contentMessage/postMessages", function(e) { 200 == e.status && ($("#postMessage").prepend($("#msgSendBox")), postMsgVm.reSetData(), getPostMessages()) }, "post", { contentId: $("#contentId").val(), replyAuthor: postMsgVm.replyAuthor, adminReplyAuthor: postMsgVm.adminReplyAuthor, relationMsgId: postMsgVm.relationMsgId, content: postMsgVm.content }) : window.location.href = "/users/login") } } }); function getUserRelevantList(e, t, s) { var n = 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : {}, o = ""; n && (o = renderParams(n)), getAjaxData("/api" + e + "?current=" + s + "&" + o, function(e) { 200 == e.status && ("myContents" == t ? (myContentsVm.myContentList = e.data.docs, myContentsVm.contentTotalPage = e.data.pageInfo.totalPage) : "myMessages" == t ? (myContentsVm.myMessageList = e.data.docs, myContentsVm.messageTotalPage = e.data.pageInfo.totalPage) : "myJoinTopics" == t && (myContentsVm.myJoinTopicsList = e.data.docs, myContentsVm.joinTopicsTotalPage = e.data.pageInfo.totalPage)) }) } var myContentsVm = avalon.define({ $id: "my-contents", myContentList: [], myMessageList: [], myJoinTopicsList: [], contentTotalPage: 1, messageTotalPage: 1, joinTopicsTotalPage: 1, contentPageClick: function(e, t) { getUserRelevantList("/content/getUserContents", "myContents", t, { userId: $("#userId").val(), listState: "all" }) }, messagePageClick: function(e, t) { getUserRelevantList("/systemNotify/getUserNotifys", "myMessages", t, { userId: $("#userId").val() }) }, joinTopicPageClick: function(e, t) { getUserRelevantList("/contentMessage/getMessages", "myJoinTopics", t, { userId: $("#userId").val() }) }, showMessageDetails: function(e, t) { e.preventDefault(); var s = e.target; $(s).toggleClass("fa-angle-down"), $(s).parent().next().toggleClass("show"), t.isRead || getAjaxData( "/api/systemNotify/setNoticeRead?ids=" + t.id, function(e) { 200 == e.status && getUserRelevantList("/systemNotify/getUserNotifys", "myMessages", 1) }) }, deleteNotify: function(t) { layer.confirm(getSysValueByKey("sys_layer_confirm_delete"), { title: getSysValueByKey("sys_layer_confirm_title"), btn: getSysValueByKey("sys_layer_confirm_btn_yes"), yes: function(e) { layer.close(e), getAjaxData("/api/systemNotify/delUserNotify?ids=" + t, function(e) { 200 == e.status && layer.msg(getSysValueByKey("sys_layer_option_success"), { icon: 1 }, function() { getUserRelevantList("/systemNotify/getUserNotifys", "myMessages", 1) }) }) } }) } }), regVm = avalon.define({ $id: "regAction", regType: "2", userName: "", phoneNum: "", email: "", password: "", countryCode: "", message: "", showErr: !1, basetime: 120, targetPanel: "1", reset: function() { regVm.userName = "", regVm.email = "", regVm.phoneNum = "", regVm.messageCode = "", regVm.password = "" }, messageCode: "", lateResendTxt: " s", reSendBtnTxt: getSysValueByKey("label_system_resend"), mytask: "", clearSmsBtn: function() { regVm.task && (clearInterval(regVm.mytask), $("#vCodeBtn").removeAttr("disabled"), $("#vCodeBtn").html( getSysValueByKey("label_system_resend")), regVm.basetime = 120), regVm.reset() }, sendMsgCode: function() { if (120 != regVm.basetime) return !1; if ("1" == regVm.regType) { if (!/^[0-9]*$/.test(regVm.phoneNum)) return layer.open({ content: getSysValueByKey("sys_layer_validate_phoneNum"), skin: "msg" }), !1 } else if ("2" == regVm.regType && ! /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(regVm.email)) return layer .open({ content: getSysValueByKey("sys_layer_validate_email"), skin: "msg" }), !1; if (!regVm.password) return layer.open({ content: getSysValueByKey("sys_layer_validate_password"), skin: "msg" }), !1; $(".vCodeBtn").prop("disabled", "disabled"); var e = { messageType: "0", sendType: regVm.regType }; "1" == regVm.regType ? (e.phoneNum = regVm.phoneNum, e.countryCode = regVm.countryCode || "86") : "2" == regVm.regType && (e.email = regVm.email), getAjaxData("/api/user/sendVerificationCode", function(e) { layer.msg("宸插彂閫侀獙璇佺爜", { icon: 1, time: msgTime }), regVm.mytask = setInterval(function() { $(".vCodeBtn").html(--regVm.basetime + regVm.lateResendTxt) }, 1e3), setTimeout(function() { clearInterval(regVm.mytask), $(".vCodeBtn").removeAttr("disabled"), $(".vCodeBtn").html( getSysValueByKey("label_system_resend")), regVm.basetime = 120 }, 1e3 * regVm.basetime) }, "post", e) }, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { if (e.length) console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), layer.msg(e[0].message, { icon: 2, shade: [.001, "#000"], time: msgTime }); else { console.log("鍏ㄩ儴閫氳繃"); var t = { regType: regVm.regType, password: regVm.password, messageCode: regVm.messageCode }; "1" == regVm.regType ? (t.phoneNum = regVm.phoneNum, t.countryCode = regVm.countryCode || "86") : "2" == regVm.regType && (t.email = regVm.email, t.userName = regVm.userName), getAjaxData("/api/user/doReg", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }, function() { window.location.href = "/users/login" }) }, "post", t, function() { regVm.clearSmsBtn() }) } } } }), getBackPsdVm = avalon.define({ $id: "getBackPsd", password: "", confirmPassword: "", message: "", showErr: !1, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), getBackPsdVm.showErr = !0, getBackPsdVm.message = e[0].message) : ( console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/updateNewPsd", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1 }, function() { window.location.href = "/users/login" }) }, "post", { tokenId: $("#tokenId").val(), confirmPassword: getBackPsdVm.confirmPassword, password: getBackPsdVm.password })) } } }), reSetPsdVm = avalon.define((_defineProperty(_avalon$define = { $id: "reSetPsd", password: "", confirmPassword: "", phoneNum: "", countryCode: "", messageCode: "", message: "", showErr: !1, basetime: 120, targetPanel: "1", reset: function() { reSetPsdVm.phoneNum = " ", reSetPsdVm.messageCode = " " } }, "messageCode", ""), _defineProperty(_avalon$define, "lateResendTxt", " s"), _defineProperty(_avalon$define, "reSendBtnTxt", getSysValueByKey("label_system_resend")), _defineProperty(_avalon$define, "sendMsgCode", function() { if (120 != reSetPsdVm.basetime) return !1; /^[0-9]*$/.test(reSetPsdVm.phoneNum) ? ($("#get-v-code").prop("disabled", "disabled"), getAjaxData( "/api/user/sendVerificationCode", function() { var e = setInterval(function() { $("#get-v-code").html(--reSetPsdVm.basetime + reSetPsdVm.lateResendTxt) }, 1e3); setTimeout(function() { clearInterval(e), $("#get-v-code").removeAttr("disabled"), $("#get-v-code").html( getSysValueByKey("label_system_resend")), reSetPsdVm.basetime = 120 }, 1e3 * reSetPsdVm.basetime) }, "post", { phoneNum: reSetPsdVm.phoneNum, countryCode: reSetPsdVm.countryCode || "86", messageType: "3" })) : layer.msg(getSysValueByKey("sys_layer_validate_phoneNum"), { icon: 1, time: msgTime }) }), _defineProperty(_avalon$define, "validate", { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), reSetPsdVm.showErr = !0, reSetPsdVm.message = e[0].message) : ( console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/resetPassword", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }, function() { window.location.href = "/ " }) }, "post", { password: reSetPsdVm.password, confirmPassword: reSetPsdVm.confirmPassword, phoneNum: reSetPsdVm.phoneNum, messageCode: reSetPsdVm.messageCode, countryCode: reSetPsdVm.countryCode || "86" })) } }), _avalon$define)), reSetPsdByEmailVm = avalon.define((_defineProperty(_avalon$define2 = { $id: "reSetPsdByEmail", password: "", confirmPassword: "", email: "", messageCode: "", message: "", showErr: !1, basetime: 120, targetPanel: "1", reset: function() { reSetPsdByEmailVm.email = " " } }, "messageCode", ""), _defineProperty(_avalon$define2, "lateResendTxt", " s"), _defineProperty(_avalon$define2, "reSendBtnTxt", getSysValueByKey("label_system_resend")), _defineProperty(_avalon$define2, "sendMsgCode", function() { return 120 == reSetPsdByEmailVm.basetime && ( /^[a-z0-9]+([._\\-]*[a-z0-9])*@([a-z0-9]+[-a-z0-9]*[a-z0-9]+.){1,63}[a-z0-9]+$/.test(reSetPsdByEmailVm.email) ? ($("#get-v-code").prop("disabled", "disabled"), void getAjaxData("/api/user/sendVerificationCode", function() { var e = setInterval(function() { $("#get-v-code").html(--reSetPsdByEmailVm.basetime + reSetPsdByEmailVm.lateResendTxt) }, 1e3); setTimeout(function() { clearInterval(e), $("#get-v-code").removeAttr("disabled"), $("#get-v-code").html( getSysValueByKey("label_system_resend")), reSetPsdByEmailVm.basetime = 120 }, 1e3 * reSetPsdByEmailVm.basetime) }, "post", { email: reSetPsdByEmailVm.email, sendType: "2", messageType: "3" })) : (layer.msg(getSysValueByKey("sys_layer_validate_email"), { icon: 1, time: msgTime }), !1)) }), _defineProperty(_avalon$define2, "validate", { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), reSetPsdByEmailVm.showErr = !0, reSetPsdByEmailVm.message = e[0].message) : (console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/resetPassword", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }, function() { window.location.href = "/ " }) }, "post", { password: reSetPsdByEmailVm.password, confirmPassword: reSetPsdByEmailVm.confirmPassword, email: reSetPsdByEmailVm.email, messageCode: reSetPsdByEmailVm.messageCode, type: "2" })) } }), _avalon$define2)), setPsdVm = avalon.define({ $id: "setPsd", password: "", confirmPassword: "", message: "", showErr: !1, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), setPsdVm.showErr = !0, setPsdVm.message = e[0].message) : (console.log( "鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/updateInfo", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1, time: msgTime }) }, "post", { confirmPassword: setPsdVm.confirmPassword, password: setPsdVm.password })) } } }), userInfoVm = avalon.define({ $id: "user-info", userName: "", name: "", email: "", comments: "", phoneNum: "", message: "", showErr: !1, validate: { onError: function(e) { e.forEach(function(e) { console.log(e.getMessage()) }) }, onValidateAll: function(e) { e.length ? (console.log("鏈夎〃鍗曟病鏈夐€氳繃", e), userInfoVm.showErr = !0, userInfoVm.message = e[0].message) : ( console.log("鍏ㄩ儴閫氳繃"), getAjaxData("/api/user/updateInfo", function(e) { 200 == e.status && layer.msg(e.message, { icon: 1 }) }, "post", { userName: userInfoVm.userName, email: userInfoVm.email, name: userInfoVm.name, phoneNum: userInfoVm.phoneNum, comments: userInfoVm.comments })) } } }), userNavVm = avalon.define({ $id: "user-nav", currentPath: window.location.pathname });