Merge branch 'master' of codeup.aliyun.com:5f9118049cffa29cfdd3be1c/marketing/frontend

This commit is contained in:
姜棚 2021-11-28 13:10:35 +08:00
commit 21c11dae32
2 changed files with 14 additions and 4 deletions

View File

@ -5,6 +5,9 @@ window.baseurl = 'http://192.168.6.75';
const upload = (method, url, params, responseType) => { const upload = (method, url, params, responseType) => {
let obj = { let obj = {
method: method, method: method,
headers: new Headers({
'authorization': sessionStorage.getItem("authorization")
}),
body: params, body: params,
} }
let http = fetch(url, obj).then(res =>{ let http = fetch(url, obj).then(res =>{
@ -15,7 +18,10 @@ const upload = (method, url, params, responseType) => {
const derive = (method, url, params, responseType) => { const derive = (method, url, params, responseType) => {
var obj = { var obj = {
responseType: 'blob' responseType: 'blob',
headers: new Headers({
'authorization': sessionStorage.getItem("authorization")
})
}; };
if (method == "get") { if (method == "get") {
if (params) { if (params) {

View File

@ -39,13 +39,17 @@ export default class adduserinfo extends React.Component{
componentDidMount(e){ componentDidMount(e){
} }
componentWillMount(){ componentWillMount(){
console.log(this.state);
let _self=this; let _self=this;
this.getCompanyFn();//获取公司
let companys=JSON.parse(sessionStorage.getItem('company')); let companys=JSON.parse(sessionStorage.getItem('company'));
if(!companys){
this.getCompanyFn();//获取公司 this.getCompanyFn();//获取公司
}
this.getRoleFn();//获取角色 this.getRoleFn();//获取角色
let formInfo=this.props; let formInfo=this.props;
if(formInfo.enumer==1){ if(formInfo&&formInfo.enumer==1){
let acceptData=_.cloneDeep(formInfo.rowData); let acceptData=_.cloneDeep(formInfo.rowData);
let data={ let data={
user_name:acceptData.user_name, user_name:acceptData.user_name,
@ -62,7 +66,7 @@ export default class adduserinfo extends React.Component{
img.src=acceptData.head; img.src=acceptData.head;
this.setState({model:data,disabled:true,defaultFileList:[img],id:acceptData.id,headImg:acceptData.head}); this.setState({model:data,disabled:true,defaultFileList:[img],id:acceptData.id,headImg:acceptData.head});
//若有公司id静默获取部门 //若有公司id静默获取部门
if(data.company.key){ if(data.company&&data.company.key){
getDepartment({company_id:data.company.key}).then(res=>{ getDepartment({company_id:data.company.key}).then(res=>{
handelResponse(res,(response,msg)=>{ handelResponse(res,(response,msg)=>{
let departmentList=response.map(item=>{ let departmentList=response.map(item=>{