你可以把控制臺(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è)位置
初始化成功,問(wèn)題已經(jīng)解決
分析原因,如下:
可以看到我全部是YES!!
經(jīng)過(guò)別人的告知,于是
截圖最后一項(xiàng)是代碼規(guī)范,建議不要使用,后面的全no
最終成功:
同時(shí)注意:
一定要進(jìn)入到你創(chuàng)建的my-vue-app下
才執(zhí)行命令cnpm run dev來(lái)啟動(dòng)項(xiàng)目:
你寫(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) , 你檢查下 , 或許有幫助 .
檢查redis服務(wù)狀態(tài) , 是否啟動(dòng)
檢查redis的host地址 和 監(jiān)聽(tīng)的port , 是不是如圖中所示
最后 , 如果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;
}
}
git pull
了解一下
@戦場(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)配置文件
北大青鳥(niǎo)APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥(niǎo)中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過(guò)二十年潛心發(fā)展,已由一家北大畢業(yè)生自主創(chuàng)業(yè)的信息技術(shù)與教育服務(wù)機(jī)構(gòu),發(fā)展為教育服務(wù)業(yè)的綜合性企業(yè)集團(tuán),成為集合面授教學(xué)培訓(xùn)、網(wǎng)
達(dá)內(nèi)教育集團(tuán)成立于2002年,是一家由留學(xué)海歸創(chuàng)辦的高端職業(yè)教育培訓(xùn)機(jī)構(gòu),是中國(guó)一站式人才培養(yǎng)平臺(tái)、一站式人才輸送平臺(tái)。2014年4月3日在美國(guó)成功上市,融資1
曾工作于聯(lián)想擔(dān)任系統(tǒng)開(kāi)發(fā)工程師,曾在博彥科技股份有限公司擔(dān)任項(xiàng)目經(jīng)理從事移動(dòng)互聯(lián)網(wǎng)管理及研發(fā)工作,曾創(chuàng)辦藍(lán)懿科技有限責(zé)任公司從事總經(jīng)理職務(wù)負(fù)責(zé)iOS教學(xué)及管理工作。
浪潮集團(tuán)項(xiàng)目經(jīng)理。精通Java與.NET 技術(shù), 熟練的跨平臺(tái)面向?qū)ο箝_(kāi)發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開(kāi)發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁(yè)制作和網(wǎng)頁(yè)游戲開(kāi)發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開(kāi)發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問(wèn),美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。