Commit 821db00009637ed21b23c434338432fba181d64d

Authored by fengtao
1 parent d033ff5a

fix: 修改阿里云或者腾讯云发送参数,校验参数

... ... @@ -157,6 +157,21 @@
157 157 if (typeof value == 'object') {
158 158 return Promise.resolve();
159 159 } else {
  160 + if (platformType.value !== PlateFormTypeEnum.tencent_cound) {
  161 + // 阿里云不能是以[]开头
  162 + if (
  163 + Object.prototype.toString.call(JSON.parse(value)) === '[object Array]'
  164 + ) {
  165 + return Promise.reject('请输入JSON格式例如{"code":"1234"}');
  166 + }
  167 + } else {
  168 + // 腾讯云只能是[]开头
  169 + if (
  170 + Object.prototype.toString.call(JSON.parse(value)) !== '[object Array]'
  171 + ) {
  172 + return Promise.reject('请输入这种格式["123456"]');
  173 + }
  174 + }
160 175 if (typeof JSON.parse(value) == 'object') {
161 176 return Promise.resolve();
162 177 }
... ...