Merge branch 'master' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend
This commit is contained in:
commit
21c11dae32
|
@ -5,6 +5,9 @@ window.baseurl = 'http://192.168.6.75';
|
|||
const upload = (method, url, params, responseType) => {
|
||||
let obj = {
|
||||
method: method,
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization")
|
||||
}),
|
||||
body: params,
|
||||
}
|
||||
let http = fetch(url, obj).then(res =>{
|
||||
|
@ -15,7 +18,10 @@ const upload = (method, url, params, responseType) => {
|
|||
|
||||
const derive = (method, url, params, responseType) => {
|
||||
var obj = {
|
||||
responseType: 'blob'
|
||||
responseType: 'blob',
|
||||
headers: new Headers({
|
||||
'authorization': sessionStorage.getItem("authorization")
|
||||
})
|
||||
};
|
||||
if (method == "get") {
|
||||
if (params) {
|
||||
|
|
|
@ -39,13 +39,17 @@ export default class adduserinfo extends React.Component{
|
|||
componentDidMount(e){
|
||||
}
|
||||
componentWillMount(){
|
||||
console.log(this.state);
|
||||
let _self=this;
|
||||
this.getCompanyFn();//获取公司
|
||||
let companys=JSON.parse(sessionStorage.getItem('company'));
|
||||
if(!companys){
|
||||
this.getCompanyFn();//获取公司
|
||||
}
|
||||
|
||||
|
||||
this.getRoleFn();//获取角色
|
||||
let formInfo=this.props;
|
||||
if(formInfo.enumer==1){
|
||||
if(formInfo&&formInfo.enumer==1){
|
||||
let acceptData=_.cloneDeep(formInfo.rowData);
|
||||
let data={
|
||||
user_name:acceptData.user_name,
|
||||
|
@ -62,7 +66,7 @@ export default class adduserinfo extends React.Component{
|
|||
img.src=acceptData.head;
|
||||
this.setState({model:data,disabled:true,defaultFileList:[img],id:acceptData.id,headImg:acceptData.head});
|
||||
//若有公司id,静默获取部门
|
||||
if(data.company.key){
|
||||
if(data.company&&data.company.key){
|
||||
getDepartment({company_id:data.company.key}).then(res=>{
|
||||
handelResponse(res,(response,msg)=>{
|
||||
let departmentList=response.map(item=>{
|
||||
|
|
Loading…
Reference in New Issue