UtilVar.ts 606 B

1234567891011121314151617181920212223242526272829303132
  1. interface UtilVarType {
  2. baseUrl:string,
  3. code:string|number,
  4. noContentCode:number,
  5. ENC:boolean,//是否进行加密
  6. }
  7. const UtilVar:UtilVarType = {
  8. baseUrl:"",
  9. code:1002, //登陆过期
  10. noContentCode:204, //请求成功但没有内容
  11. ENC:false,
  12. }
  13. const runtimeType:any = {
  14. production: () => {
  15. },
  16. //开发环境
  17. development: () => {
  18. UtilVar.baseUrl= "http://localhost:8181/api"
  19. },
  20. hash:()=>{
  21. }
  22. }
  23. // console.log(import.meta.env)
  24. runtimeType[import.meta.env.MODE]&&runtimeType[import.meta.env.MODE]()
  25. export default UtilVar