Commit 597d7de5 by xzh

课程详情请求添加distcode

parent 7fff1397
HOST=m.julyedu.com HOST=127.0.0.1
PORT=80 PORT=80
\ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"@testing-library/user-event": "^7.2.1", "@testing-library/user-event": "^7.2.1",
"@types/classnames": "^2.2.10", "@types/classnames": "^2.2.10",
"@types/jest": "^24.9.1", "@types/jest": "^24.9.1",
"@types/node": "^12.12.54", "@types/node": "^15.14.0",
"@types/qs": "^6.9.4", "@types/qs": "^6.9.4",
"@types/react": "^16.9.44", "@types/react": "^16.9.44",
"@types/react-dom": "^16.9.8", "@types/react-dom": "^16.9.8",
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
"swiper": "^4.5.1", "swiper": "^4.5.1",
"terser-webpack-plugin": "2.3.5", "terser-webpack-plugin": "2.3.5",
"ts-pnp": "1.1.6", "ts-pnp": "1.1.6",
"typescript": "^3.7.5", "typescript": "^3.8.0",
"url-loader": "2.3.0", "url-loader": "2.3.0",
"vconsole": "^3.3.4", "vconsole": "^3.3.4",
"video.js": "^7.8.4", "video.js": "^7.8.4",
......
var API = { var API = {
'www': 'http://www-test.julyedu.com', 'www': 'http://www-test.julyedu.com',
'home': 'http://fast-test.julyedu.com', 'home': 'https://fast.julyedu.com',
'search-api': 'http://search-test.julyedu.com', 'search-api': 'http://search-test.julyedu.com',
'passport-api': 'http://passport-test.julyedu.com', 'passport-api': 'http://passport-test.julyedu.com',
'base-api': 'http://api-test.julyedu.com', 'base-api': 'https://api.julyedu.com',
'record': 'record.julyedu.com:8001', 'record': 'record.julyedu.com:8001',
'process-api': 'ws:process-test.julyedu.com:9502', 'process-api': 'ws:process-test.julyedu.com:9502',
'm': 'http://m-test.julyedu.com', 'm': 'http://m-test.julyedu.com',
......
...@@ -93,7 +93,7 @@ checkBrowsers(paths.appPath, isInteractive) ...@@ -93,7 +93,7 @@ checkBrowsers(paths.appPath, isInteractive)
devSocket, devSocket,
urls, urls,
useYarn, useYarn,
useTypeScript, // useTypeScript,
webpack, webpack,
}) })
// Load proxy config // Load proxy config
...@@ -116,7 +116,6 @@ checkBrowsers(paths.appPath, isInteractive) ...@@ -116,7 +116,6 @@ checkBrowsers(paths.appPath, isInteractive)
console.log(chalk.cyan("Starting the development server...\n")) console.log(chalk.cyan("Starting the development server...\n"))
openBrowser(urls.localUrlForBrowser) openBrowser(urls.localUrlForBrowser)
}) })
;["SIGINT", "SIGTERM"].forEach(function (sig) { ;["SIGINT", "SIGTERM"].forEach(function (sig) {
process.on(sig, function () { process.on(sig, function () {
devServer.close() devServer.close()
......
...@@ -432,7 +432,10 @@ class Detail extends Component { ...@@ -432,7 +432,10 @@ class Detail extends Component {
} }
fetchCourseInfo = () => { fetchCourseInfo = () => {
const id = getParam("id") const id = getParam("id")
http.get(`${API.home}/m/course/detail/${id}`).then((res) => { const url = getParam("dist_code")
? `${API.home}/m/course/detail/${id}/${getParam("dist_code")}`
: `${API.home}/m/course/detail/${id}`
http.get(url).then((res) => {
const { data, code } = res.data const { data, code } = res.data
if (code === 200) { if (code === 200) {
if (data["redirect_url"] !== "") { if (data["redirect_url"] !== "") {
......
...@@ -216,7 +216,10 @@ class ML extends Component { ...@@ -216,7 +216,10 @@ class ML extends Component {
fetchCourseInfo = () => { fetchCourseInfo = () => {
const id = getParam("id") const id = getParam("id")
http.get(`${API.home}/m/course/detail/${id}`).then((res) => { const url = getParam("dist_code")
? `${API.home}/m/course/detail/${id}/${getParam("dist_code")}`
: `${API.home}/m/course/detail/${id}`
http.get(url).then((res) => {
const { data, code } = res.data const { data, code } = res.data
if (code === 200) { if (code === 200) {
let version = getParam("version") let version = getParam("version")
...@@ -258,13 +261,8 @@ class ML extends Component { ...@@ -258,13 +261,8 @@ class ML extends Component {
} }
render() { render() {
const { const { isPay, buyTry, isAppUpdate, backwardVersion, isWxlogin } =
isPay, this.state
buyTry,
isAppUpdate,
backwardVersion,
isWxlogin,
} = this.state
// 旧版本 无论购买未购买 都跳转到 未购买的详情页; 如果是已购买就提示更新APP // 旧版本 无论购买未购买 都跳转到 未购买的详情页; 如果是已购买就提示更新APP
return ( return (
<div> <div>
......
...@@ -354,9 +354,13 @@ class Order extends Component { ...@@ -354,9 +354,13 @@ class Order extends Component {
this.props.location.state && this.props.location.state &&
this.props.location.state.group === 1 this.props.location.state.group === 1
) { ) {
const id = getParam("id")
const url = getParam("dist_code")
? `${API.home}/m/course/detail/${id}/${getParam("dist_code")}`
: `${API.home}/m/course/detail/${id}`
// 获取一键开团的课程 // 获取一键开团的课程
Promise.all([ Promise.all([
http.get(`${API.home}/m/course/detail/${getParam("id")}`), http.get(url),
http.get(`${API["base-api"]}/m/order/preorder`), http.get(`${API["base-api"]}/m/order/preorder`),
]).then((resList) => { ]).then((resList) => {
let courseInfo = resList[0], let courseInfo = resList[0],
......
...@@ -112,7 +112,10 @@ class Python extends Component { ...@@ -112,7 +112,10 @@ class Python extends Component {
fetchCourseInfo = () => { fetchCourseInfo = () => {
const id = getParam("id") const id = getParam("id")
http.get(`${API.home}/m/course/detail/${id}`).then((res) => { const url = getParam("dist_code")
? `${API.home}/m/course/detail/${id}/${getParam("dist_code")}`
: `${API.home}/m/course/detail/${id}`
http.get(url).then((res) => {
const { data, code } = res.data const { data, code } = res.data
if (code === 200) { if (code === 200) {
let version = getParam("version") let version = getParam("version")
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment