Commit 8279acdb by xinlaa

项目搭建初始配置

1 parent 1e690e03
......@@ -993,7 +993,6 @@
"version": "7.12.5",
"resolved": "https://registry.npm.taobao.org/@babel/runtime/download/@babel/runtime-7.12.5.tgz?cache=0&sync_timestamp=1604441289678&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40babel%2Fruntime%2Fdownload%2F%40babel%2Fruntime-7.12.5.tgz",
"integrity": "sha1-QQ5+SHRB4bNgwpvnFdhw2bmFiC4=",
"dev": true,
"requires": {
"regenerator-runtime": "^0.13.4"
}
......@@ -1103,6 +1102,11 @@
"integrity": "sha1-K1o6s/kYzKSKjHVMCBaOPwPrphs=",
"dev": true
},
"@popperjs/core": {
"version": "2.6.0",
"resolved": "https://registry.npm.taobao.org/@popperjs/core/download/@popperjs/core-2.6.0.tgz",
"integrity": "sha1-8CIZWv38lC4IjuIQEoWh0xx9cn8="
},
"@soda/friendly-errors-webpack-plugin": {
"version": "1.8.0",
"resolved": "https://registry.npm.taobao.org/@soda/friendly-errors-webpack-plugin/download/@soda/friendly-errors-webpack-plugin-1.8.0.tgz?cache=0&sync_timestamp=1607927399532&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40soda%2Ffriendly-errors-webpack-plugin%2Fdownload%2F%40soda%2Ffriendly-errors-webpack-plugin-1.8.0.tgz",
......@@ -1408,11 +1412,23 @@
}
}
},
"@vant/icons": {
"version": "1.5.0",
"resolved": "https://registry.npm.taobao.org/@vant/icons/download/@vant/icons-1.5.0.tgz",
"integrity": "sha1-znii8FWhpAmRKbtsRNVFhPN0Dic="
},
"@vant/popperjs": {
"version": "1.0.2",
"resolved": "https://registry.npm.taobao.org/@vant/popperjs/download/@vant/popperjs-1.0.2.tgz?cache=0&sync_timestamp=1607062586092&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vant%2Fpopperjs%2Fdownload%2F%40vant%2Fpopperjs-1.0.2.tgz",
"integrity": "sha1-Ui1xZWI1Elo64I6ccBo7rm/YjXs=",
"requires": {
"@popperjs/core": "^2.5.4"
}
},
"@vue/babel-helper-vue-jsx-merge-props": {
"version": "1.2.1",
"resolved": "https://registry.npm.taobao.org/@vue/babel-helper-vue-jsx-merge-props/download/@vue/babel-helper-vue-jsx-merge-props-1.2.1.tgz?cache=0&sync_timestamp=1602853295839&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2F%40vue%2Fbabel-helper-vue-jsx-merge-props%2Fdownload%2F%40vue%2Fbabel-helper-vue-jsx-merge-props-1.2.1.tgz",
"integrity": "sha1-MWJKelBfsU2h1YAjclpMXycOaoE=",
"dev": true
"integrity": "sha1-MWJKelBfsU2h1YAjclpMXycOaoE="
},
"@vue/babel-helper-vue-transform-on": {
"version": "1.0.0",
......@@ -2389,6 +2405,14 @@
"integrity": "sha1-1h9G2DslGSUOJ4Ta9bCUeai0HFk=",
"dev": true
},
"axios": {
"version": "0.21.1",
"resolved": "https://registry.npm.taobao.org/axios/download/axios-0.21.1.tgz?cache=0&sync_timestamp=1608611162952&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Faxios%2Fdownload%2Faxios-0.21.1.tgz",
"integrity": "sha1-IlY0gZYvTWvemnbVFu8OXTwJsrg=",
"requires": {
"follow-redirects": "^1.10.0"
}
},
"babel-eslint": {
"version": "10.1.0",
"resolved": "https://registry.npm.taobao.org/babel-eslint/download/babel-eslint-10.1.0.tgz",
......@@ -5398,8 +5422,7 @@
"follow-redirects": {
"version": "1.13.1",
"resolved": "https://registry.npm.taobao.org/follow-redirects/download/follow-redirects-1.13.1.tgz?cache=0&sync_timestamp=1607916846877&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Ffollow-redirects%2Fdownload%2Ffollow-redirects-1.13.1.tgz",
"integrity": "sha1-X2m4Ezds7k/QR0o6uoNd8Eq3Y7c=",
"dev": true
"integrity": "sha1-X2m4Ezds7k/QR0o6uoNd8Eq3Y7c="
},
"for-in": {
"version": "1.0.2",
......@@ -9081,8 +9104,7 @@
"regenerator-runtime": {
"version": "0.13.7",
"resolved": "https://registry.npm.taobao.org/regenerator-runtime/download/regenerator-runtime-0.13.7.tgz?cache=0&sync_timestamp=1595456105304&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fregenerator-runtime%2Fdownload%2Fregenerator-runtime-0.13.7.tgz",
"integrity": "sha1-ysLazIoepnX+qrrriugziYrkb1U=",
"dev": true
"integrity": "sha1-ysLazIoepnX+qrrriugziYrkb1U="
},
"regenerator-transform": {
"version": "0.14.5",
......@@ -10987,6 +11009,18 @@
"spdx-expression-parse": "^3.0.0"
}
},
"vant": {
"version": "2.12.2",
"resolved": "https://registry.npm.taobao.org/vant/download/vant-2.12.2.tgz",
"integrity": "sha1-6fKya/L01rXWP+tuAUxY+UjHl8Y=",
"requires": {
"@babel/runtime": "7.x",
"@vant/icons": "1.5.0",
"@vant/popperjs": "^1.0.0",
"@vue/babel-helper-vue-jsx-merge-props": "^1.0.0",
"vue-lazyload": "1.2.3"
}
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npm.taobao.org/vary/download/vary-1.1.2.tgz",
......@@ -11053,6 +11087,11 @@
"integrity": "sha1-UylVzB6yCKPZkLOp+acFdGV+CPI=",
"dev": true
},
"vue-lazyload": {
"version": "1.2.3",
"resolved": "https://registry.npm.taobao.org/vue-lazyload/download/vue-lazyload-1.2.3.tgz",
"integrity": "sha1-kB+ewVx+bKeHgaK65KNDaGve2yw="
},
"vue-loader": {
"version": "15.9.6",
"resolved": "https://registry.npm.taobao.org/vue-loader/download/vue-loader-15.9.6.tgz?cache=0&sync_timestamp=1608188050165&other_urls=https%3A%2F%2Fregistry.npm.taobao.org%2Fvue-loader%2Fdownload%2Fvue-loader-15.9.6.tgz",
......
......@@ -8,7 +8,9 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"vant": "^2.12.2",
"vue": "^2.6.11",
"vue-router": "^3.2.0",
"vuex": "^3.4.0"
......
const config = {
/**
* @description token在Cookie中存储的天数,默认1天
*/
cookieExpires: 1,
/**
* @description 是否使用国际化,默认为false
* 如果不使用,则需要在路由中给需要在菜单中展示的路由设置meta: {title: 'xxx'}
* 用来在菜单中显示文字
*/
useI18n: false,
/**
* @description api请求基础路径
*/
// 测试服
domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.32:8888' : 'http://192.168.1.26:8888', //
// 正式服
// domain: process.env.NODE_ENV === 'development' ? 'http://192.168.1.35:8118' : 'https://gateway.visualinsur.cn:8888', //
/**
* @description 默认打开的首页的路由name值,默认为home
*/
homeName: 'home',
/**
* @description 需要加载的插件
*/
plugin: {
// 'error-store': {
// showInHeader: true, // 设为false后不会在顶部显示错误日志徽标
// developmentOff: false // 设为true后在开发环境不会收集错误信息,方便开发中排查错误
// }
},
// get domain() {
// return process.env.NODE_ENV === 'development' ? this.baseUrl.dev : this.baseUrl.pro
// }
}
config.services = {
}
export default config
\ No newline at end of file
// 全屏转场动画
.slide-left-enter-active,
.slide-right-enter-active {
transition: all 0.2s ease;
}
.slide-left-leave-active,
.slide-right-leave-active {
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-left-enter,
.slide-right-leave-to {
transform: translateX(10px);
opacity: 0;
}
.slide-left-leave-to,
.slide-right-enter {
transform: translateX(-10px);
opacity: 0;
}
// 内页转场动画
.slide-inside-enter-active {
transition: all 0.3s ease;
}
.slide-inside-leave-active {
transition: all 0.3s cubic-bezier(1, 0.5, 0.8, 1);
}
.slide-inside-enter,
.slide-inside-leave-to
/* .slide-down-leave-active for below version 2.1.8 */
{
// position: absolute;
transform: translateY(-10px);
opacity: 0;
}
\ No newline at end of file
@charset "utf-8";
* {
-webkit-box-sizing: border-box;
box-sizing: border-box;
}
/**,*:before,*:after{-moz-box-sizing: border-box;-webkit-box-sizing: border-box;box-sizing: border-box;-webkit-tap-highlight-color: rgba(0,0,0,0);-webkit-tap-highlight-color: transparent;max-height: 100000px;}*/
body,
h1,
h2,
h3,
h4,
h5,
h6,
hr,
p,
blockquote,
dl,
dt,
dd,
ul,
ol,
li,
pre,
form,
fieldset,
legend,
button,
input,
textarea,
th,
td {
margin: 0;
padding: 0;
}
body,input, select, textarea /* for ie */ {
font: 14px Microsoft YaHei, "宋体", arial, -apple-system, "PingFang SC",
"Helvetica Neue", Helvetica, "DejaVu Sans", "Lucida Grande", Tahoma,
"Hiragino Sans GB", STHeiti, SimSun, sans-serif;
line-height: 1.15;
color: #333; /*touch-action: none*/
} /** 设置默认字体 **/
header,
section,
footer,
aside,
nav,
article,
figure {
display: block;
}
input,
button,
select,
textarea {
outline: none;
vertical-align: middle; /*解决父级底部多余空白*/
-webkit-appearance: none; /*去掉webkit默认的表单样式*/
font-size: 100%; /* 使得表单元素在 ie 下能继承字体大小 */
border: none;
background: none;
color: inherit;
}
address,
cite,
dfn,
em,
var {
font-style: normal;
} /* 将斜体扶正 , 注:optgroup 无法扶正 */
h1,
h2,
h3,
h4,
h5,
h6 {
font-size: 100%;
background: none;
}
code,
kbd,
pre,
samp {
font-family: courier new, courier, monospace;
} /* 统一等宽字体 */
object,
embed,
video {
max-width: 100%;
}
a:link,
a:active,
a:visited,
a:hover {
text-decoration: none;
}
table {
border-collapse: collapse;
border-spacing: 0;
}
img {
border: 0;
max-width: 100%;
vertical-align: middle;
} /*解决父级底部多余空白*/
small {
font-size: 12px;
} /* 小于 12px 的中文很难阅读,让 small 正常化 */
legend {
color: #000;
} /*for ie6*/
fieldset {
border: 0;
}
li {
list-style: none;
}
a {
color: inherit;
}
/*click outline for firefox*/
button::-moz-focus-inner,
input[type="reset"]::-moz-focus-inner,
input[type="button"]::-moz-focus-inner,
input[type="submit"]::-moz-focus-inner,
input[type="file"] > input[type="button"]::-moz-focus-inner {
border: none;
}
/*click outline for IE and other browser*/
button:focus,
input[type="reset"]:focus,
input[type="button"]:focus,
input[type="submit"]:focus,
input[type="file"] > input[type="button"]:focus {
outline: none;
}
/* 注意此处合并写法无效 */
input::-webkit-input-placeholder,
textarea::-webkit-input-placeholder {
color: #fff;
font-size: 16px;
}
input::-moz-placeholder,
textarea::-moz-placeholder {
color: #fff;
font-size: 16px;
}
input:-ms-input-placeholder,
textarea:-ms-input-placeholder {
color: #fff;
font-size: 16px;
}
*:not(input, select, textarea) {
-webkit-user-select: none;
} /*禁止选中文本内容*/
::-webkit-scrollbar {
/*滚动条整体样式*/
width: 10px; /*高宽分别对应横竖滚动条的尺寸*/
height: 10px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 10px;
/*深色模式*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
background: #bbb;
/*浅色模式*/
/*-webkit-box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
background: rgb(245, 245, 245);
border: 1px solid #333;
border-bottom-width: 2px;*/
}
::-webkit-scrollbar-track {
/*滚动条里面轨道*/
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 10px;
background: #eee;
}
/* common class */
/*bfc model*/
.bfc-o {
overflow: hidden;
position: relative;
}
.bfc-d {
display: inline-block;
vertical-align: top;
position: relative;
}
.bfc-p {
position: absolute;
}
.fl {
float: left;
position: relative;
}
.fr {
float: right;
position: relative;
}
.al {
text-align: left;
}
.ac {
text-align: center;
}
.ar {
text-align: right;
}
.hide {
display: none;
}
/*top-fixed and bottom-fixed*/
.tf,
.bf {
position: fixed;
width: 100%;
height: 50px;
z-index: 999;
}
.tf {
top: 0;
}
.bf {
bottom: 0;
}
/*mask*/
.mask {
position: fixed;
width: 100%;
height: 100%;
background: rgba(39, 39, 39, 0.76);
left: 0;
bottom: 0;
margin: auto;
z-index: 9;
}
/*center-center*/
.cc {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
overflow: auto;
}
/*t-o-h-e*/
.toe {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
/*close*/
.close {
position: relative;
float: right;
width: 20px;
height: 20px;
line-height: 20px;
background: #f8f8f8;
text-align: center;
cursor: pointer;
}
/* pc frame */
.wrapper {
position: relative;
max-width: 1920px;
min-width: 1020px;
margin: 0 auto;
padding: 0 15px;
overflow: hidden;
}
.cp {
cursor: pointer;
}
@color: #42b9fd;
@colorSub: #4ee699;
@colorSubDeep: #34b071;
@borderColor: #106ed2;
@inputBgColor: #14344b;
@fontColor: #999;
// 画三角形
.triangle(@_, @wwww, @ccccc) {
width: 0px;
height: 0px;
overflow: hidden;
}
.triangle(L, @w, @c) {
border-width: @w;
border-style: dashed solid dashed dashed;
border-color: transparent @c transparent transparent;
}
.triangle(R, @w, @c) {
border-width: @w;
border-style: dashed dashed dashed solid;
border-color: transparent transparent transparent @c;
}
.triangle(T, @w, @c) {
border-width: @w;
border-style: dashed dashed solid dashed;
border-color: transparent transparent @c transparent;
}
.triangle(B, @w, @c) {
border-width: @w;
border-style: solid dashed dashed dashed;
border-color: @c transparent transparent transparent;
}
// 单边框
.border(single, @position: bottom, @color, @width: 1px) {
border-@{position}: @width solid @color;
}
// 全边框
.border(@color, @width: 1px) when (default()) {
border: @width solid @color;
}
import axios from axios
import config from "@/config"
function createAxios(baseUrl) {
const instance = axios.create({
baseUrl,
headers: {
Auth_token: ""
},
timeout: 3000,
})
// 请求拦截
instance.interceptors.request.use(config => {
// console.log('request config: ' + JSON.stringify(config))
return config
}, error => {
return Promise.reject(error)
})
// 响应拦截
instance.interceptors.response.use(res => {
// console.log('res: ' + res)
const { data, status } = res
// code 0:成功,-1/其它:错误
if (status === 200 && data.code === 0) {
return JSON.stringify(data.result) ? data.result : data.data
} else if (data.code === 201) {
// Message.error({
// content: `产品已存在`,
// duration: 3
// })
} else {
addErrorLog(res)
}
if (process.env.NODE_ENV === 'development') {
return Promise.reject(res) // 这样控制台会显示报错日志
} else {
return new Promise(() => { }) // 中断promise
}
}, error => {
if (error.response) {
addErrorLog(error.response)
} else {
// Message.error({
// content: `服务器未启动或连接超时`,
// duration: 3
// })
console.error("服务器未启动或连接超时")
}
return Promise.reject(error)
})
// 错误日志
const addErrorLog = errorInfo => {
const { data, statusText, status, request: { responseText, responseURL } } = errorInfo
// let info = {
// type: 'ajax',
// code: status,
// mes: statusText,
// url: responseURL
// }
// if (!responseURL.includes('save_error_logger')) store.dispatch('addErrorLog', info)
process.env.NODE_ENV === 'development'
? console.error(`错误: 路径: ${responseURL}, 返回值 : ${responseText}`,)
: console.error(`${JSON.parse(responseText).message}`,)
}
return instance
}
// const httpRequest = createAxios()
export default createAxios(config.domain)
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!