chore: 🤖 [frontend-gray]优化关于处理index page 处理逻辑 (#1345)

Co-authored-by: Kent Dong <ch3cho@qq.com>
This commit is contained in:
mamba
2024-09-26 09:16:00 +08:00
committed by GitHub
parent 8293042c25
commit af4e34b7ed
3 changed files with 45 additions and 44 deletions

View File

@@ -130,7 +130,7 @@ grayDeployments:
- name: beta-user
version: gray
enabled: true
weight: 80
weight: 80
```
总的灰度规则为100%,其中灰度版本的权重为`80%`,基线版本为`20%`。一旦用户命中了灰度规则会根据IP固定这个用户的灰度版本否则会在下次请求时随机选择一个灰度版本
@@ -229,16 +229,16 @@ grayDeployments:
- name: beta-user
version: gray
enabled: true
weight: 80
weight: 80
injection:
head:
- <script>console.log('Header')</script>
body:
first:
- <script>console.log('hello world before')</script>
- <script>console.log('hello world before1')</script>
last:
- <script>console.log('hello world after')</script>
- <script>console.log('hello world after2')</script>
head:
- <script>console.log('Header')</script>
body:
first:
- <script>console.log('hello world before')</script>
- <script>console.log('hello world before1')</script>
last:
- <script>console.log('hello world after')</script>
- <script>console.log('hello world after2')</script>
```
通过 `injection`往HTML首页注入代码可以在`head`标签注入代码,也可以在`body`标签的`first``last`位置注入代码。