Commit a7e1d712 by 万亚飞

fix

parent 316586ea
...@@ -6,7 +6,13 @@ import { Toast } from 'antd-mobile'; ...@@ -6,7 +6,13 @@ import { Toast } from 'antd-mobile';
import { getParameterByName } from '../utils/common'; import { getParameterByName } from '../utils/common';
export default function ajax(apiKey, options) { export default function ajax(apiKey, options) {
const uid = storage.getSS('urlQuery') ? storage.getSS('urlQuery').uid : ''; const userInfo = storage.getSS('urlQuery');
const uinfo = userInfo
? {
uid: userInfo.uid,
accessToken: userInfo.accessToken
}
: '';
// console.log(uid); // console.log(uid);
const option = Object.assign( const option = Object.assign(
{}, {},
...@@ -26,7 +32,7 @@ export default function ajax(apiKey, options) { ...@@ -26,7 +32,7 @@ export default function ajax(apiKey, options) {
const data = Object.assign({}, options.data || {}); const data = Object.assign({}, options.data || {});
// ENV === 'development' && (data.uid = storage.getLS('uid')); // ENV === 'development' && (data.uid = storage.getLS('uid'));
const contentType = option.contentType === 'json' ? 'application/json' : 'application/x-www-form-urlencoded;charset=utf-8'; const contentType = option.contentType === 'json' ? 'application/json' : 'application/x-www-form-urlencoded;charset=utf-8';
let headers = Object.assign({}, { 'Content-Type': contentType, uid }, option.headers); let headers = Object.assign({}, { 'Content-Type': contentType }, uinfo, option.headers);
const axiosConfig = Object.assign( const axiosConfig = Object.assign(
{}, {},
{ {
......
...@@ -73,7 +73,6 @@ class JobList extends Component { ...@@ -73,7 +73,6 @@ class JobList extends Component {
}; };
} }
componentWillMount() { componentWillMount() {
const _this = this;
document.title = '职业背景'; document.title = '职业背景';
this.setState({ this.setState({
tabIndex: parseInt(getParameterByName('index', location.href)) || 0 tabIndex: parseInt(getParameterByName('index', location.href)) || 0
......
...@@ -161,12 +161,15 @@ class Train extends Component { ...@@ -161,12 +161,15 @@ class Train extends Component {
fetch(subType, { fetch(subType, {
data: param, data: param,
success: res => { success: res => {
Toast.info(`${str}成功`); Toast.info(`${str}成功,请刷新列表页查看`);
fetch('fetchTrainList', {
loading: false
});
app().downRefresh(true); app().downRefresh(true);
app().notRefresh(true); app().notRefresh(true);
setTimeout(() => { setTimeout(() => {
history.back(); history.back();
}, 2000); }, 3000);
} }
}); });
} }
......
...@@ -160,7 +160,10 @@ class AddMaterial extends Component { ...@@ -160,7 +160,10 @@ class AddMaterial extends Component {
fetch(`${subType}${this.state.materialType}`, { fetch(`${subType}${this.state.materialType}`, {
data: param, data: param,
success: res => { success: res => {
Toast.info(`${str}成功`); Toast.info(`${str}成功,请刷新列表页查看`);
fetch('fetchJobList', {
loading: false
});
setTimeout(() => { setTimeout(() => {
history.back(); history.back();
}, 3000); }, 3000);
......
...@@ -293,18 +293,21 @@ export default function() { ...@@ -293,18 +293,21 @@ export default function() {
sendDataToOC(parmas); sendDataToOC(parmas);
}, 300); }, 300);
}; };
native.goPage = function(pageName, url) { native.goPage = function(url) {
setTimeout(function() { setTimeout(function() {
var parmas = {}; var parmas = {
parmas.cmd = {}; url: 'http',
parmas.cmd.params = ''; cmd: {
parmas.cmd.action_name = pageName; params: { url: url },
parmas.url = url; action_name: ''
}
console.log(parmas); };
sendDataToExp(parmas); sendDataToExp(parmas);
}, 300); }, 300);
}; };
native.toPage = function(url) {
sendDataToExp(url);
};
native.setParams = function(action_name, params, _url) { native.setParams = function(action_name, params, _url) {
setParams(action_name, params, _url); setParams(action_name, params, _url);
}; };
......
...@@ -52,12 +52,11 @@ export function getImgNaturalDimensions(imgSrc, callback) { ...@@ -52,12 +52,11 @@ export function getImgNaturalDimensions(imgSrc, callback) {
// } // }
return [nWidth, nHeight]; return [nWidth, nHeight];
} }
export function linkTo(url, isReplace) { export function linkTo(url) {
if (isReplace) {
location.replace(url);
} else {
location.href = url; location.href = url;
}
// alert(`${location.origin}${url}`); // alert(`${location.origin}${url}`);
// app().goPage('壹点零', `${location.origin}${url}`); // alert(`${location.origin}${url}`);
// app().goPage(`${location.origin}${url}`);
// alert(`${location.origin}${url}`);
// app().gotoOCChat('壹点零', `${location.origin}${url}`);
} }
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