dev_aliyun_beta
杨树明 5 years ago
parent c2ca5b5158
commit d99ff44081

@ -776,6 +776,10 @@ Rails.application.routes.draw do
end
post 'callbacks/aliyun_vod', to: 'callbacks/aliyun_vods#create'
namespace :wechats do
resource :js_sdk_signature, only: [:create]
end
end
namespace :admins do
@ -884,10 +888,6 @@ Rails.application.routes.draw do
end
end
namespace :wechats do
resource :js_sdk_signature, only: [:create]
end
#git 认证回调
match 'gitauth/*url', to: 'gits#auth', via: :all

File diff suppressed because one or more lines are too long

@ -23,7 +23,6 @@
<title>EduCoder</title>
<script type="text/javascript">
window.__isR = true;
// 不支持ie9 ie10
if (
( navigator.userAgent.indexOf('MSIE 9') != -1
@ -32,8 +31,11 @@
location.pathname.indexOf("/compatibility") == -1) {
// location.href = './compatibility'
location.href = '/compatibility.html'
location.href = '/compatibility.html'
}
const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));
if (isMobile) {
document.write('<script type="text/javascript" src="/javascripts/wx/jweixin-1.3.0.js"><\/script>');
}
</script>

@ -292,7 +292,58 @@ class App extends Component {
mydisplay:true,
})
};
initWXShare = () => {
if (window.wx) {
const wx = window.wx
const url = '/wechats/js_sdk_signature.json'
axios.post(url, {
url: 'http://pre-newweb.educoder.net',
}).then((response) => {
const data = response.data;
wx.config({
debug: false,
appId: data.appid,
timestamp: data.timestamp,
nonceStr: data.nonceStr,
signature: data.signature,
jsApiList: [
'onMenuShareTimeline',//
'onMenuShareAppMessage',
'onMenuShareQQ',
'onMenuShareWeibo',
'onMenuShareQZone'
]
});
wx.ready(function () {
var shareData = {
title: '这是是分享标题',
desc: '这是是摘要',
link: 'http://pre-newweb.educoder.net',
imgUrl: 'http://pre-newweb.educoder.net/images/educoder/index/subject/subject15.jpg'
};
wx.onMenuShareAppMessage(shareData);//分享给好友
wx.onMenuShareTimeline(shareData);//分享到朋友圈
wx.onMenuShareQQ(shareData);//分享给手机QQ
wx.onMenuShareWeibo(shareData);//分享腾讯微博
wx.onMenuShareQZone(shareData);//分享到QQ空间
});
wx.error(function (res) {
//alert(res.errMsg);//错误提示
});
}).catch((error) => {
console.log(error)
})
}
}
componentDidMount() {
// force an update if the URL changes
history.listen(() => {
this.forceUpdate()
@ -302,7 +353,7 @@ class App extends Component {
});
initAxiosInterceptors(this.props)
this.initWXShare()
//
// axios.interceptors.response.use((response) => {
// // console.log("response"+response);

@ -1,3 +1,6 @@
export function isDev() {
return window.location.port === "3007";
}
}
// const isMobile
export const isMobile = (/android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(navigator.userAgent.toLowerCase()));

@ -20,8 +20,7 @@ export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, ap
downloadFile, sortDirections } from './TextUtil'
export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil'
export { isDev as isDev } from './Env'
export { isDev as isDev, isMobile } from './Env'
export { toStore as toStore, fromStore as fromStore } from './Store'

@ -625,7 +625,7 @@ class CoursesBanner extends Component {
)
: ""}
{this.props.isStudent()?<a className="fr user_default_btn user_blue_btn mr20 font-18"
{this.props.isStudent()?this.props.current_user&&this.props.current_user.course_is_end===true?"":<a className="fr user_default_btn user_blue_btn mr20 font-18"
onClick={() => this.exitclass()}
> 退出课堂 </a>:""}

@ -58,7 +58,7 @@ class Boards extends Component{
let {pageSize}=this.state;
const cid = this.props.match.params.coursesId
let url = `/courses/${cid}/graduation_topics.json?limit=`+pageSize
let url = `/courses/${cid}/graduation_topics.json?limit=${pageSize}`
if(searchValue!=""){
url+="&search="+searchValue
}
@ -68,7 +68,17 @@ class Boards extends Component{
if(status!="" && status != "all"){
url+="&status="+status;
}
axios.get(url).then((response) => {
url=encodeURI(url);//IE11传参为乱码search
axios.get(url
// ,{
// params:{
// search:encodeURI(searchValue),
// page:page,
// status:status,
// limit:pageSize
// }
// }
).then((response) => {
if (response.status == 200 && response.status) {
this.setState({
data:response.data,

@ -29,7 +29,7 @@ class AddStudentModal extends Component{
const { name, school_name } = this.state
let url = `/courses/${courseId}/search_users.json?page=${page}&limit=${pageCount}&school_name=${school_name || ''}&name=${name || ''}`
this.setState({ loading: true })
axios.get(url)
axios.get(encodeURI(url))
.then((response) => {
if (!response.data.users || response.data.users.length == 0) {
this.setState({

@ -377,7 +377,7 @@ class studentsList extends Component{
if(searchValue!=""){
url+='&search='+searchValue;
}
const result = await axios.get(url)
const result = await axios.get(encodeURI(url))
// axios.get((url)).then((result)=>{
if (result.data.teacher_list) {
this.setState({

@ -116,6 +116,7 @@ class Poll extends Component{
if(search!=""&&search!=undefined){
url+="&search="+search
}
url=encodeURI(url);//IE11传参为乱码search
axios.get(url).then((result)=>{
if(result){
this.setState({

@ -160,7 +160,7 @@ class DetailCardsEditAndAdd extends Component{
url+="&type="+id;
}
axios.get(url).then((result)=>{
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
this.setState({
ChooseShixunList:result.data,
@ -322,7 +322,7 @@ class DetailCardsEditAndAdd extends Component{
if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
axios.get(encodeURI(url)).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;

@ -205,7 +205,7 @@ class TPMBanner extends Component {
SenttotheSearch=(value)=>{
let id = this.props.match.params.shixunId;
let url="/shixuns/" + id +"/search_user_courses.json?search="+value;
axios.get(url, {
axios.get(encodeURI(url), {
params: {
page:1,
limit:10

Loading…
Cancel
Save