回复 5楼威子的帖子请问具体是删哪里
@if (loginBase64EncryptEnabled)
{
<script src="~/FrameUi/1.0/base64.js" type="text/javascript"></script>
}
<script type="text/javascript">
var formData = { account: "", password: "", code: "", saveCookie: false, verificationCode:"" };
var localStorageKey = "loginInfo40101";
var saveInfo = getLocalStorage(localStorageKey);
if (saveInfo != "") {
formData = JSON.parse(saveInfo);
}
formData.verificationCode = "";
if (self != top) { top.location = self.location; }
function loginSuccess() {
if (formData.saveCookie) {
setLocalStorage(localStorageKey, JSON.stringify(formData));
}
else {
removeLocalStorage(localStorageKey);
}
vue.$message.success("登录成功!")
var loadingInstance = vue.$loading();
location.href = "@(Url.ActionUrl("index","Default"))";
}
var vue= new Vue({
el: "#loginbox",
data: formData,
methods: {
postSubmit: function () {
var _this = this;
var validated = this.validateForm();//基础数据验证
if (!validated) {
return;
}
var postData = deepCopy(formData);
@if (loginBase64EncryptEnabled) {
<text>
//base64编码
postData.account = Base64.encode(postData.account); //Base64.decode解码
postData.password = Base64.encode(postData.password);
</text>
}
this.submit({ url: "@Url.ActionUrl()", data: postData, success: loginSuccess, showFailMsg: false, showSuccessMsg: false, failCallback: failLogin, });
}
},
});
function failLogin(data) {
vue.$message.error(data.Msg);
vue.$refs.verificationCodeImage.change();
}
function init() {
var bgNum = Math.floor(Math.random() * 5 + 1);
var $body = document.querySelector("body");
$body.style.backgroundImage = "url(/Areas/Admin/Css/images/login/" + bgNum + ".jpg?" + Math.random()+")";
}
document.ready(function () {
init()
});
addEvent(window,'keyup',
function (event) {
if (event.keyCode == 13) {
vue.postSubmit();
}
});
</script>