mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-06-11 14:17:24 +08:00
优化登陆跳转bug
This commit is contained in:
parent
673c1d36dd
commit
a43a63c884
@ -1,38 +1,37 @@
|
||||
<div id="adminLoginPropertyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div id="adminLoginPropertyModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
|
||||
aria-hidden="true">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<h3 class="m-t-none m-b ">
|
||||
<span><vc:i18n name="密码确认" namespace="adminLoginProperty"></vc:i18n></span>
|
||||
<vc:i18n name="密码确认" namespace="adminLoginProperty"></vc:i18n>
|
||||
</h3>
|
||||
<div class="ibox-content">
|
||||
<div>
|
||||
<div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<span><vc:i18n name="密码" namespace="adminLoginProperty"></vc:i18n></span>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input :placeholder="vc.i18n('必填,请输入当前账号密码','adminLoginProperty')" type="password"
|
||||
class="form-control" v-model="adminLoginPropertyInfo.curPasswd">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="_adminLoginPropertySubmit()">
|
||||
<i class="fa fa-check"></i> 登录
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<span><vc:i18n name="取消" namespace="adminLoginProperty"></vc:i18n></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-2 col-form-label">
|
||||
<vc:i18n name="密码" namespace="adminLoginProperty"></vc:i18n>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<input :placeholder="vc.i18n('必填,请输入当前账号密码','adminLoginProperty')" type="password"
|
||||
class="form-control" v-model="adminLoginPropertyInfo.curPasswd">
|
||||
</div>
|
||||
</div>
|
||||
<div class="ibox-content">
|
||||
<button class="btn btn-primary float-right" type="button"
|
||||
v-on:click="_adminLoginPropertySubmit()">
|
||||
<i class="fa fa-check"></i> 登录
|
||||
</button>
|
||||
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
|
||||
data-dismiss="modal">
|
||||
<span>
|
||||
<vc:i18n name="取消" namespace="adminLoginProperty"></vc:i18n>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<vc:create path="frame/initData"></vc:create>
|
||||
</div>
|
||||
</div>
|
||||
@ -19,7 +19,7 @@
|
||||
methods: {
|
||||
adminLoginPropertyValidate() {
|
||||
return vc.validate.validate({
|
||||
adminLoginPropertyInfo: vc.component.adminLoginPropertyInfo
|
||||
adminLoginPropertyInfo: $that.adminLoginPropertyInfo
|
||||
}, {
|
||||
'adminLoginPropertyInfo.curPasswd': [
|
||||
{
|
||||
@ -31,11 +31,11 @@
|
||||
});
|
||||
},
|
||||
_adminLoginPropertySubmit: function () {
|
||||
if (!vc.component.adminLoginPropertyValidate()) {
|
||||
if (!$that.adminLoginPropertyValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
vc.http.apiPost('/adminLoginPropertyAccount',
|
||||
vc.http.apiPost('/login.adminLoginProperty',
|
||||
JSON.stringify($that.adminLoginPropertyInfo),
|
||||
{
|
||||
emulateJSON: true
|
||||
@ -43,19 +43,18 @@
|
||||
function (json, res) {
|
||||
$that.clearAddBasePrivilegeInfo();
|
||||
$('#adminLoginPropertyModel').modal('hide');
|
||||
let _data = JSON.parse(json);
|
||||
if (_data.hasOwnProperty('code') && _data.code != '0') {
|
||||
vc.toast(_data.msg);
|
||||
return;
|
||||
}
|
||||
if (res.status == 200) {
|
||||
vc.component.clearCacheData();
|
||||
vc.component._loadSysInfo();
|
||||
vc.emit('initData', 'loadCommunityInfo', {
|
||||
url: '/'
|
||||
});
|
||||
let _json = JSON.parse(json);
|
||||
if (_json.code != 0) {
|
||||
vc.toast(_json.msg);
|
||||
return;
|
||||
}
|
||||
let _data = _json.data;
|
||||
$that.clearCacheData();
|
||||
$that._loadSysInfo();
|
||||
vc.emit('initData', 'loadCommunityInfo', {
|
||||
url: '/',
|
||||
loginUsers:_data
|
||||
});
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
@ -63,7 +62,7 @@
|
||||
});
|
||||
},
|
||||
clearAddBasePrivilegeInfo: function () {
|
||||
vc.component.adminLoginPropertyInfo = {
|
||||
$that.adminLoginPropertyInfo = {
|
||||
username: '',
|
||||
userId: '',
|
||||
curPasswd: '',
|
||||
@ -88,18 +87,18 @@
|
||||
if (res.status != 200) {
|
||||
console.log("加载系统信息失败");
|
||||
vc.saveData("_sysInfo", {logo: 'HC'});
|
||||
vc.copyObject(json, vc.component.loginInfo);
|
||||
vc.copyObject(json, $that.loginInfo);
|
||||
return;
|
||||
}
|
||||
vc.copyObject(JSON.parse(json), vc.component.loginInfo);
|
||||
vc.copyObject(JSON.parse(json), $that.loginInfo);
|
||||
//保存到浏览器
|
||||
vc.saveData("_sysInfo", JSON.parse(json));
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.saveData("_sysInfo", {logo: 'HC'});
|
||||
vc.copyObject(json, vc.component.loginInfo);
|
||||
vc.component.loginInfo.errorInfo = errInfo;
|
||||
vc.copyObject(json, $that.loginInfo);
|
||||
$that.loginInfo.errorInfo = errInfo;
|
||||
});
|
||||
},
|
||||
}
|
||||
|
||||
@ -11,13 +11,13 @@
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('initData', 'loadCommunityInfo', function (_param) {
|
||||
$that.loginInfo.loginUsers = _param.loginUsers;
|
||||
$that.loginInfo.pageUrl = _param.url;
|
||||
if ($that.loginInfo.loginUsers.length > 1) {
|
||||
$that.initDataInfo.loginUsers = _param.loginUsers;
|
||||
$that.initDataInfo.pageUrl = _param.url;
|
||||
if ($that.initDataInfo.loginUsers.length > 1) {
|
||||
$that._initOpenModal();
|
||||
return;
|
||||
}
|
||||
$that._initLoginUserInfo($that.loginInfo.loginUsers[0]);
|
||||
$that._initLoginUserInfo($that.initDataInfo.loginUsers[0]);
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
@ -26,7 +26,7 @@
|
||||
content += '<table class="layui-table">';
|
||||
content += '<thead><tr><th>选择</th><th>账号</th><th>隶属</th><th>角色</th></tr></thead>';
|
||||
content += '<tbody>';
|
||||
$that.loginInfo.loginUsers.forEach(function (item) {
|
||||
$that.initDataInfo.loginUsers.forEach(function (item) {
|
||||
content += `<tr>
|
||||
<td><input type="radio" name="selectedItem" value='${JSON.stringify(item)}'></td>
|
||||
<td>${item.userName}(${item.userId})</td>
|
||||
@ -88,11 +88,11 @@
|
||||
vc.toast('运营团队未分配小区,请联系运营团队');
|
||||
return;
|
||||
}
|
||||
vc.jumpToPage($that.loginInfo.pageUrl);
|
||||
vc.jumpToPage($that.initDataInfo.pageUrl);
|
||||
}
|
||||
},
|
||||
function () {
|
||||
vc.jumpToPage($that.loginInfo.pageUrl);
|
||||
vc.jumpToPage($that.initDataInfo.pageUrl);
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
}
|
||||
$that.addSmallWeChatInfo.objId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'smallWeChat.saveSmallWeChat',
|
||||
'/smallWeChat.saveSmallWeChat',
|
||||
JSON.stringify($that.addSmallWeChatInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
|
||||
@ -12,17 +12,17 @@
|
||||
_initEvent:function(){
|
||||
vc.on('deleteSmallWeChat','openDeleteSmallWeChatModal',function(_params){
|
||||
|
||||
vc.component.deleteSmallWeChatInfo = _params;
|
||||
$that.deleteSmallWeChatInfo = _params;
|
||||
$('#deleteSmallWeChatModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteSmallWeChat:function(){
|
||||
vc.component.deleteSmallWeChatInfo.communityId=vc.getCurrentCommunity().communityId;
|
||||
$that.deleteSmallWeChatInfo.communityId=vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'smallWeChat.deleteSmallWeChat',
|
||||
JSON.stringify(vc.component.deleteSmallWeChatInfo),
|
||||
'/smallWeChat.deleteSmallWeChat',
|
||||
JSON.stringify($that.deleteSmallWeChatInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
@ -48,4 +48,4 @@
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
})(window.vc,window.$that);
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
//1000表示改小程序作用于当前小区 否则作用于所有小区
|
||||
$that.editSmallWeChatInfo.objId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'smallWeChat.updateSmallWeChat',
|
||||
'/smallWeChat.updateSmallWeChat',
|
||||
JSON.stringify($that.editSmallWeChatInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user