Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into develop

dev_oauth
jingquan huang 6 years ago
commit ed3aa5bdd1

@ -42,4 +42,13 @@ module Util
return '' if str.blank?
str.gsub(/<\/?.*?>/, '').gsub(/[\n\t\r]/, '').gsub(/&nbsp;/, '')
end
def conceal(str, type = nil)
str = str.to_s
case type
when :phone then "#{str[0..2]}***#{str[-4..-1]}"
when :email then "#{str[0..2]}***#{str[str.rindex('@')..-1]}"
else "#{str[0..2]}***#{str[-3..-1]}"
end
end
end

@ -11,7 +11,7 @@ class Users::BindEmailService < ApplicationService
def call
Users::BindEmailForm.new(params).validate!
raise Error, '该邮箱已被绑定' if User.where.not(id: user.id).exists?(mail: params[:email])
raise Error, '该邮箱已被其他账号绑定' if User.where.not(id: user.id).exists?(mail: params[:email])
code = VerificationCode.where(email: params[:email], code: params[:code], code_type: 5).last
raise Error, '验证码无效' unless code&.effective?

@ -11,7 +11,7 @@ class Users::BindPhoneService < ApplicationService
def call
Users::BindPhoneForm.new(params).validate!
raise Error, '该手机号已被绑定' if User.where.not(id: user.id).exists?(phone: params[:phone])
raise Error, '该手机号已被其他账号绑定' if User.where.not(id: user.id).exists?(phone: params[:phone])
code = VerificationCode.where(phone: params[:phone], code: params[:code], code_type: 4).last
raise Error, '验证码无效' unless code&.effective?

@ -1,16 +0,0 @@
defaults: &defaults
access_key_id: 'test'
access_key_secret: 'test'
base_url: 'http://vod.cn-shanghai.aliyuncs.com'
cate_id: '-1'
callback_url: 'http://47.96.87.25:48080/api/callbacks/aliyun_vod.json'
signature_key: 'test12345678'
development:
<<: *defaults
test:
<<: *defaults
production:
<<: *defaults

@ -193,10 +193,10 @@ function generateNewIndexJsp() {
}
const newVersion = '1.1.1'
let cdnHost = 'https://shixun.educoder.net'
cdnHost = 'http://cdn.educoder.net'
cdnHost = ''
cdnHost = 'https://ali-cdn.educoder.net'
// cdnHost = ''
var result = data.replace('/js/js_min_all.js', `${cdnHost}/react/build/js/js_min_all.js?v=${newVersion}`)
.replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
// .replace('/js/js_min_all_2.js', `${cdnHost}/react/build/js/js_min_all_2.js?v=${newVersion}`)
.replace('/css/css_min_all.css', `${cdnHost}/react/build/css/css_min_all.css?v=${newVersion}`)
.replace('/css/iconfont.css', `${cdnHost}/react/build/css/iconfont.css?v=${newVersion}`)

@ -73,4 +73,13 @@ html, body {
}
.formItemInline .ant-form-item-control-wrapper {
flex: 1;
}
/* 兼容性 */
/* 火狐有滚动条时高度问题 */
@-moz-document url-prefix() {
.newContainers {
min-height: calc(100% - 60px) !important;
}
}

@ -1,4 +1,5 @@
const isDev = window.location.port == 3007;
export const TEST_HOST = "http://47.96.87.25:48080"
export function getImageUrl(path) {
// https://www.educoder.net
// https://testbdweb.trustie.net

@ -4,7 +4,7 @@ import { from } from '_array-flatten@2.1.2@array-flatten';
export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl
, getUploadActionUrl as getUploadActionUrl, getUploadActionUrlOfAuth as getUploadActionUrlOfAuth
, getTaskUrlById as getTaskUrlById } from './UrlTool';
, getTaskUrlById as getTaskUrlById, TEST_HOST } from './UrlTool';
export { default as queryString } from './UrlTool2';
export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC';

@ -539,6 +539,8 @@ pop_box_new(htmlvalue, 480, 182);
.then((response) => {
// {"status":1,"message":"Unauthorized. \u7528\u6237\u8ba4\u8bc1\u5931\u8d25."}
window.__fetchAllFlag = false;
if (response.data.status == 403) {
window.location.href = "/403";
return;

@ -298,6 +298,7 @@ class MainContentContainer extends Component {
}).then((fetchRepositoryCodeResponse) => {
// monaca 需要刷新,不然无法编辑
if (this.retryAndRefresh && fetchRepositoryCodeResponse.data.content) {
this.retryAndRefresh = false;
window.location.reload()
return;
}

@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { TEST_HOST } from 'educoder'
export function loadSshScript(callback) {
let _url_origin = ``;
let prefix = 'react/build'
if (window.location.port == 3007) {
prefix = ''
_url_origin = 'https://newweb.educoder.net/';
// prefix = ''
_url_origin = TEST_HOST + '/' // 'https://newweb.educoder.net/';
} else {
// _url_origin = `https://testeduplus2.educoder.net/`;
_url_origin = '/';

@ -497,7 +497,7 @@ class PathDetailIndex extends Component{
</div>
}
{
this.props.checkIfLogin()===false?"123213":progress === undefined ? "" : progress === null ? "" :
this.props.checkIfLogin()===false?"":progress === undefined ? "" : progress === null ? "" :
<div className="edu-back-white myProgress padding40-20 mb10">
<p className="mb20">
<span className="font-16 mr10">我的进展</span>

@ -37,7 +37,7 @@ function VideoUpload (props) {
</div>
</div>
<div>
<div className="courseForm">
<span className="titleLabel">标题</span>
<Input placeholder={`标题支持最多${MAX_LENGTH}个字符`} onInput={titleChange} maxLength={MAX_LENGTH} suffix={
<span className="color-grey-6 font-13">{String(title.length)}/{MAX_LENGTH}</span>

@ -61,6 +61,17 @@ function VideoUploadList (props) {
// alert("请先选择需要上传的文件!")
return
}
// avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm
if (file.name
&& file.name.indexOf('.avi') == -1 && file.name.indexOf('.flv') == -1
&& file.name.indexOf('.f4v') == -1 && file.name.indexOf('.m4v') == -1
&& file.name.indexOf('.mov') == -1 && file.name.indexOf('.mp4') == -1
&& file.name.indexOf('.rmvb') == -1 && file.name.indexOf('.swf') == -1
&& file.name.indexOf('.webm') == -1
) {
showNotification(`不支持的视频格式`)
return;
}
if (file.size > 200 * 1024 * 1024) {
// 超过200m TODO
clearInput()

Loading…
Cancel
Save