|
@@ -79,12 +79,13 @@
|
|
|
<el-form :inline="true">
|
|
|
<span
|
|
|
v-for="(item, index) in topLoginRuleList"
|
|
|
- :key="item"
|
|
|
+ :key="index"
|
|
|
style="padding: 0px 15px"
|
|
|
>
|
|
|
<el-form-item :label="'开放' + getTypeTitle(item.type)">
|
|
|
<el-switch
|
|
|
v-model="switchModels[index].allow"
|
|
|
+ @change="updateTopRule(item.type, index)"
|
|
|
active-color="#13ce66"
|
|
|
inactive-color="#ff4949"
|
|
|
></el-switch>
|
|
@@ -338,6 +339,17 @@ export default {
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ updateTopRule(type, index) {
|
|
|
+ let allow = this.switchModels[index].allow;
|
|
|
+ let params = { rootOrgId: -1, type: type, allow: allow };
|
|
|
+ let url = CORE_API + "/sys/xlogin/rule/save";
|
|
|
+ this.$http.post(url, params).then(() => {
|
|
|
+ this.$notify({
|
|
|
+ type: "success",
|
|
|
+ message: "更新成功"
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
doDeleteRule(row) {
|
|
|
this.$confirm("确认删除?", "提示", {
|
|
|
confirmButtonText: "确定",
|