fix: 修复 platform.js 与 http.js/util.js 之间 app_type/app_type_name 变量命名不匹配导致的 undefined 问题
- http.js: 修正 getPlatformInfo() 解构赋值为 appType/appTypeName - http.js: 修复 headimgBase64、headimgPull、upload 方法中的变量引用 - util.js: 修正 upload 方法中的解构赋值和变量引用 此问题导致所有 API 请求中 app_type 和 app_type_name 参数均为 undefined
This commit is contained in:
@@ -164,8 +164,8 @@ export default {
|
||||
'content-type': 'application/x-www-form-urlencoded;application/json'
|
||||
},
|
||||
data: {
|
||||
app_type,
|
||||
app_type_name,
|
||||
app_type: appType,
|
||||
app_type_name: appTypeName,
|
||||
images: params.base64
|
||||
},
|
||||
dataType: 'json',
|
||||
@@ -186,8 +186,8 @@ export default {
|
||||
'content-type': 'application/x-www-form-urlencoded;application/json'
|
||||
},
|
||||
data: {
|
||||
app_type,
|
||||
app_type_name,
|
||||
app_type: appType,
|
||||
app_type_name: appTypeName,
|
||||
path: params.path
|
||||
},
|
||||
dataType: 'json',
|
||||
@@ -207,8 +207,8 @@ export default {
|
||||
name: params.name || 'file',
|
||||
fileType: params.fileType || 'image',
|
||||
formData: {
|
||||
app_type,
|
||||
app_type_name,
|
||||
app_type: appType,
|
||||
app_type_name: appTypeName,
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded;application/json'
|
||||
|
||||
@@ -382,11 +382,11 @@ export default {
|
||||
* @param url
|
||||
*/
|
||||
upload: function (num, params, callback, url) {
|
||||
const { app_type, app_type_name } = Platform.getPlatformInfo();
|
||||
const { appType, appTypeName } = Platform.getPlatformInfo();
|
||||
var data = {
|
||||
token: store.state.token,
|
||||
app_type: app_type,
|
||||
app_type_name: app_type_name
|
||||
app_type: appType,
|
||||
app_type_name: appTypeName
|
||||
}
|
||||
data = Object.assign(data, params);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user