Authored by weiqingting

限购码转测

... ... @@ -9,6 +9,9 @@ var gulp=require('gulp'),
autoprefixer = require('gulp-autoprefixer'),
server = require('gulp-develop-server'),
webpack = require('webpack');
var crypto = require('crypto');
var rename = require("gulp-rename");
var clean = require('gulp-clean');
var wconfig = require('./webpack.config');
... ... @@ -29,6 +32,7 @@ var dist_dir = {
};
var cdn_domain = 'http://cdn.yoho.cn/';
var md5="";
var ftpConfig = {
host: '218.94.75.58',
... ... @@ -41,7 +45,7 @@ gulp.task('default',["sass","js"]);
gulp.task('start',["default","default-watch","server"]);
gulp.task('build',["buildjs","assets","static-config"]);
gulp.task('build',["clean","buildjs","assets","static-config"]);//"static-config"
//预编译css
gulp.task('sass', function() {
... ... @@ -64,13 +68,20 @@ gulp.task("default-watch",function(){
gulp.watch('sass/**/*.scss', ['sass']);
gulp.watch('js/**/*.js', ['js']);
});
gulp.task("clean",function(){
return gulp.src(dist_dir.js, {read: false})
.pipe(clean());
});
//发布js文件
gulp.task("buildjs",["js"],function(){
gulp.src(dist_dir.js + '/libs.js')
md5="-"+crypto.createHash('md5').update(new Date().toString()).digest('hex');
console.log(md5);
gulp.src(path.join(public_dir,"dist") + '/*.js')
.pipe(uglify())
.pipe(md5())
.pipe(gulp.dest('./dist/libs'));
.pipe(rename({
suffix:md5
}))
.pipe(gulp.dest(dist_dir.js));
});
//发布静态资源
gulp.task('assets', function() {
... ... @@ -93,19 +104,15 @@ gulp.task("static-config",function(){
var files = fs.readdirSync('./dist/libs');
var staticConfig={
test:{
libs: '/dist/libs.js',
js: '/dist/index.js',
css:'/css/all.css'
path:'/dist'
},
preview: {
libs: cdn_domain + 'libs/' + files[0],
js: cdn_domain + config.name + '/' + config.version + '/index.js',
css: cdn_domain + config.name + '/' + config.version + '/all.css'
path: cdn_domain + config.name + '/' + config.version,
md5:md5
},
production: {
libs: cdn_domain + 'libs/' + files[0],
js: cdn_domain + config.name + '/' + config.version + '/index.js',
css: cdn_domain + config.name + '/' + config.version + '/all.css'
path: cdn_domain + config.name + '/' + config.version,
md5:md5
}
}
fs.writeFileSync('../server/staticConfig.js', "exports.staticDir = " + JSON.stringify(staticConfig));
... ...
... ... @@ -132,7 +132,7 @@ var edit=require('../common/edit');
res=res.data;
if(res.code=="200"){
e.$tip('提交成功',function(){
location.href="/coupon/index";
location.href="/market/coupon/index";
},'growl-success');
}else{
e.$tip(res.message);
... ...
... ... @@ -204,7 +204,7 @@ $('#basicTable').on('click', '.apply-success', function() {
return {
id:item.id,
status:1,
operations:reason
operations:"申请通过"
};
}
Bll.definetoast("您确定要通过该申请吗?",data,function(){
... ...
... ... @@ -114,11 +114,13 @@ var Bll={
//审核通过
$('#basicTable').on('click', '.apply-success', function() {
var item=g.rows[$(this).data("index")];
var data= {
var data=function(){
return{
id:item.id,
status:1,
reason:"预算不够"
};
};
Bll.toast("确定要通过该申请吗?",data);
});
... ...
... ... @@ -23,15 +23,18 @@
"buildArgs": "--idleading {{name}}"
},
"devDependencies": {
"crypto": "0.0.3",
"extract-text-webpack-plugin": "^1.0.1",
"gulp": "^3.9.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-clean": "^0.3.1",
"gulp-concat": "^2.6.0",
"gulp-develop-server": "^0.5.0",
"gulp-md5": "^0.1.2",
"gulp-plumber": "^1.1.0",
"gulp-rename": "^1.2.2",
"gulp-sass": "^2.0.4",
"gulp-uglify": "^1.5.2",
"gulp-sass":"^2.0.4",
"webpack": "^1.12.13"
},
"scripts": {
... ...
... ... @@ -45,14 +45,14 @@ exports.post = function(data, req, res) {
res.redirect(url);
} else {
res.render('error/error_nolayout',{message:'登陆失败!',layout:false});
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false});
}
});
return;
} else {
//否则跳转错误
res.render('error/error_nolayout',{message:'登陆失败!',layout:false});
res.render('error/error_nolayout',{message:'用户名或者密码错误!',layout:false});
return;
}
}
\ No newline at end of file
... ...
exports.domain =require('../config/common.js').domain;
exports.domain ="http://172.16.6.220:8080/yohobuy-platform-web";//require('../config/common.js').domain;
//路由配置
exports.res = [{
... ...
<section>
<div class="notfoundpanel">
<h3>出错了!</h3>
<h3>{{message}}</h3>
<a href="{{reloadUrl}}">刷新</a>
</div>
... ...
... ... @@ -13,7 +13,6 @@
<body class="pace-done">
<section>
<div class="notfoundpanel">
<h3>出错了!</h3>
<h3>{{message}}</h3>
<a href="{{reloadUrl}}">刷新</a>
</div>
... ...
... ... @@ -20,11 +20,11 @@ seajs.use('{{module}}',function(m){
<script src="/dist/libs.js"></script>
<script src="/dist/index.js"></script>
{{else}}
<script src="{{_env.cur.libs}}"></script>
<script src="{{_env.cur.js}}"></script>
<script src="{{_env.cur.path}}/lib{{_env.cur.md5}}.js"></script>
<script src="{{_env.cur.path}}/index{{_env.cur.md5}}.js"></script>
{{/if}}
{{#if module}}
<script src="/{{module}}.js"></script>
<script src="{{_env.cur.path}}/{{module}}{{_env.cur.md5}}.js"></script>
{{/if}}
{{/if}}
... ...