Commit c81b43d7 by 张立顺

fix:appid错误问题

1 parent bee67638
/* eslint-disable */ /* eslint-disable */
require('script-loader!file-saver') require('script-loader!file-saver')
require('./Blob') require('./Blob')
// require('script-loader!xlsx/dist/xlsx.core.min') require('script-loader!xlsx/dist/xlsx.core.min')
import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖 // import * as XLSX from 'xlsx' // 数据导出导入所需要的依赖
function generateArray(table) { function generateArray(table) {
var out = [] var out = []
var rows = table.querySelectorAll('tr') var rows = table.querySelectorAll('tr')
......
...@@ -45,23 +45,23 @@ if (!isProd) { ...@@ -45,23 +45,23 @@ if (!isProd) {
} }
// 实例化 // 实例化
// process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
Sentry.init({ Sentry.init({
Vue, Vue,
dsn: 'http://c130dfd99792456ca835ca54680a8bbf@sentry.glsx.com.cn/14', dsn: 'http://c130dfd99792456ca835ca54680a8bbf@sentry.glsx.com.cn/14',
// dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4', // dsn: 'http://6225fb8e73fb453a8455a9371f3517da@192.168.3.115:9000/4',
integrations: [ integrations: [
new BrowserTracing({ new BrowserTracing({
routingInstrumentation: Sentry.vueRouterInstrumentation(router), routingInstrumentation: Sentry.vueRouterInstrumentation(router),
tracingOrigins: ['localhost', 'my-site-url.com', /^\//] tracingOrigins: ['localhost', 'my-site-url.com', /^\//]
}) })
], ],
// Set tracesSampleRate to 1.0 to capture 100% // Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring. // of transactions for performance monitoring.
// We recommend adjusting this value in production // We recommend adjusting this value in production
tracesSampleRate: 1.0, tracesSampleRate: 1.0,
logErrors: true logErrors: true
}) })
// console.log(test) // console.log(test)
// Vue.use(D2Crud) // Vue.use(D2Crud)
var baseConfig = '' var baseConfig = ''
......
...@@ -99,8 +99,8 @@ export default { ...@@ -99,8 +99,8 @@ export default {
createQrcodeImage() { createQrcodeImage() {
const oParams = {} const oParams = {}
oParams.channelType = 1 oParams.channelType = 1
// oParams.appId = 'wx06d1198e751435d1' oParams.appId = 'wx06d1198e751435d1'
oParams.appId = 'wx902f0b9c4b2c669d' // oParams.appId = 'wx902f0b9c4b2c669d'
oParams.qrcodeType = 'QR_WXA_UNLIMIT' oParams.qrcodeType = 'QR_WXA_UNLIMIT'
oParams.path = 'packagesPayment/pages/QRPayment/QRPayment' oParams.path = 'packagesPayment/pages/QRPayment/QRPayment'
// oParams.path = 'packagesPayment/pages/payment/index' // oParams.path = 'packagesPayment/pages/payment/index'
......
...@@ -2,25 +2,21 @@ const VueFilenameInjector = require('./tools/vue-filename-injector') ...@@ -2,25 +2,21 @@ const VueFilenameInjector = require('./tools/vue-filename-injector')
const ThemeColorReplacer = require('webpack-theme-color-replacer') const ThemeColorReplacer = require('webpack-theme-color-replacer')
const forElementUI = require('webpack-theme-color-replacer/forElementUI') const forElementUI = require('webpack-theme-color-replacer/forElementUI')
const HardPlugin = require('hard-source-webpack-plugin') // 使用缓存,优化启动速度 const HardPlugin = require('hard-source-webpack-plugin') // 使用缓存,优化启动速度
// const SpeedMeasurePlugin = require('speed-measure-webpack-plugin')
const SentryWebpackPlugin = require('@sentry/webpack-plugin') const SentryWebpackPlugin = require('@sentry/webpack-plugin')
const SpeedMeasurePlugin = require('speed-measure-webpack-plugin') // const CopyDir = require('./plugins/copyDir')
const CopyDir = require('./plugins/copyDir') // const AsyncRomveDir = require('./plugins/removeDir')
const AsyncRomveDir = require('./plugins/removeDir')
const { resolve: assets } = require('path') const { resolve: assets } = require('path')
const os = require('os') const os = require('os')
/** /**
* 获取当前机器的ip地址 * 获取当前机器的ip地址
*/ */
function getIpAddress() { function getIpAddress() {
var ifaces = os.networkInterfaces() var ifaces = os.networkInterfaces()
for (var dev in ifaces) { for (var dev in ifaces) {
const iface = ifaces[dev] const iface = ifaces[dev]
for (let i = 0; i < iface.length; i++) { for (let i = 0; i < iface.length; i++) {
const { family, address, internal } = iface[i] const { family, address, internal } = iface[i]
if (family === 'IPv4' && address !== '127.0.0.1' && !internal) { if (family === 'IPv4' && address !== '127.0.0.1' && !internal) {
return address return address
} }
...@@ -29,13 +25,10 @@ function getIpAddress() { ...@@ -29,13 +25,10 @@ function getIpAddress() {
} }
// 拼接路径 // 拼接路径
const resolve = dir => require('path').join(__dirname, dir) const resolve = dir => require('path').join(__dirname, dir)
// 增加环境变量 // 增加环境变量
process.env.VUE_APP_VERSION = require('./package.json').version process.env.VUE_APP_VERSION = require('./package.json').version
process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss') process.env.VUE_APP_BUILD_TIME = require('dayjs')().format('YYYY-M-D HH:mm:ss')
const isDev = process.env.NODE_ENV !== 'development' const isDev = process.env.NODE_ENV !== 'development'
// 基础路径 注意发布之前要先修改这里 // 基础路径 注意发布之前要先修改这里
const publicPath = '/dj-carlife-web/' const publicPath = '/dj-carlife-web/'
// const publicPath = '/' // const publicPath = '/'
...@@ -44,10 +37,7 @@ const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web' ...@@ -44,10 +37,7 @@ const CDN_DOMAIN = 'https://img02.glsx.com.cn/dj-carlife-web'
const cdn = { const cdn = {
css: [ css: [
// `${CDN_DOMAIN}/element-ui/2.15.0/theme-chalk/index.css`, // `${CDN_DOMAIN}/element-ui/2.15.0/theme-chalk/index.css`,
`${CDN_DOMAIN}/nprogress.min.css`, `${CDN_DOMAIN}/nprogress.min.css`
`${CDN_DOMAIN}/element-ui.min.css`,
`${CDN_DOMAIN}/flex.css`
// `https://unpkg.com/element-ui/lib/theme-chalk/index.css`
], ],
js: [ js: [
`${CDN_DOMAIN}/vue.min.js`, `${CDN_DOMAIN}/vue.min.js`,
...@@ -59,26 +49,15 @@ const cdn = { ...@@ -59,26 +49,15 @@ const cdn = {
`${CDN_DOMAIN}/echarts.min.js`, `${CDN_DOMAIN}/echarts.min.js`,
`${CDN_DOMAIN}/lodash.min.js`, `${CDN_DOMAIN}/lodash.min.js`,
`${CDN_DOMAIN}/qs.min.js`, `${CDN_DOMAIN}/qs.min.js`,
`${CDN_DOMAIN}/ua-parser.min.js`, `${CDN_DOMAIN}/ua-parser.min.js`
`${CDN_DOMAIN}/html2canvas.min.js`,
`${CDN_DOMAIN}/element-ui.min.js`,
`${CDN_DOMAIN}/better-scroll.min.js`,
`${CDN_DOMAIN}/dayjs.min.js`,
`${CDN_DOMAIN}/vue-qr.js`,
`${CDN_DOMAIN}/xlsx.min.js`
// `https://cdn.bootcdn.net/ajax/libs/better-scroll/2.4.2/better-scroll.min.js`,
// `https://cdn.bootcdn.net/ajax/libs/xlsx/0.18.5/xlsx.core.min.js`
// `${CDN_DOMAIN}/element-ui/2.15.0/index.js`, // `${CDN_DOMAIN}/element-ui/2.15.0/index.js`,
// `https://cdn.bootcdn.net/ajax/libs/html2canvas/1.4.1/html2canvas.min.js`,
// `https://unpkg.com/element-ui/lib/index.js`
// `${CDN_DOMAIN}/core-js/2.6.9/core.min.js`, // `${CDN_DOMAIN}/core-js/2.6.9/core.min.js`,
// `${CDN_DOMAIN}/vue-i18n/8.14.0/vue-i18n.esm.js`, // `${CDN_DOMAIN}/vue-i18n/8.14.0/vue-i18n.esm.js`,
] ]
} }
module.exports = { module.exports = {
publicPath, // 根据你的实际情况更改这里 publicPath, // 根据你的实际情况更改这里
outputDir: 'copyDirTarget', // outputDir: 'copyDirTarget',
lintOnSave: false, lintOnSave: false,
devServer: { devServer: {
// publicPath, // 和 publicPath 保持一致 // publicPath, // 和 publicPath 保持一致
...@@ -94,7 +73,6 @@ module.exports = { ...@@ -94,7 +73,6 @@ module.exports = {
} }
}, },
configureWebpack: config => { configureWebpack: config => {
// 先取消来调试
if (isDev) { if (isDev) {
config.externals = { config.externals = {
vue: 'Vue', vue: 'Vue',
...@@ -106,19 +84,13 @@ module.exports = { ...@@ -106,19 +84,13 @@ module.exports = {
echarts: 'echarts', echarts: 'echarts',
lodash: '_', lodash: '_',
'ua-parser-js': 'UAParser', 'ua-parser-js': 'UAParser',
qs: 'Qs', qs: 'Qs'
html2canvas: 'html2canvas', // 'element-ui': 'ELEMENT',
'element-ui': 'ELEMENT',
'better-scroll': 'BScroll',
xlsx: 'xlsx',
'vue-qr': 'vue-qr',
dayjs: 'dayjs',
'flex.css': 'flex.css'
// 'vue-i18n':'vue-i18n', // 'vue-i18n':'vue-i18n',
// 'better-scroll': 'BScroll',
// 'core-js': 'core-js' // 'core-js': 'core-js'
} }
} }
// 非开发环境 // 非开发环境
if (isDev) { if (isDev) {
config.optimization.minimizer[0].options.terserOptions.compress.warnings = false config.optimization.minimizer[0].options.terserOptions.compress.warnings = false
...@@ -129,7 +101,6 @@ module.exports = { ...@@ -129,7 +101,6 @@ module.exports = {
] ]
} }
// console.log(config) // console.log(config)
// const Plugins = [ // const Plugins = [
// new MiniCssExtractPlugin({ // new MiniCssExtractPlugin({
// // Options similar to the same options in webpackOptions.output // // Options similar to the same options in webpackOptions.output
...@@ -138,7 +109,6 @@ module.exports = { ...@@ -138,7 +109,6 @@ module.exports = {
// chunkFilename: devMode ? 'css/[id].css' : 'css/[id].[hash].css', // chunkFilename: devMode ? 'css/[id].css' : 'css/[id].[hash].css',
// })] // })]
// config.plugins = [...config.plugins, ...Plugins] // config.plugins = [...config.plugins, ...Plugins]
const plugins = [] const plugins = []
plugins.push( plugins.push(
new HardPlugin({ new HardPlugin({
...@@ -146,34 +116,27 @@ module.exports = { ...@@ -146,34 +116,27 @@ module.exports = {
// 解决报错问题 // 解决报错问题
test: /mini-css-extract-plugin[\\/]dist[\\/]loader/ test: /mini-css-extract-plugin[\\/]dist[\\/]loader/
}) })
)
if (isDev) {
plugins.push(new CopyDir())
// new AsyncRomveDir()
// new SpeedMeasurePlugin(), // new SpeedMeasurePlugin(),
// new CopyDir(), // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况 // new CopyDir() // 把dist 文件修改成有两份来兼容部署时请求目录不一样的情况
// new AsyncRomveDir() // new AsyncRomveDir()
} )
config.plugins = [...config.plugins, ...plugins] config.plugins = [...config.plugins, ...plugins]
// sentry 配置 // sentry 配置
// process.env.NODE_ENV === 'production' && process.env.NODE_ENV === 'production' &&
// Object.assign(config, { Object.assign(config, {
// plugins: [ plugins: [
// ...config.plugins, ...config.plugins,
// new SentryWebpackPlugin({ new SentryWebpackPlugin({
// // webpack specific configuration // webpack specific configuration
// release: '0.0.1', release: '0.0.1',
// include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件 include: './dist', // 需要上传到sentry服务器的资源目录,会自动匹配js 以及map文件
// ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加 ignore: ['node_modules', 'vue.config.js'], // 忽略文件目录,当然我们在inlcude中制定了文件路径,这个忽略目录可以不加
// configFile: '.sentryclirc', configFile: '.sentryclirc',
// urlPrefix: '~/dj-carlife-web/' urlPrefix: '~/dj-carlife-web/'
// }) })
// ] ]
// }) })
}, },
// 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js // 默认设置: https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-service/lib/config/base.js
chainWebpack: config => { chainWebpack: config => {
/** /**
...@@ -183,9 +146,6 @@ module.exports = { ...@@ -183,9 +146,6 @@ module.exports = {
* 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的 * 而且预渲染时生成的 prefetch 标签是 modern 版本的,低版本浏览器是不需要的
*/ */
config.plugins.delete('prefetch').delete('preload') config.plugins.delete('prefetch').delete('preload')
// config
// .plugin('webpack-bundle-analyzer')
// .use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin)
// 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559 // 解决 cli3 热更新失效 https://github.com/vuejs/vue-cli/issues/1559
config.resolve.symlinks(true) config.resolve.symlinks(true)
config.plugin('theme-color-replacer').use(ThemeColorReplacer, [ config.plugin('theme-color-replacer').use(ThemeColorReplacer, [
...@@ -244,7 +204,6 @@ module.exports = { ...@@ -244,7 +204,6 @@ module.exports = {
config.resolve.alias config.resolve.alias
.set('@', resolve('src')) .set('@', resolve('src'))
.set('@api', resolve('src/api')) .set('@api', resolve('src/api'))
if (isDev) { if (isDev) {
config.plugin('html').tap(args => { config.plugin('html').tap(args => {
// args[0].minify.removeComments = false; // args[0].minify.removeComments = false;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!