Giter Site home page Giter Site logo

多应用多域名 about thinkphp-apidoc HOT 3 CLOSED

hgthecode avatar hgthecode commented on August 22, 2024
多应用多域名

from thinkphp-apidoc.

Comments (3)

HGthecode avatar HGthecode commented on August 22, 2024

你好,请问你多应用多域名的项目,是要处理哪方面的问题?url自动生成的规则还是apidoc页面无法正常读取接口?

from thinkphp-apidoc.

nimageji8 avatar nimageji8 commented on August 22, 2024

你好,请问你多应用多域名的项目,是要处理哪方面的问题?url自动生成的规则还是apidoc页面无法正常读取接口?

比如后台模块和前端模块分别绑定了不同的域名,但是请求用了相同的host

from thinkphp-apidoc.

HGthecode avatar HGthecode commented on August 22, 2024

你好,可升级到最新版本,支持以下两种场景:

1、访问 http://域名/apidoc/页面 与 api接口项目不是同一个域名,可参考文档前端配置-hosts

比如

// /public/apidoc/config.js

// 请求配置
HTTP: {
   // 多个可切换的host
   HOSTS: [
     {
        title: "api",
        host: "http://dev.apidoc.com",
     },
   ],
},

2、多应用绑定多个子域名,需要调试接口时分别请求对应域名的接口。可为apps中指定应用配置host来指定应用调试时请求的域名。

// config/apidoc.php
// 多应用/多版本配置(重要)
'apps'           => [
   [
        'title'=>'应用名称',
        'path'=>'app\admin\controller',
        'folder'=>'admin',
        'host'=>'http://abc.com',  
   ]
]
...

from thinkphp-apidoc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.