Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

分流组件,调整规则顺序,不同选择器的规则会串掉 #221

Open
dentonliu opened this issue Oct 1, 2018 · 3 comments
Open
Labels

Comments

@dentonliu
Copy link

针对Orange使用的提问, 对于简单几句话描述不清的问题, 请使用以下格式, 不符合格式或描述含糊不清的issue将不予回复。

需求或场景

调整规则排序

使用的插件

divide

具体的配置

没有做特别的配置,只是调整规则的顺序

期望的结果

顺序可以正常保存

错误的结果

顺序正常保存了,但是规则串了,不同的选择的规则穿了,第一个选择器有1个规则,第二个有四五个,保存后,第一个选择器的规则变成了第二个选择器的最后一个规则了,有时候是相反的

@wujunze
Copy link
Collaborator

wujunze commented Mar 14, 2019

有配置示例吗

@wujunze
Copy link
Collaborator

wujunze commented Apr 1, 2019

有个最小化的示例吗 @dentonliu

@dentonliu
Copy link
Author

这个可以吗

{
    "enable": true,
    "selectors": {
        "f534e718-053b-4099-bcc9-dc44fd14faa0": {
            "time": "2018-08-22 18:11:27",
            "enable": true,
            "type": 1,
            "id": "f534e718-053b-4099-bcc9-dc44fd14faa0",
            "judge": {
                "type": 0,
                "conditions": [
                    {
                        "value": "^/v[1-3]/.*",
                        "operator": "match",
                        "type": "URI"
                    }
                ]
            },
            "name": "v1-v3",
            "handle": {
                "continue": true,
                "log": true
            },
            "rules": [
                "43c3a5ca-177b-4e7a-8bfd-551bbeb0250c"
            ]
        },
        "830c137c-49c4-4f9f-b2cc-b80fa1db2b0d": {
            "time": "2018-08-22 18:11:38",
            "enable": true,
            "type": 1,
            "id": "830c137c-49c4-4f9f-b2cc-b80fa1db2b0d",
            "judge": {
                "type": 0,
                "conditions": [
                    {
                        "value": "^/v4/.*",
                        "operator": "match",
                        "type": "URI"
                    }
                ]
            },
            "name": "v4",
            "handle": {
                "continue": true,
                "log": true
            },
            "rules": [
                "5d4b9eb5-40aa-4dd6-b451-c9278e9427ac",
                "37a1a73c-c17e-455e-be7f-1bb1290dcd3a",
                "e69c7beb-2455-448a-a57e-8c4038272950",
                "cd0ea21d-5e94-42c6-a1a1-393533aa7e75",
                "344f3613-0daf-4a5f-9cb6-f26795521a65",
                "143f3c27-89cb-4f4e-ae19-7a3dd334aca3",
                "11f97bea-450d-4f14-86c3-ecaeaa4ce213",
                "a9ab9e75-4e9b-4a26-9dd4-225562e058ba",
                "31c19a3f-6ad1-4f1f-add3-78fdcbe64866",
                "7ebb730f-b2b2-478e-ba52-765072b80c10",
                "7cf7b560-3b43-49ab-a573-dd4441526bea",
                "9ece76df-4806-4a49-acd6-374dd1b401bd",
                "a99cc01e-d786-4326-8b0a-eec11788c5b7"
            ]
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants