Compare commits
5 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
68ea7e40de | |
|
|
296a8032de | |
|
|
2f464cdc2d | |
|
|
a4abdf9cc0 | |
|
|
d10a6cb178 |
|
|
@ -0,0 +1,102 @@
|
|||
var gulp = require('gulp');
|
||||
var $ = require('gulp-load-plugins')();
|
||||
var path = require('path');
|
||||
var del = require('del');
|
||||
|
||||
var distPath = path.resolve('./dist');
|
||||
var version = ''; // 版本号
|
||||
var versionPath = ''; // 版本号路径
|
||||
var env = ''; // 运行环境
|
||||
|
||||
// 创建版本号(年月日时分)
|
||||
(function () {
|
||||
var d = new Date();
|
||||
var yy = d.getFullYear().toString().slice(2);
|
||||
var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
|
||||
var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate();
|
||||
var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours();
|
||||
var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes();
|
||||
version = yy + MM + DD + h + mm;
|
||||
versionPath = distPath + '/' + version;
|
||||
})();
|
||||
|
||||
// 编译
|
||||
gulp.task('build', $.shell.task(['node build/build.js']));
|
||||
|
||||
// 创建版本号目录
|
||||
gulp.task('create:versionCatalog', gulp.series('build', function () {
|
||||
return gulp.src(`${distPath}/static/**/*`)
|
||||
.pipe(gulp.dest(`${versionPath}/static/`))
|
||||
}))
|
||||
|
||||
// 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量
|
||||
gulp.task('replace:cdnUrl', gulp.series('create:versionCatalog', function () {
|
||||
return gulp.src(`${versionPath}/static/js/manifest.js`)
|
||||
.pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
|
||||
.pipe(gulp.dest(`${versionPath}/static/js/`))
|
||||
}))
|
||||
|
||||
// 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量
|
||||
gulp.task('replace:version', gulp.series('create:versionCatalog', function () {
|
||||
return gulp.src(`${versionPath}/static/config/index-${env}.js`)
|
||||
.pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`))
|
||||
.pipe(gulp.dest(`${versionPath}/static/config/`))
|
||||
}))
|
||||
|
||||
// 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js
|
||||
gulp.task('concat:config', gulp.series('replace:version', function () {
|
||||
return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`])
|
||||
.pipe($.concat('index.js'))
|
||||
.pipe(gulp.dest(`${distPath}/config/`))
|
||||
}))
|
||||
|
||||
// 清空文件历史
|
||||
gulp.task('clean', function () {
|
||||
console.log('--clean--')
|
||||
// del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
// return del([versionPath])
|
||||
return del([`${distPath}`])
|
||||
})
|
||||
|
||||
gulp.task('build-end', function () {
|
||||
console.log('--builed-end--')
|
||||
// del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
return del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
})
|
||||
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod';
|
||||
|
||||
gulp.task('default',
|
||||
gulp.series('clean',
|
||||
gulp.parallel('create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'),
|
||||
'build', 'build-end')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
/* gulp.task('default', gulp.series('clean', function (done) {
|
||||
// 获取环境配置
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
|
||||
// 开始打包编译
|
||||
// 开始打包编译
|
||||
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
|
||||
// 清除, 编译 / 处理项目中产生的文件
|
||||
del([`${distPath}/static`, `${versionPath}/static/config`])
|
||||
done();
|
||||
}))
|
||||
})); */
|
||||
|
||||
/*
|
||||
gulp.task('default', gulp.series('clean', function (done) {
|
||||
// 获取环境配置
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
|
||||
// 开始打包编译
|
||||
// 开始打包编译
|
||||
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
|
||||
// 清除, 编译 / 处理项目中产生的文件
|
||||
del([`${distPath}/static`, `${versionPath}/static/config`])
|
||||
done();
|
||||
}))
|
||||
}));
|
||||
*/
|
||||
116
gulpfile.js
116
gulpfile.js
|
|
@ -3,21 +3,23 @@ var $ = require('gulp-load-plugins')();
|
|||
var path = require('path');
|
||||
var del = require('del');
|
||||
|
||||
// 先设置环境变量,确保任务定义时可以正确访问
|
||||
var env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod';
|
||||
|
||||
var distPath = path.resolve('./dist');
|
||||
var version = ''; // 版本号
|
||||
var versionPath = ''; // 版本号路径
|
||||
var env = ''; // 运行环境
|
||||
|
||||
// 创建版本号(年月日时分)
|
||||
(function () {
|
||||
var d = new Date();
|
||||
var yy = d.getFullYear().toString().slice(2);
|
||||
var MM = d.getMonth() + 1 >= 10 ? (d.getMonth() + 1) : '0' + (d.getMonth() + 1);
|
||||
var DD = d.getDate() >= 10 ? d.getDate() : '0' + d.getDate();
|
||||
var h = d.getHours() >= 10 ? d.getHours() : '0' + d.getHours();
|
||||
var mm = d.getMinutes() >= 10 ? d.getMinutes() : '0' + d.getMinutes();
|
||||
var MM = (d.getMonth() + 1).toString().padStart(2, '0');
|
||||
var DD = d.getDate().toString().padStart(2, '0');
|
||||
var h = d.getHours().toString().padStart(2, '0');
|
||||
var mm = d.getMinutes().toString().padStart(2, '0');
|
||||
version = yy + MM + DD + h + mm;
|
||||
versionPath = distPath + '/' + version;
|
||||
versionPath = path.join(distPath, version); // 使用path.join更安全
|
||||
})();
|
||||
|
||||
// 编译
|
||||
|
|
@ -25,78 +27,60 @@ gulp.task('build', $.shell.task(['node build/build.js']));
|
|||
|
||||
// 创建版本号目录
|
||||
gulp.task('create:versionCatalog', gulp.series('build', function () {
|
||||
return gulp.src(`${distPath}/static/**/*`)
|
||||
.pipe(gulp.dest(`${versionPath}/static/`))
|
||||
}))
|
||||
return gulp.src(path.join(distPath, 'static', '**', '*'))
|
||||
.pipe(gulp.dest(path.join(versionPath, 'static')));
|
||||
}));
|
||||
|
||||
// 替换${versionPath}/static/js/manifest.js window.SITE_CONFIG.cdnUrl占位变量
|
||||
// 替换cdnUrl占位变量
|
||||
gulp.task('replace:cdnUrl', gulp.series('create:versionCatalog', function () {
|
||||
return gulp.src(`${versionPath}/static/js/manifest.js`)
|
||||
.pipe($.replace(new RegExp(`"${require('./config').build.assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
|
||||
.pipe(gulp.dest(`${versionPath}/static/js/`))
|
||||
}))
|
||||
const assetsPublicPath = require('./config').build.assetsPublicPath;
|
||||
return gulp.src(path.join(versionPath, 'static', 'js', 'manifest.js'))
|
||||
.pipe($.replace(new RegExp(`"${assetsPublicPath}"`, 'g'), 'window.SITE_CONFIG.cdnUrl + "/"'))
|
||||
.pipe(gulp.dest(path.join(versionPath, 'static', 'js')));
|
||||
}));
|
||||
|
||||
// 替换${versionPath}/static/config/index-${env}.js window.SITE_CONFIG['version']配置变量
|
||||
// 替换version配置变量
|
||||
gulp.task('replace:version', gulp.series('create:versionCatalog', function () {
|
||||
return gulp.src(`${versionPath}/static/config/index-${env}.js`)
|
||||
return gulp.src(path.join(versionPath, 'static', 'config', `index-${env}.js`))
|
||||
.pipe($.replace(/window.SITE_CONFIG\['version'\] = '.*'/g, `window.SITE_CONFIG['version'] = '${version}'`))
|
||||
.pipe(gulp.dest(`${versionPath}/static/config/`))
|
||||
}))
|
||||
.pipe(gulp.dest(path.join(versionPath, 'static', 'config')));
|
||||
}));
|
||||
|
||||
// 合并${versionPath}/static/config/[index-${env}, init].js 至 ${distPath}/config/index.js
|
||||
// 合并配置文件
|
||||
gulp.task('concat:config', gulp.series('replace:version', function () {
|
||||
return gulp.src([`${versionPath}/static/config/index-${env}.js`, `${versionPath}/static/config/init.js`])
|
||||
return gulp.src([
|
||||
path.join(versionPath, 'static', 'config', `index-${env}.js`),
|
||||
path.join(versionPath, 'static', 'config', 'init.js')
|
||||
])
|
||||
.pipe($.concat('index.js'))
|
||||
.pipe(gulp.dest(`${distPath}/config/`))
|
||||
}))
|
||||
.pipe(gulp.dest(path.join(distPath, 'config')));
|
||||
}));
|
||||
|
||||
// 清空文件历史
|
||||
gulp.task('clean', function () {
|
||||
console.log('--clean--')
|
||||
// del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
// return del([versionPath])
|
||||
return del([`${distPath}`])
|
||||
})
|
||||
console.log('--clean--');
|
||||
return del([distPath]);
|
||||
});
|
||||
|
||||
// 构建结束清理
|
||||
gulp.task('build-end', function () {
|
||||
console.log('--builed-end--')
|
||||
// del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
return del([`${distPath}/static`, `${versionPath}/static/config`]);
|
||||
})
|
||||
console.log('--builed-end--');
|
||||
return del([
|
||||
path.join(distPath, 'static'),
|
||||
path.join(versionPath, 'static', 'config')
|
||||
]);
|
||||
});
|
||||
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod';
|
||||
|
||||
gulp.task('default',
|
||||
gulp.series('clean',
|
||||
gulp.parallel('create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config'),
|
||||
'build', 'build-end')
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
/* gulp.task('default', gulp.series('clean', function (done) {
|
||||
// 获取环境配置
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
|
||||
// 开始打包编译
|
||||
// 开始打包编译
|
||||
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
|
||||
// 清除, 编译 / 处理项目中产生的文件
|
||||
del([`${distPath}/static`, `${versionPath}/static/config`])
|
||||
// 主任务 - 按正确顺序执行
|
||||
gulp.task('default', gulp.series(
|
||||
'clean',
|
||||
'build',
|
||||
'create:versionCatalog',
|
||||
gulp.parallel('replace:cdnUrl', 'replace:version'),
|
||||
'concat:config',
|
||||
'build-end',
|
||||
function (done) {
|
||||
console.log(`构建完成,环境: ${env},版本号: ${version}`);
|
||||
done();
|
||||
}))
|
||||
})); */
|
||||
|
||||
/*
|
||||
gulp.task('default', gulp.series('clean', function (done) {
|
||||
// 获取环境配置
|
||||
env = process.env.npm_config_qa ? 'qa' : process.env.npm_config_uat ? 'uat' : 'prod'
|
||||
// 开始打包编译
|
||||
// 开始打包编译
|
||||
gulp.task('default', gulp.series('build','create:versionCatalog', 'replace:cdnUrl', 'replace:version', 'concat:config', function (done) {
|
||||
// 清除, 编译 / 处理项目中产生的文件
|
||||
del([`${distPath}/static`, `${versionPath}/static/config`])
|
||||
done();
|
||||
}))
|
||||
}));
|
||||
*/
|
||||
}
|
||||
));
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
this.url = fileRes.replace(
|
||||
"https://sy-duanju.oss-cn-nanjing.aliyuncs.com/",
|
||||
"https://sy-duanju.oss-cn-chengdu.aliyuncs.com/",
|
||||
"https://short-video.hnsiyao.cn/"
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ export const productUrl='dj-admin';
|
|||
|
||||
// const baseUrl = "https://web-api.hnsiyao.cn/czg/" //测试
|
||||
const baseUrl = "https://web.hnsiyao.cn/czg/" // 线上
|
||||
// const baseUrl = "https://ph.hnsiyao.cn/czg/" // 线上
|
||||
|
||||
export default{
|
||||
baseUrl
|
||||
|
|
|
|||
|
|
@ -49,6 +49,9 @@ http.interceptors.response.use(response => {
|
|||
if (response.data && response.data.code === 401) { // 401, token失效
|
||||
clearLoginInfo()
|
||||
router.push({name: 'login'})
|
||||
setTimeout(() => {
|
||||
window.location.reload()
|
||||
}, 300);
|
||||
}
|
||||
return response
|
||||
}, error => {
|
||||
|
|
|
|||
|
|
@ -345,7 +345,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
return fileRes.replace(
|
||||
"https://sy-duanju.oss-cn-nanjing.aliyuncs.com/",
|
||||
"https://sy-duanju.oss-cn-chengdu.aliyuncs.com/",
|
||||
"https://short-video.hnsiyao.cn/"
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1978,8 +1978,11 @@
|
|||
}).then(({
|
||||
data
|
||||
}) => {
|
||||
console.log('-------')
|
||||
this.tableDataLoading = false
|
||||
let returnData = data.data;
|
||||
console.log(returnData)
|
||||
|
||||
this.tableDataYe = returnData
|
||||
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1410,7 +1410,7 @@ export default {
|
|||
return;
|
||||
}
|
||||
this.url = fileRes.replace(
|
||||
"https://sy-duanju.oss-cn-nanjing.aliyuncs.com/",
|
||||
"https://sy-duanju.oss-cn-chengdu.aliyuncs.com/",
|
||||
"https://short-video.hnsiyao.cn/"
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@
|
|||
<span>成功笔数:</span> {{ orderInfo.withdrawTotal.success.count }}
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>失败合计:</span> {{ orderInfo.withdrawTotal.fail.count }}
|
||||
<span>失败合计:</span> {{ orderInfo.withdrawTotal.fail.total }}
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>失败笔数:</span> {{ orderInfo.withdrawTotal.fail.count }}
|
||||
|
|
@ -105,7 +105,7 @@
|
|||
<span>成功笔数:</span> {{ orderInfo.payTotal.success.count }}
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>失败合计:</span> {{ orderInfo.payTotal.fail.count }}
|
||||
<span>失败合计:</span> {{ orderInfo.payTotal.fail.total }}
|
||||
</div>
|
||||
<div class="row">
|
||||
<span>失败笔数:</span> {{ orderInfo.payTotal.fail.count }}
|
||||
|
|
@ -148,6 +148,7 @@ export default {
|
|||
if (!this.queryForm.outTradeNo) return
|
||||
this.loading = true
|
||||
const res = await queryByTradeNo({ outTradeNo: this.queryForm.outTradeNo })
|
||||
console.log(res);
|
||||
if (res.data.code == 0) {
|
||||
this.orderInfo = res.data.data
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
window.SITE_CONFIG = {};
|
||||
|
||||
// api接口请求地址
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://ditanxiong.gomyorder.cn/czg';
|
||||
window.SITE_CONFIG['baseUrl'] = 'https://web.hnsiyao.cn/czg';
|
||||
|
||||
// cdn地址 = 域名 + 版本号
|
||||
window.SITE_CONFIG['domain'] = './'; // 域名
|
||||
|
|
|
|||
Loading…
Reference in New Issue