Commit a7e1d712 by 万亚飞

fix

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