diff --git a/admin/package.json b/admin/package.json index d5e8083..72992a5 100644 --- a/admin/package.json +++ b/admin/package.json @@ -50,15 +50,16 @@ "file-saver": "2.0.1", "fuse.js": "3.4.4", "js-cookie": "2.2.0", + "json-bigint": "^1.0.0", "jsonlint": "1.6.3", "jszip": "3.2.1", "mpvue-calendar": "^2.3.7", - "sass": "1.26.2", - "sass-loader": "^7.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", "path-to-regexp": "2.4.0", "qrcodejs2": "^0.0.2", + "sass": "1.26.2", + "sass-loader": "^7.2.0", "screenfull": "4.2.0", "script-loader": "0.7.2", "throttle-debounce": "^2.1.0", @@ -94,8 +95,8 @@ "mockjs": "1.0.1-beta3", "plop": "2.3.0", "runjs": "^4.3.2", - "script-loader": "^0.7.2", "script-ext-html-webpack-plugin": "2.1.3", + "script-loader": "^0.7.2", "serve-static": "^1.13.2", "svg-sprite-loader": "4.1.3", "svgo": "1.2.0", diff --git a/admin/src/utils/request.js b/admin/src/utils/request.js index c70f311..eccda39 100644 --- a/admin/src/utils/request.js +++ b/admin/src/utils/request.js @@ -14,6 +14,8 @@ import store from '@/store' import { getToken } from '@/utils/auth' import SettingMer from '@/utils/settingMer' import { isPhone } from "@/libs/wechat"; +import JsonBigint from 'json-bigint' +const JSONbigString = JsonBigint({ storeAsString: true }); const service = axios.create({ baseURL: SettingMer.apiBaseURL, timeout: 60000 // 过期时间 @@ -31,6 +33,16 @@ service.interceptors.request.use( config.params = config.params || {} config.params.temp= Date.parse(new Date()) / 1000 } + config.transformResponse = [ + function (data) { + try { + return JSONbigString.parse(data); + } catch (error) { + // console.log('错误', error); + return data; + } + } + ] return config }, error => { diff --git a/admin/src/views/dict/data.vue b/admin/src/views/dict/data.vue index 22e6a57..d967c53 100644 --- a/admin/src/views/dict/data.vue +++ b/admin/src/views/dict/data.vue @@ -394,7 +394,7 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const dictCodes = row.dictCode || this.ids; + const dictCodes = [row.dictCode] || this.ids; this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { return delData(dictCodes); }).then(() => { diff --git a/admin/src/views/dict/index.vue b/admin/src/views/dict/index.vue index fa1917f..07e9621 100644 --- a/admin/src/views/dict/index.vue +++ b/admin/src/views/dict/index.vue @@ -350,7 +350,7 @@ export default { }, /** 删除按钮操作 */ handleDelete(row) { - const dictIds = row.dictId || this.ids; + const dictIds = [row.dictId] || this.ids; this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { return delType(dictIds); }).then(() => {