Authored by shijian

save

... ... @@ -21,6 +21,7 @@
},
"license": "MIT",
"dependencies": {
"babel-polyfill": "^6.23.0",
"babel-runtime": "^6.11.6",
"bluebird": "^3.4.2",
"body-parser": "^1.15.2",
... ... @@ -45,6 +46,7 @@
"vue-template-compiler": "^2.3.3",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.3.0",
"yoho-jquery": "^2.2.4",
"yoho-md5": "^2.0.0",
"yoho-node-lib": "0.2.17"
},
... ...
... ... @@ -32,8 +32,9 @@ module.exports = {
parser: scss,
plugins: {
'postcss-import': {
path: [path.join(__dirname, './public/scss')],
path: [],
resolve(id) {
console.log(id);
let name = path.basename(id);
if (!/^_/.test(name)) {
... ... @@ -44,7 +45,6 @@ module.exports = {
},
'postcss-assets': assets,
'postcss-sprites': sprites,
precss: {},
'postcss-pxtorem': {
rootValue: 40,
unitPrecision: 5, // 保留5位小数字
... ... @@ -56,4 +56,4 @@ module.exports = {
browsers: ['> 1%', 'android >=4', 'ios >=8']
}
}
};
};
\ No newline at end of file
... ...
... ... @@ -51,12 +51,9 @@ module.exports = {
loader: 'vue-loader',
options: {
loaders: {
scss: ExtractTextPlugin.extract({
css: ExtractTextPlugin.extract({
use: [
// {
// loader: 'css-loader',
// options: { url: false, root: '../img/' }
// },
{ loader: 'css-loader', options: { url: false, root: '../img/' } },
{ loader: 'postcss-loader' }
],
fallback: 'vue-style-loader'
... ... @@ -74,7 +71,7 @@ module.exports = {
use: ExtractTextPlugin.extract({
fallback: 'vue-style-loader',
use: [
// { loader: 'css-loader', options: { url: false, root: '../img/' } },
{ loader: 'css-loader', options: { url: false, root: '../img/' } },
'postcss-loader'
]
})
... ...
/**
* 全局引用js
* @author: feng.chen<feng.chen@yoho.cn>
* @date: 2017/03/15
*/
const $ = require('yoho-jquery');
const cookie = require('yoho-cookie');
const yoho = require('yoho');
// 初始化
// 注册ajaxError处理服务端401状态
$(document).ajaxError((event, xhr) => {
if (xhr.status === 401) {
cookie.remove('_UID');
cookie.remove('_TOKEN');
if (yoho.isApp) {
yoho.goLogin(window.location.href);
} else {
window.location.href = `/signin.html?refer=${encodeURIComponent(window.location.href)}`;
}
}
});
... ...