From 372212941c9b4e85e76ec1ef118372465e52bff9 Mon Sep 17 00:00:00 2001 From: yoyo837 Date: Mon, 25 Jun 2018 17:44:05 +0800 Subject: [PATCH] prettier --- src/utils/request.js | 6 +++++- src/utils/utils.js | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/utils/request.js b/src/utils/request.js index af1aaf74..80e495ea 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -47,7 +47,11 @@ export default function request(url, options) { credentials: 'include', }; const newOptions = { ...defaultOptions, ...options }; - if (newOptions.method === 'POST' || newOptions.method === 'PUT' || newOptions.method === 'DELETE') { + if ( + newOptions.method === 'POST' || + newOptions.method === 'PUT' || + newOptions.method === 'DELETE' + ) { if (!(newOptions.body instanceof FormData)) { newOptions.headers = { Accept: 'application/json', diff --git a/src/utils/utils.js b/src/utils/utils.js index 5385e42f..68618150 100644 --- a/src/utils/utils.js +++ b/src/utils/utils.js @@ -74,15 +74,15 @@ function accMul(arg1, arg2) { let m = 0; const s1 = arg1.toString(); const s2 = arg2.toString(); - m += s1.split(".").length > 1 ? s1.split(".")[1].length : 0; - m += s2.split(".").length > 1 ? s2.split(".")[1].length : 0; - return Number(s1.replace(".", "")) * Number(s2.replace(".", "")) / 10 ** m; + m += s1.split('.').length > 1 ? s1.split('.')[1].length : 0; + m += s2.split('.').length > 1 ? s2.split('.')[1].length : 0; + return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / 10 ** m; } export function digitUppercase(n) { const fraction = ['角', '分']; const digit = ['零', '壹', '贰', '叁', '肆', '伍', '陆', '柒', '捌', '玖']; - const unit = [['元', '万', '亿'],['', '拾', '佰', '仟', '万']]; + const unit = [['元', '万', '亿'], ['', '拾', '佰', '仟', '万']]; let num = Math.abs(n); let s = ''; fraction.forEach((item, index) => { -- GitLab