fix: bigint处理

main
wx-jincw 2 days ago
parent 5a608df1ea
commit 295547bc80

@ -50,15 +50,16 @@
"file-saver": "2.0.1", "file-saver": "2.0.1",
"fuse.js": "3.4.4", "fuse.js": "3.4.4",
"js-cookie": "2.2.0", "js-cookie": "2.2.0",
"json-bigint": "^1.0.0",
"jsonlint": "1.6.3", "jsonlint": "1.6.3",
"jszip": "3.2.1", "jszip": "3.2.1",
"mpvue-calendar": "^2.3.7", "mpvue-calendar": "^2.3.7",
"sass": "1.26.2",
"sass-loader": "^7.2.0",
"normalize.css": "7.0.0", "normalize.css": "7.0.0",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"path-to-regexp": "2.4.0", "path-to-regexp": "2.4.0",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"sass": "1.26.2",
"sass-loader": "^7.2.0",
"screenfull": "4.2.0", "screenfull": "4.2.0",
"script-loader": "0.7.2", "script-loader": "0.7.2",
"throttle-debounce": "^2.1.0", "throttle-debounce": "^2.1.0",
@ -94,8 +95,8 @@
"mockjs": "1.0.1-beta3", "mockjs": "1.0.1-beta3",
"plop": "2.3.0", "plop": "2.3.0",
"runjs": "^4.3.2", "runjs": "^4.3.2",
"script-loader": "^0.7.2",
"script-ext-html-webpack-plugin": "2.1.3", "script-ext-html-webpack-plugin": "2.1.3",
"script-loader": "^0.7.2",
"serve-static": "^1.13.2", "serve-static": "^1.13.2",
"svg-sprite-loader": "4.1.3", "svg-sprite-loader": "4.1.3",
"svgo": "1.2.0", "svgo": "1.2.0",

@ -14,6 +14,8 @@ import store from '@/store'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import SettingMer from '@/utils/settingMer' import SettingMer from '@/utils/settingMer'
import { isPhone } from "@/libs/wechat"; import { isPhone } from "@/libs/wechat";
import JsonBigint from 'json-bigint'
const JSONbigString = JsonBigint({ storeAsString: true });
const service = axios.create({ const service = axios.create({
baseURL: SettingMer.apiBaseURL, baseURL: SettingMer.apiBaseURL,
timeout: 60000 // 过期时间 timeout: 60000 // 过期时间
@ -31,6 +33,16 @@ service.interceptors.request.use(
config.params = config.params || {} config.params = config.params || {}
config.params.temp= Date.parse(new Date()) / 1000 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 return config
}, },
error => { error => {

@ -394,7 +394,7 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictCodes = row.dictCode || this.ids; const dictCodes = [row.dictCode] || this.ids;
this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除字典编码为"' + dictCodes + '"的数据项?').then(function() {
return delData(dictCodes); return delData(dictCodes);
}).then(() => { }).then(() => {

@ -350,7 +350,7 @@ export default {
}, },
/** 删除按钮操作 */ /** 删除按钮操作 */
handleDelete(row) { handleDelete(row) {
const dictIds = row.dictId || this.ids; const dictIds = [row.dictId] || this.ids;
this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() { this.$modal.confirm('是否确认删除字典编号为"' + dictIds + '"的数据项?').then(function() {
return delType(dictIds); return delType(dictIds);
}).then(() => { }).then(() => {

Loading…
Cancel
Save