Skip to content

Commit a43a63c

Browse files
committed
优化登陆跳转bug
1 parent 673c1d3 commit a43a63c

File tree

6 files changed

+56
-58
lines changed

6 files changed

+56
-58
lines changed
Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,37 @@
1-
<div id="adminLoginPropertyModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel"
2-
aria-hidden="true">
1+
<div id="adminLoginPropertyModel" class="modal fade" role="dialog" aria-labelledby="exampleModalLabel"
2+
aria-hidden="true">
33
<div class="modal-dialog modal-lg">
44
<div class="modal-content">
55
<div class="modal-body">
66
<h3 class="m-t-none m-b ">
7-
<span><vc:i18n name="密码确认" namespace="adminLoginProperty"></vc:i18n></span>
7+
<vc:i18n name="密码确认" namespace="adminLoginProperty"></vc:i18n>
88
</h3>
99
<div class="ibox-content">
10-
<div>
11-
<div>
12-
<div class="form-group row">
13-
<label class="col-sm-2 col-form-label">
14-
<span><vc:i18n name="密码" namespace="adminLoginProperty"></vc:i18n></span>
15-
</label>
16-
<div class="col-sm-10">
17-
<input :placeholder="vc.i18n('必填,请输入当前账号密码','adminLoginProperty')" type="password"
18-
class="form-control" v-model="adminLoginPropertyInfo.curPasswd">
19-
</div>
20-
</div>
21-
<div class="ibox-content">
22-
<button class="btn btn-primary float-right" type="button"
23-
v-on:click="_adminLoginPropertySubmit()">
24-
<i class="fa fa-check"></i>&nbsp;登录
25-
</button>
26-
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
27-
data-dismiss="modal">
28-
<span><vc:i18n name="取消" namespace="adminLoginProperty"></vc:i18n></span>
29-
</button>
30-
</div>
10+
11+
<div class="form-group row">
12+
<label class="col-sm-2 col-form-label">
13+
<vc:i18n name="密码" namespace="adminLoginProperty"></vc:i18n>
14+
</label>
15+
<div class="col-sm-10">
16+
<input :placeholder="vc.i18n('必填,请输入当前账号密码','adminLoginProperty')" type="password"
17+
class="form-control" v-model="adminLoginPropertyInfo.curPasswd">
3118
</div>
3219
</div>
20+
<div class="ibox-content">
21+
<button class="btn btn-primary float-right" type="button"
22+
v-on:click="_adminLoginPropertySubmit()">
23+
<i class="fa fa-check"></i>&nbsp;登录
24+
</button>
25+
<button type="button" class="btn btn-warning float-right" style="margin-right:20px;"
26+
data-dismiss="modal">
27+
<span>
28+
<vc:i18n name="取消" namespace="adminLoginProperty"></vc:i18n>
29+
</span>
30+
</button>
31+
</div>
3332
</div>
3433
</div>
3534
</div>
3635
</div>
3736
<vc:create path="frame/initData"></vc:create>
38-
</div>
37+
</div>

public/components/admin/adminLoginProperty/adminLoginProperty.js

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
methods: {
2020
adminLoginPropertyValidate() {
2121
return vc.validate.validate({
22-
adminLoginPropertyInfo: vc.component.adminLoginPropertyInfo
22+
adminLoginPropertyInfo: $that.adminLoginPropertyInfo
2323
}, {
2424
'adminLoginPropertyInfo.curPasswd': [
2525
{
@@ -31,39 +31,38 @@
3131
});
3232
},
3333
_adminLoginPropertySubmit: function () {
34-
if (!vc.component.adminLoginPropertyValidate()) {
34+
if (!$that.adminLoginPropertyValidate()) {
3535
vc.toast(vc.validate.errInfo);
3636
return;
3737
}
38-
vc.http.apiPost('/adminLoginPropertyAccount',
38+
vc.http.apiPost('/login.adminLoginProperty',
3939
JSON.stringify($that.adminLoginPropertyInfo),
4040
{
4141
emulateJSON: true
4242
},
4343
function (json, res) {
4444
$that.clearAddBasePrivilegeInfo();
4545
$('#adminLoginPropertyModel').modal('hide');
46-
let _data = JSON.parse(json);
47-
if (_data.hasOwnProperty('code') && _data.code != '0') {
48-
vc.toast(_data.msg);
49-
return;
50-
}
51-
if (res.status == 200) {
52-
vc.component.clearCacheData();
53-
vc.component._loadSysInfo();
54-
vc.emit('initData', 'loadCommunityInfo', {
55-
url: '/'
56-
});
46+
let _json = JSON.parse(json);
47+
if (_json.code != 0) {
48+
vc.toast(_json.msg);
5749
return;
5850
}
51+
let _data = _json.data;
52+
$that.clearCacheData();
53+
$that._loadSysInfo();
54+
vc.emit('initData', 'loadCommunityInfo', {
55+
url: '/',
56+
loginUsers:_data
57+
});
5958
},
6059
function (errInfo, error) {
6160
console.log('请求失败处理');
6261
vc.toast(json);
6362
});
6463
},
6564
clearAddBasePrivilegeInfo: function () {
66-
vc.component.adminLoginPropertyInfo = {
65+
$that.adminLoginPropertyInfo = {
6766
username: '',
6867
userId: '',
6968
curPasswd: '',
@@ -88,18 +87,18 @@
8887
if (res.status != 200) {
8988
console.log("加载系统信息失败");
9089
vc.saveData("_sysInfo", {logo: 'HC'});
91-
vc.copyObject(json, vc.component.loginInfo);
90+
vc.copyObject(json, $that.loginInfo);
9291
return;
9392
}
94-
vc.copyObject(JSON.parse(json), vc.component.loginInfo);
93+
vc.copyObject(JSON.parse(json), $that.loginInfo);
9594
//保存到浏览器
9695
vc.saveData("_sysInfo", JSON.parse(json));
9796
},
9897
function (errInfo, error) {
9998
console.log('请求失败处理');
10099
vc.saveData("_sysInfo", {logo: 'HC'});
101-
vc.copyObject(json, vc.component.loginInfo);
102-
vc.component.loginInfo.errorInfo = errInfo;
100+
vc.copyObject(json, $that.loginInfo);
101+
$that.loginInfo.errorInfo = errInfo;
103102
});
104103
},
105104
}

public/components/frame/initData/initData.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111
},
1212
_initEvent: function () {
1313
vc.on('initData', 'loadCommunityInfo', function (_param) {
14-
$that.loginInfo.loginUsers = _param.loginUsers;
15-
$that.loginInfo.pageUrl = _param.url;
16-
if ($that.loginInfo.loginUsers.length > 1) {
14+
$that.initDataInfo.loginUsers = _param.loginUsers;
15+
$that.initDataInfo.pageUrl = _param.url;
16+
if ($that.initDataInfo.loginUsers.length > 1) {
1717
$that._initOpenModal();
1818
return;
1919
}
20-
$that._initLoginUserInfo($that.loginInfo.loginUsers[0]);
20+
$that._initLoginUserInfo($that.initDataInfo.loginUsers[0]);
2121
})
2222
},
2323
methods: {
@@ -26,7 +26,7 @@
2626
content += '<table class="layui-table">';
2727
content += '<thead><tr><th>选择</th><th>账号</th><th>隶属</th><th>角色</th></tr></thead>';
2828
content += '<tbody>';
29-
$that.loginInfo.loginUsers.forEach(function (item) {
29+
$that.initDataInfo.loginUsers.forEach(function (item) {
3030
content += `<tr>
3131
<td><input type="radio" name="selectedItem" value='${JSON.stringify(item)}'></td>
3232
<td>${item.userName}(${item.userId})</td>
@@ -88,11 +88,11 @@
8888
vc.toast('运营团队未分配小区,请联系运营团队');
8989
return;
9090
}
91-
vc.jumpToPage($that.loginInfo.pageUrl);
91+
vc.jumpToPage($that.initDataInfo.pageUrl);
9292
}
9393
},
9494
function () {
95-
vc.jumpToPage($that.loginInfo.pageUrl);
95+
vc.jumpToPage($that.initDataInfo.pageUrl);
9696
}
9797
);
9898
},

public/components/property/addSmallWeChat/addSmallWeChat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@
114114
}
115115
$that.addSmallWeChatInfo.objId = vc.getCurrentCommunity().communityId;
116116
vc.http.apiPost(
117-
'smallWeChat.saveSmallWeChat',
117+
'/smallWeChat.saveSmallWeChat',
118118
JSON.stringify($that.addSmallWeChatInfo), {
119119
emulateJSON: true
120120
},

public/components/property/deleteSmallWeChat/deleteSmallWeChat.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
_initEvent:function(){
1313
vc.on('deleteSmallWeChat','openDeleteSmallWeChatModal',function(_params){
1414

15-
vc.component.deleteSmallWeChatInfo = _params;
15+
$that.deleteSmallWeChatInfo = _params;
1616
$('#deleteSmallWeChatModel').modal('show');
1717

1818
});
1919
},
2020
methods:{
2121
deleteSmallWeChat:function(){
22-
vc.component.deleteSmallWeChatInfo.communityId=vc.getCurrentCommunity().communityId;
22+
$that.deleteSmallWeChatInfo.communityId=vc.getCurrentCommunity().communityId;
2323
vc.http.apiPost(
24-
'smallWeChat.deleteSmallWeChat',
25-
JSON.stringify(vc.component.deleteSmallWeChatInfo),
24+
'/smallWeChat.deleteSmallWeChat',
25+
JSON.stringify($that.deleteSmallWeChatInfo),
2626
{
2727
emulateJSON:true
2828
},
@@ -48,4 +48,4 @@
4848
}
4949
});
5050

51-
})(window.vc,window.vc.component);
51+
})(window.vc,window.$that);

public/components/property/editSmallWeChat/editSmallWeChat.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
//1000表示改小程序作用于当前小区 否则作用于所有小区
100100
$that.editSmallWeChatInfo.objId = vc.getCurrentCommunity().communityId;
101101
vc.http.apiPost(
102-
'smallWeChat.updateSmallWeChat',
102+
'/smallWeChat.updateSmallWeChat',
103103
JSON.stringify($that.editSmallWeChatInfo), {
104104
emulateJSON: true
105105
},

0 commit comments

Comments
 (0)