鍍金池/ 問(wèn)答/ Linux問(wèn)答
瘋子范 回答

你可以把控制臺(tái)的錯(cuò)誤也貼出來(lái)。
如果控制臺(tái)出現(xiàn)這:net::ERR_CONNECTION_REFUSED就是服務(wù)沒(méi)啟動(dòng),或者是后臺(tái)打斷點(diǎn)了。
要么就是前端在請(qǐng)求的headers里面加了參數(shù),你沒(méi)去解析。

短嘆 回答

容器里的/var/tmp/dpts/ 路徑是否-v 映射到了服務(wù)器路徑上?
我的代碼都是-v映射到docker中的,方便修改和提交,無(wú)需每次都build image,數(shù)據(jù)當(dāng)然也是從外面映射的,下載正常,沒(méi)遇到過(guò)你的情況。

不二心 回答

你可以用curl -vvv測(cè)一下看有什么問(wèn)題

$ curl -vvv https://120.30.30.108:8443/sendData  -X POST
*   Trying 120.30.30.108...
* TCP_NODELAY set
* Connection failed
* connect to 120.30.30.108 port 8443 failed: Operation timed out
* Failed to connect to 120.30.30.108 port 8443: Operation timed out
* Closing connection 0
curl: (7) Failed to connect to 120.30.30.108 port 8443: Operation timed out
尐懶貓 回答

(?=)只是匹配一個(gè)位置

我以為 回答

clipboard.png
初始化成功,問(wèn)題已經(jīng)解決
分析原因,如下:

可以看到我全部是YES!!
clipboard.png
經(jīng)過(guò)別人的告知,于是

clipboard.png
截圖最后一項(xiàng)是代碼規(guī)范,建議不要使用,后面的全no
最終成功:

clipboard.png
同時(shí)注意:
一定要進(jìn)入到你創(chuàng)建的my-vue-app下
才執(zhí)行命令cnpm run dev來(lái)啟動(dòng)項(xiàng)目:

clipboard.png

孤慣 回答

你寫(xiě)的沒(méi)看出來(lái)問(wèn)題啊,我懷疑你服務(wù)器的時(shí)間是不是沒(méi)到23號(hào),在終端執(zhí)行date,我猜你服務(wù)器時(shí)間可能是utc時(shí)間?

參考這個(gè)https://www.cnblogs.com/qhlbl...
'D' 是+1天,改成when='MIDNIGHT'是你想要的效果

雨蝶 回答

從log中 , 你用的可能是predis擴(kuò)展 .
剩余我只能靠猜測(cè) , 根據(jù)log看 , 應(yīng)該是你的php在連接redis的時(shí)候出問(wèn)題了 .
所以 , 我大概提幾個(gè)點(diǎn) , 你檢查下 , 或許有幫助 .

  1. 檢查redis服務(wù)狀態(tài) , 是否啟動(dòng)

  2. 檢查redis的host地址 和 監(jiān)聽(tīng)的port , 是不是如圖中所示

  3. 最后 , 如果1和2都沒(méi)問(wèn)題 , 檢查一下防火墻配置 , 除此之外 , 如果你用的云服務(wù)器 , 檢查一下云服務(wù)廠商的Web控制臺(tái)提供的安全策略組中該port的開(kāi)放權(quán)限 .

久礙你 回答

mac下用lsof

lsof -nPi | grep 9501
lsof -nP -iTCP -sTCP:LISTEN | grep 9501
安于心 回答

你提供信息太少了,代碼都不貼。
可能是https的證書(shū)驗(yàn)證問(wèn)題。

薄荷綠 回答

去掉中間的$uri/,你又沒(méi)配置/的情況。

server {
    listen       9980;
    server_name  mobile.test.icl.com;
    root /home/dev/it-cloud-lab;

    # 移動(dòng)端
    location /mobile {
       try_files $uri /www-mobile-client-phone/dist/index.html;
    }

    # ipad端
    location  /ipad {
       try_files $uri /www-mobile-client-ipad/dist/index.html;
    }
}
好難瘦 回答

@戦場(chǎng)原禮亜_Error302 的這個(gè) map 比較靠譜
個(gè)人感覺(jué)應(yīng)該是你手動(dòng)讓數(shù)據(jù)格式兼容組件,而不是讓組件去兼容數(shù)據(jù)格式
因?yàn)閿?shù)據(jù)的格式總是在變,組件對(duì)數(shù)據(jù)的展示效果是不變的:

    <vfortemp :data='items1'></vfortemp>
    <vfortemp :data='items2.map(i => i.data)'></vfortemp>
笨小蛋 回答

IIS 好像也有 Url Rewrite插件的,不過(guò)好像要另外安裝,你baidu一下,IIS已經(jīng)萬(wàn)年沒(méi)用了,上次用IIS的時(shí)候我還在寫(xiě)asp

墨沫 回答

前后端分離指的是前端一臺(tái)單獨(dú)的web服務(wù)器,后端一臺(tái)單獨(dú)的web服務(wù)器,可以是不同的物理服務(wù)器,也可以在同一臺(tái)物理服務(wù)器上,但是配置兩個(gè)不同的nginx主機(jī),或者甚至在同一個(gè)nginx主機(jī)上,但是至少要有不同的路徑進(jìn)行區(qū)隔。比如說(shuō)https://www.example.com/frontend是前端的服務(wù)路徑,https://www.example.com/backend是后端的服務(wù)路徑,如果都放在frontend里也可以,但至少要讓nginx知道它需要把哪些東西反向代理給tomcat,同一個(gè)路徑同一個(gè)文件,既讓它走前端,又讓它反向代理給tomcat,這是不可能的。

舉例來(lái)說(shuō):

server {
    listen 80;
    server_name www.example.com;

    root /Users/zhangjing/Projects/example.com/dist;

    location / {
        index index.html;
    }

    location /backend/ {
        proxy_pass http://127.0.0.1:8080;
    }
}

在這里,/被指向了dist目錄,提供前端服務(wù),/backend被反向代理到本機(jī)的8080端口,提供后端服務(wù)。只有這樣做才能正確地分離開(kāi)前后端,否則把前后端混在一起是沒(méi)有辦法提供服務(wù)的。

柒槿年 回答

docker需要管理員權(quán)限讀寫(xiě)一部分系統(tǒng)文件

傲寒 回答

剛開(kāi)始建議使用一個(gè)帶桌面的,比如gnome方式

司令 回答

裝個(gè)正式版本試試,別用beta

我不懂 回答

第一種方法

試過(guò)在module1-service中添加自定義datasource(只支持properties,Yml可能能實(shí)現(xiàn),但還不太會(huì)寫(xiě)),可以實(shí)現(xiàn)(此種方式不清楚是否會(huì)影響原來(lái)spring datasource機(jī)制,對(duì)spring原理不熟)
代碼如下:

@Component
@ConfigurationProperties(prefix = "spring.datasource")
@PropertySource("classpath:service-jdbc.properties")
public class MyDataSourceProperties {
    private String url;
    ...
}
@EnableConfigurationProperties(MyDataSourceProperties.class)
public class MyDataSourceConfig {
    @Autowired
    private MyDataSourceProperties myDataSourceProperties;
    @Bean
    @Primary
    public DataSource dataSource() {
        return DataSourceBuilder.create(myDataSourceProperties.getClassLoader()).type(myDataSourceProperties.getType()).driverClassName(myDataSourceProperties.determineDriverClassName()).url(myDataSourceProperties.determineUrl()).username(myDataSourceProperties.determineUsername()).password(myDataSourceProperties.determinePassword()).build();
    }
}

完整代碼:https://gitee.com/soft_xiang/...

第二種方法

在module1-service中自定義properties bean(此種方法較好,推薦),代碼如下

@Configuration
public class ServiceConfig {
    @Bean
    public static PropertySourcesPlaceholderConfigurer properties() {
        PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
        YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
        yaml.setResources(new ClassPathResource("application-module1-service.yml"));
        configurer.setProperties(yaml.getObject());
        return configurer;
    }
}

由第二種用法引起的新的問(wèn)題:

項(xiàng)目中如果存在多環(huán)境配置文件,如application-module1-service-dev.yml/application-module1-service-test.yml/application-module1-service/-release.yml時(shí),怎樣根據(jù)module1-web中配置的spring.profiles.active加載對(duì)應(yīng)的配置文件?
思路為在加載文件時(shí)使用SpringContextUtil獲取配置文件中的active,在properties()中根據(jù)active加載文件
代碼如下:

SpringContextUtil.java

@Order(Integer.MIN_VALUE)
@Component
public class SpringContextUtil implements ApplicationContextAware {

    private static ApplicationContext context = null;
    @Override
    public void setApplicationContext(ApplicationContext applicationContext)
            throws BeansException {
        this.context = applicationContext;
    }
    /// 獲取當(dāng)前環(huán)境
    public static String getActiveProfile() {
        return context.getEnvironment().getActiveProfiles()[0];
    }
    /// 獲取當(dāng)前環(huán)境
    public static String[] getActiveProfiles() {
        return context.getEnvironment().getActiveProfiles();
    }
}

ServiceConfig

    @Bean
    public static PropertySourcesPlaceholderConfigurer properties() {
        PropertySourcesPlaceholderConfigurer configurer = new PropertySourcesPlaceholderConfigurer();
        String path = "application-module1-service.yml";
        try {
            String profile = SpringContextUtil.getActiveProfile();
            if (StringUtils.isNotBlank(profile)) {
                path = "application-module1-service-" + profile + ".yml";
            }
        }catch (NullPointerException e){
            e.printStackTrace();
            System.out.println("SpringContextUtil...未加載...");
        }
        YamlPropertiesFactoryBean yaml = new YamlPropertiesFactoryBean();
        yaml.setResources(new ClassPathResource(path));//File引入
        configurer.setProperties(yaml.getObject());
        return configurer;
    }

完整代碼:https://gitee.com/soft_xiang/...

然而這里會(huì)有循環(huán)依賴問(wèn)題
運(yùn)行代碼會(huì)有

SpringContextUtil...未加載...

沒(méi)有實(shí)現(xiàn)根據(jù)active加載對(duì)應(yīng)配置文件