zhuth 7 лет назад
Родитель
Сommit
15c9fa66e6
2 измененных файлов с 10 добавлено и 6 удалено
  1. 6 5
      frontend/saas-web/app/util/BaseUtil.js
  2. 4 1
      frontend/saas-web/app/util/FormUtil.js

+ 6 - 5
frontend/saas-web/app/util/BaseUtil.js

@@ -10,7 +10,11 @@ Ext.define('saas.util.BaseUtil', {
             params = config.params,
             async = config.async || true,
             method = config.method || 'GET',
-            timeout = config.timeout || 8000;
+            timeout = config.timeout || 8000,
+            defaultHeaders = {
+                'Access-Control-Allow-Origin': '*',
+                "Content-Type": 'application/json;charset=UTF-8' 
+            };
 
         return new Ext.Promise(function (resolve, reject) {
             Ext.Ajax.request({
@@ -19,10 +23,7 @@ Ext.define('saas.util.BaseUtil', {
                 async: async,
                 method: method,
                 timeout: timeout,
-                headers: {
-                    'Access-Control-Allow-Origin': '*',
-                    "Content-Type": 'application/json;charset=UTF-8' 
-                },
+                headers: Ext.apply(defaultHeaders, config.headers),
                 success: function (response, opts) {
                     var res = Ext.decode(response.responseText);
                     if(res.success) {

+ 4 - 1
frontend/saas-web/app/util/FormUtil.js

@@ -116,6 +116,9 @@ Ext.define('saas.util.FormUtil', {
             //取后台编号
             me.BaseUtil.request({
                 url: basePath + 'commons/number/getMaxnumber',
+                headers: {
+                    "Content-Type": 'application/x-www-form-urlencoded;charset=UTF-8'
+                },
                 params: {
                     caller:form.caller
                 },
@@ -124,7 +127,7 @@ Ext.define('saas.util.FormUtil', {
                 form.setLoading(false);
                 var res = Ext.decode(response.responseText);
                 if(res.success){
-                    var code = res.data.code;
+                    var code = res.data;
                     var viewModel = form.getViewModel();
                     var detailGrids = form.query('detailGridField');