Skip to content

API地址硬编码 #60

@jesHrz

Description

@jesHrz

web2的api地址有两处使用了硬编码

  1. UrlPrefix https://github.com/SDUOJ/sduoj-web2/blob/master/src/Config/constValue.ts#L3
  2. apiAddress https://github.com/SDUOJ/sduoj-web2/blob/master/src/Utils/API/apiAddress.ts#L11-L14

感觉可以这样改:

  1. 目测这两个变量是有相关性的,可以放在同一个文件里
  2. 生产环境可以留空,或者从配置文件中读取(记得最初版本是分别针对development和production各有一个配置文件,然后从对应文件中读,maybe)

但是,实践中全置空似乎会影响gateway的转发

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions