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

Fixes #3606 #3609

Merged
merged 3 commits into from
Apr 1, 2021
Merged

Fixes #3606 #3609

merged 3 commits into from
Apr 1, 2021

Conversation

loadingspace
Copy link
Contributor

@loadingspace loadingspace commented Mar 18, 2021

What's the purpose of this PR

用来解决portal未启用auth并且配置了context-path后导致的, 访问首页部分资源加载404问题

Which issue(s) this PR fixes:

Fixes #3606

Brief changelog

  1. portal - app.html 中 lodash.min.js 引用路径修改
  2. index.html 中 加入获取prefixPath逻辑

Follow this checklist to help us incorporate your contribution quickly and easily:

  • Read the Contributing Guide before making this pull request.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit tests to verify the code.
  • Run mvn clean test to make sure this pull request doesn't break anything.

@@ -124,6 +124,20 @@ <h5 ng-bind="app.name"></h5>
<!-- bootstrap.js -->
<script src="vendor/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>

<script type="application/javascript">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about we use the same code as that in login.html?

    <script type="application/javascript">
        $(function () {
            $.get("prefix-path", function (result) {
                window.localStorage.setItem("prefixPath", result);
            });
        });
    </script>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

异步会有加载先后顺序问题,导致prefix-path还未获取,就已经开始加载需要前缀的资源了,从而引起了404问题

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

login.html中的这段代码是否也要做同样的修改?

    <script type="application/javascript">
        $(function () {
            $.get("prefix-path", function (result) {
                window.localStorage.setItem("prefixPath", result);
            });
        });
    </script>

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试了一下,的确也有上述异步加载问题(会导致zh-CN.json文件404)。又补充提交了 login.html 的修改

Copy link
Member

@nobodyiam nobodyiam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@nobodyiam nobodyiam merged commit 3de1d72 into apolloconfig:master Apr 1, 2021
@nobodyiam nobodyiam added this to the 1.9.0 milestone May 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1.8.1版本未开启auth并且配置了context-path后访问portal后台页面,部分资源加载404
2 participants