21世紀(jì)是生物科學(xué)漂亮代碼的世紀(jì)
# 我假設(shè)你知道這幾行在干啥
git init
git remote add origin PATH/TO/REPO
git fetch
# 指定現(xiàn)在的工作是基于哪個(gè)提交的
git reset origin/Branch_V1.20180611
# 切換到那個(gè)分支
git checkout -t origin/Branch_V1.20180611
# 剩一個(gè)自動(dòng)生成的master,刪掉
git branch -d master
先看看你控制臺(tái)有沒有報(bào)什么錯(cuò)
1.模擬后端開發(fā),拉后端代碼。(要后端代碼,沒坑,效率低)
2.前端開啟web服務(wù)器,node服務(wù)器或者nginx服務(wù)器。(前端自由,不用管后端)
node服務(wù)器:
proxyTable: {
'/api': {
target: 'http://segmentfault.com',
pathRewrite: {
'^/api': ''
}
}
}
1.比如ajax接口"/getMessage",本地"localhost:8080/getMessage",有跨域的問題。
2.localhost:8080 => http://segmentfault.com,本地開啟服務(wù)器實(shí)現(xiàn)代理。
nginx服務(wù)器:
http {
server {
listen 8080; #本地端口
server_name localhost;
location ~*/get*|post* { #nginx正則匹配(可高度自定義)
proxy_pass http://segmentfault.com; #反向代理
}
}
}
1.比如ajax接口"/getMessage",本地"localhost:8080/getMessage",有跨域的問題。
2.localhost:8080 => http://segmentfault.com,本地開啟服務(wù)器實(shí)現(xiàn)代理。
3.nginx反向代理更多配置查詢http://www.nginx.cn/115.html。
決定并發(fā)的根本原因是數(shù)據(jù)庫(kù)存取,其次一個(gè)服務(wù)器能承載的并發(fā)量并非軟件決定,還是要看硬件性能
在scripts/config/
zconf.hash.c
zconf.hash.c_shipped
兩個(gè)文件中kconf_id_lookup
前加入:
#ifdef __GNUC_STDC_INLINE__
__attribute__ ((__gnu_inline__))
#endif
redux-saga幫你做了。
不是很清楚你創(chuàng)建app和config中的代碼怎么寫的,但是應(yīng)該不是相對(duì)路徑的問題。
我使用相對(duì)路徑就可以的。
建議下次提問的時(shí)候把報(bào)錯(cuò)信息、相關(guān)代碼全貼出來。
# config文件配置
SQLALCHEMY_DATABASE_URI = 'sqlite+pysqlite:///./test.db'
storage::exists($results['capture_photo_path'])就好了;
執(zhí)行下面語句后再發(fā)布看看
git config --global http.postBuffer 524288000
Alpine Linux操作系統(tǒng)是一個(gè)面向安全的輕型Linux發(fā)行版,Alpine Linux Docker鏡像也繼承了Alpine Linux發(fā)行版的這些優(yōu)勢(shì)。相比于其他Docker鏡像,它的容量非常小,僅僅只有5M,且擁有非常友好的包管理器。
下表是一些官方鏡像的大?。?/p>
鏡像名稱 | 大?。∕B) |
ubuntu:latest | 187.9 |
debian:latest | 125.1 |
centos:latest | 196.6 |
alpine | 4.794 |
提示的很清楚。login.js
中有個(gè)對(duì)象的屬性是apply
,出現(xiàn)了這個(gè)對(duì)象為undefined
的情況。
判斷一下空undefined
的情況。
這哪里是亂碼啊,應(yīng)該是你的curl有問題
手持兩把錕斤拷,口中疾呼燙燙燙。腳踏千朵屯屯屯,笑看萬物锘锘锘。
好把 不開玩笑了,
錕斤拷 是在GBK和UTF-8編碼的兩種數(shù)據(jù)混用時(shí)會(huì)時(shí)常會(huì)發(fā)生的現(xiàn)象,應(yīng)該是你的終端默認(rèn)字符是GBK的,網(wǎng)頁返回的時(shí)UTF-8了
額,這個(gè)是報(bào)錯(cuò)吧……
沒試過netty,但換jetty是這樣:
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
<exclusions>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jetty</artifactId>
</dependency>
最簡(jiǎn)單的可能就是命令沒有軟鏈到bin目錄下,shell查找的目錄里沒有pip命令,你加個(gè)軟鏈到/usr/local/bin之類的目錄下
先clean再update最后再提交呢
abc.efg.com
域名一般是放在
server {
listen 80;
server_name abc.efg.com;
這個(gè)位置的。
然后
localtion /{
proxy_pass http://122.22.22.22:2222/;
}
nginx訪問靜態(tài)文件和uwsgi是沒啥關(guān)系的,都是一樣的配制方法.無論用gunicorn還是uwsgi都是這么配置.
這是我隨手截圖的寫法,用的是root,
按照alias寫法,就要在下邊的路徑加上/static/
你看看加上尾部的/行不行.
還有就是nginx是否有權(quán)限訪問你的文件目錄的問題.看一下nginx運(yùn)行的用戶是誰
https://segmentfault.com/q/10...
——————————————————————————————
第一次回復(fù)時(shí)沒看你的內(nèi)容,只回應(yīng)了標(biāo)題所以貼了個(gè)網(wǎng)址
下面正式回復(fù)
你的問題不是cookies的問題,我根據(jù)那篇文章改了下運(yùn)行成功了,你自己對(duì)照下
package main
import (
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"regexp"
"strings"
)
var cookies_lagou []*http.Cookie
const (
login_url_lagou string = "https://passport.lagou.com/login/login.html"
post_login_info_url_lagou string = "https://passport.lagou.com/login/login.json"
username_lagou string = "13330295142"
password_lagou string = "4525674692ac06e619cdb3f1b4b65b08"
)
func getToken(contents io.Reader) (string, string) {
data, _ := ioutil.ReadAll(contents)
regCode := regexp.MustCompile(`X_Anti_Forge_Code = '(.*?)';`)
if regCode == nil {
log.Fatal("解析Code出錯(cuò)...")
}
//提取關(guān)鍵信息
code := regCode.FindAllStringSubmatch(string(data), -1)[0][1]
regToken := regexp.MustCompile(`X_Anti_Forge_Token = '(.*?)';`)
if regToken == nil {
fmt.Println("MustCompile err")
}
//提取關(guān)鍵信息
token := regToken.FindAllStringSubmatch(string(data), -1)[0][1]
return token, code
}
func login_lagou() {
//獲取登陸界面的cookie
jar, _ := cookiejar.New(nil)
client := &http.Client{
Jar: jar,
}
req, _ := http.NewRequest("GET", login_url_lagou, nil)
res, _ := client.Do(req)
// for k, v := range res.Cookies() {
// fmt.Printf("%v=%v\n", k, v)
// }
token, code := getToken(res.Body)
fmt.Println(token, code)
//post數(shù)據(jù)
postValues := url.Values{}
postValues.Add("isValidate", "true")
postValues.Add("username", username_lagou)
postValues.Add("password", password_lagou)
postValues.Add("request_form_verifyCode", "")
postValues.Add("submit", "")
// body := ioutil.NopCloser(strings.NewReader(postValues.Encode())) //把form數(shù)據(jù)編下碼
// requ, _ := http.NewRequest("POST", post_login_info_url_lagou, nil)
requ, _ := http.NewRequest("POST", post_login_info_url_lagou, strings.NewReader(postValues.Encode()))
requ.Header.Set("Referer", "https://passport.lagou.com/login/login.html")
requ.Header.Set("X-Requested-With", "XMLHttpRequest")
requ.Header.Set("X-Anit-Forge-Token", token)
requ.Header.Set("X-Anit-Forge-Code", code)
requ.Header.Set("User-Agent", "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0")
requ.Header.Set("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8")
//for _, v := range res.Cookies() {
// requ.AddCookie(v)
//}
res, _ = client.Do(requ)
//cookies_lagou = res.Cookies()
data, _ := ioutil.ReadAll(res.Body)
res.Body.Close()
fmt.Println(string(data))
}
func main() {
login_lagou()
}
運(yùn)行結(jié)果
15f131a3-74b0-4914-bd6e-2672f36675e1 28747049
{"content":{"rows":[]},"message":"該帳號(hào)不存在或密碼(驗(yàn)證碼)誤,請(qǐng)重新輸入","state":400,"submitCode":23207051,"submitToken":"666f51d4-ccef-462a-bb56-55cb97c5231a"}
Process finished with exit code 0
假定你的這個(gè)model
的namespace
叫stock
那么組件需要這樣寫:
import connect from 'dva';
export default connect(state => state)(({stock: stockData}) => {
//your component
console.log(stockData); //這里就可以獲取到你要東西了。
})
記得在index.js
或者router
中,引入這個(gè)model.js
北大青鳥APTECH成立于1999年。依托北京大學(xué)優(yōu)質(zhì)雄厚的教育資源和背景,秉承“教育改變生活”的發(fā)展理念,致力于培養(yǎng)中國(guó)IT技能型緊缺人才,是大數(shù)據(jù)專業(yè)的國(guó)家
北大青鳥中博軟件學(xué)院創(chuàng)立于2003年,作為華東區(qū)著名互聯(lián)網(wǎng)學(xué)院和江蘇省首批服務(wù)外包人才培訓(xùn)基地,中博成功培育了近30000名軟件工程師走向高薪崗位,合作企業(yè)超4
中公教育集團(tuán)創(chuàng)建于1999年,經(jīng)過二十年潛心發(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)開發(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ū)ο箝_發(fā)經(jīng)驗(yàn),技術(shù)功底深厚。 授課風(fēng)格 授課風(fēng)格清新自然、條理清晰、主次分明、重點(diǎn)難點(diǎn)突出、引人入勝。
精通HTML5和CSS3;Javascript及主流js庫(kù),具有快速界面開發(fā)的能力,對(duì)瀏覽器兼容性、前端性能優(yōu)化等有深入理解。精通網(wǎng)頁制作和網(wǎng)頁游戲開發(fā)。
具有10 年的Java 企業(yè)應(yīng)用開發(fā)經(jīng)驗(yàn)。曾經(jīng)歷任德國(guó)Software AG 技術(shù)顧問,美國(guó)Dachieve 系統(tǒng)架構(gòu)師,美國(guó)AngelEngineers Inc. 系統(tǒng)架構(gòu)師。