this.changeCategory()}>全部
this.changeCategory("manage")}>{is_current ? "我":"TA"}管理的
From ddef6b35d3f65b0b1b72abf624aafaff9b002fd7 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 4 Nov 2019 16:34:48 +0800
Subject: [PATCH 05/36] =?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/public/js/readme.txt | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/public/react/public/js/readme.txt b/public/react/public/js/readme.txt
index 348460500..35c0dc858 100755
--- a/public/react/public/js/readme.txt
+++ b/public/react/public/js/readme.txt
@@ -14,4 +14,9 @@ http://codemirror.net
diff_match_patch
codemirror merge.js
-从 edu_tpi.js 挪过来的js
\ No newline at end of file
+从 edu_tpi.js 挪过来的js
+
+
+修改过的地方:
+Raphaël 2.1.3
+Element= -> __Element= Element= 替换成了 __Element=
\ No newline at end of file
From ea64ba76ecca71749c320637d9298a45a9b31058 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 4 Nov 2019 16:46:23 +0800
Subject: [PATCH 06/36] cdn
---
public/react/scripts/readme-cdn.txt | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
create mode 100644 public/react/scripts/readme-cdn.txt
diff --git a/public/react/scripts/readme-cdn.txt b/public/react/scripts/readme-cdn.txt
new file mode 100644
index 000000000..7d090ee7a
--- /dev/null
+++ b/public/react/scripts/readme-cdn.txt
@@ -0,0 +1,16 @@
+目前是判断域名的方式动态访问对应的cdn资源
+静态资源处理在build.js中,如下代码:
+if (window.location.host == 'pre-newweb.educoder.net') {
+ _host = 'https://testali-cdn.educoder.net/react/build/'
+} else if (window.location.host == 'www.educoder.net') {
+ _host = 'https://ali-cdn.educoder.net/react/build/'
+}
+
+只对预上线和正式版做了处理
+
+动态的chunk资源处理在public-path.js中,如下代码:
+if ( window.location.host == 'pre-newweb.educoder.net') {
+ __webpack_public_path__ = 'https://testali-cdn.educoder.net/react/build/'
+} else if ( window.location.host == 'www.educoder.net') {
+ __webpack_public_path__ = 'https://ali-cdn.educoder.net/react/build/'
+}
\ No newline at end of file
From b97bd045b84ab84978ccc6e83da71ba09acb2860 Mon Sep 17 00:00:00 2001
From: hjm <63528605@qq.com>
Date: Mon, 4 Nov 2019 16:47:56 +0800
Subject: [PATCH 07/36] =?UTF-8?q?=E6=B3=A8=E9=87=8A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/scripts/build.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/scripts/build.js b/public/react/scripts/build.js
index b874ed6b6..e3350c5be 100644
--- a/public/react/scripts/build.js
+++ b/public/react/scripts/build.js
@@ -173,7 +173,7 @@ function copyPublicFolder() {
});
}
-
+// 给build脚本增加的方法,对其生成的index.html做一些文本替换,以及cdn处理
function generateNewIndexJsp() {
// var combinedStream = CombinedStream.create();
var filePath = paths.appBuild + '/index.html';
From e2e9a389f6c15e81fc6d877d9077e9f5442c93c2 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Mon, 4 Nov 2019 16:49:21 +0800
Subject: [PATCH 08/36] qq auth
---
app/controllers/admins/mirror_repositories_controller.rb | 1 -
app/controllers/oauth/base_controller.rb | 5 +++++
app/services/admins/check_shixun_mirrors_service.rb | 2 +-
config/initializers/omniauth.rb | 3 +++
config/routes.rb | 1 +
5 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/app/controllers/admins/mirror_repositories_controller.rb b/app/controllers/admins/mirror_repositories_controller.rb
index aed8dc09e..63e4667d1 100644
--- a/app/controllers/admins/mirror_repositories_controller.rb
+++ b/app/controllers/admins/mirror_repositories_controller.rb
@@ -87,7 +87,6 @@ class Admins::MirrorRepositoriesController < Admins::BaseController
end
def check_shixun_mirrors!
- return
return unless request.format.html?
Admins::CheckShixunMirrorsService.call
diff --git a/app/controllers/oauth/base_controller.rb b/app/controllers/oauth/base_controller.rb
index e2eb26a2a..a9c3f9fe4 100644
--- a/app/controllers/oauth/base_controller.rb
+++ b/app/controllers/oauth/base_controller.rb
@@ -1,9 +1,14 @@
class Oauth::BaseController < ActionController::Base
include RenderHelper
include LoginHelper
+ include ControllerRescueHandler
skip_before_action :verify_authenticity_token
+ def auth_failure
+ render_error(params[:message])
+ end
+
private
def session_user_id
diff --git a/app/services/admins/check_shixun_mirrors_service.rb b/app/services/admins/check_shixun_mirrors_service.rb
index 868fab042..fc0744867 100644
--- a/app/services/admins/check_shixun_mirrors_service.rb
+++ b/app/services/admins/check_shixun_mirrors_service.rb
@@ -78,7 +78,7 @@ class Admins::CheckShixunMirrorsService < ApplicationService
url = EduSetting.get('cloud_bridge')
res = Faraday.get(url)
- raise Error, '拉取镜像信息异常' if res && res['code'].nonzero?
+ raise Error, '拉取镜像信息异常' if res && res['code'].to_i != 0
res
rescue => e
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 27ade9ed4..5bd5ceeea 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -1,4 +1,7 @@
OmniAuth.config.add_camelization 'qq', 'QQ'
+OmniAuth.config.on_failure = Proc.new { |env|
+ OmniAuth::FailureEndpoint.new(env).redirect_to_failure
+}
oauth_config = {}
begin
diff --git a/config/routes.rb b/config/routes.rb
index 60fbf2dad..796d1d989 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -7,6 +7,7 @@ Rails.application.routes.draw do
get 'attachments/download/:id', to: 'attachments#show'
get 'attachments/download/:id/:filename', to: 'attachments#show'
get 'auth/qq/callback', to: 'oauth/qq#create'
+ get 'auth/failure', to: 'oauth/base#auth_failure'
resources :edu_settings
scope '/api' do
From 77be614b7b8a36e6fd4b7257bb7d73f7b640c97f Mon Sep 17 00:00:00 2001
From: p31729568
Date: Mon, 4 Nov 2019 16:59:12 +0800
Subject: [PATCH 09/36] auth ignore state
---
config/initializers/omniauth.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 5bd5ceeea..590943c2a 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -16,5 +16,5 @@ rescue => ex
end
Rails.application.config.middleware.use OmniAuth::Builder do
- provider :qq, oauth_config['appid'], oauth_config['secret']
+ provider :qq, oauth_config['appid'], oauth_config['secret'], { provider_ignores_state: true }
end
From 5370748b5d3f9a92509c126c83d558d402e22648 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 4 Nov 2019 17:19:24 +0800
Subject: [PATCH 10/36] =?UTF-8?q?=E9=95=9C=E5=83=8F=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/services/admins/check_shixun_mirrors_service.rb | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/services/admins/check_shixun_mirrors_service.rb b/app/services/admins/check_shixun_mirrors_service.rb
index fc0744867..8334df485 100644
--- a/app/services/admins/check_shixun_mirrors_service.rb
+++ b/app/services/admins/check_shixun_mirrors_service.rb
@@ -77,10 +77,11 @@ class Admins::CheckShixunMirrorsService < ApplicationService
@_bridge_images ||= begin
url = EduSetting.get('cloud_bridge')
res = Faraday.get(url)
+ res_body = JSON.parse(res.body)
- raise Error, '拉取镜像信息异常' if res && res['code'].to_i != 0
+ raise Error, '拉取镜像信息异常' if res_body && res_body['code'].to_i != 0
- res
+ res_body
rescue => e
Rails.logger.error("get response failed ! #{e.message}")
raise Error, '实训云平台繁忙(繁忙等级:84)'
From 2fe69f36c83f6369a1ab318b385a528728b5ce0c Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Mon, 4 Nov 2019 17:26:56 +0800
Subject: [PATCH 11/36] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=E5=91=98=E5=AE=9E=E8=AE=AD=E9=85=8D=E7=BD=AE=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=8E=92=E5=BA=8F=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/admins/shixun_settings_controller.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/controllers/admins/shixun_settings_controller.rb b/app/controllers/admins/shixun_settings_controller.rb
index 9919c7daa..d635ae8df 100644
--- a/app/controllers/admins/shixun_settings_controller.rb
+++ b/app/controllers/admins/shixun_settings_controller.rb
@@ -1,8 +1,7 @@
class Admins::ShixunSettingsController < Admins::BaseController
def index
- params[:sort_by] = params[:sort_by].presence || 'created_on'
- params[:sort_direction] = params[:sort_direction].presence || 'desc'
+ default_sort('created_at', 'desc')
shixun_settings = Admins::ShixunSettingsQuery.call(params)
@editing_shixuns = shixun_settings.where(status:0).size
From e0620ca1a4dbe4d7ef9715ab7eab42e51de5a3c8 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Mon, 4 Nov 2019 17:31:35 +0800
Subject: [PATCH 12/36] set log to auth2
---
config/initializers/omniauth.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 590943c2a..3eed48c20 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -1,4 +1,5 @@
OmniAuth.config.add_camelization 'qq', 'QQ'
+OmniAuth.config.logger = Rails.logger
OmniAuth.config.on_failure = Proc.new { |env|
OmniAuth::FailureEndpoint.new(env).redirect_to_failure
}
From 1a75401c08462900c196caa78d1b2e4f2756eff4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Mon, 4 Nov 2019 17:32:00 +0800
Subject: [PATCH 13/36] =?UTF-8?q?=E6=9B=B4=E6=96=B0icon?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/public/css/demo_index.html | 46 ++++++++++++++++++
public/react/public/css/iconfont.css | 20 +++++---
public/react/public/css/iconfont.eot | Bin 68456 -> 68776 bytes
public/react/public/css/iconfont.js | 2 +-
public/react/public/css/iconfont.json | 14 ++++++
public/react/public/css/iconfont.svg | 8 ++-
public/react/public/css/iconfont.ttf | Bin 68288 -> 68608 bytes
public/react/public/css/iconfont.woff | Bin 43996 -> 44252 bytes
public/react/public/css/iconfont.woff2 | Bin 36992 -> 37316 bytes
.../educoder/iconfont/demo_index.html | 46 ++++++++++++++++++
.../educoder/iconfont/iconfont.css | 20 +++++---
.../educoder/iconfont/iconfont.eot | Bin 68456 -> 68776 bytes
.../stylesheets/educoder/iconfont/iconfont.js | 2 +-
.../educoder/iconfont/iconfont.json | 14 ++++++
.../educoder/iconfont/iconfont.svg | 8 ++-
.../educoder/iconfont/iconfont.ttf | Bin 68288 -> 68608 bytes
.../educoder/iconfont/iconfont.woff | Bin 43996 -> 44252 bytes
.../educoder/iconfont/iconfont.woff2 | Bin 36992 -> 37316 bytes
18 files changed, 164 insertions(+), 16 deletions(-)
diff --git a/public/react/public/css/demo_index.html b/public/react/public/css/demo_index.html
index 8a75ddb27..c88449b3f 100644
--- a/public/react/public/css/demo_index.html
+++ b/public/react/public/css/demo_index.html
@@ -222,6 +222,12 @@

+
+
+ 关注
+ 
+
+
礼物
@@ -324,6 +330,12 @@

+
+
+ 关注
+ 
+
+
喇叭
@@ -1718,6 +1730,15 @@
+