优化前端显示代码

pull/1/head
xiaoyu 4 years ago
parent 0521f0c6a0
commit 3861b0a84f
  1. 14
      fir_client/babel.config.js
  2. 1
      fir_client/package.json
  3. 103
      fir_client/src/main.js
  4. 8
      fir_client/src/restful/index.js
  5. 3
      fir_client/src/utils/index.js
  6. 24
      fir_client/vue.config.js

@ -1,5 +1,15 @@
module.exports = { module.exports = {
presets: [ presets: [
'@vue/cli-plugin-babel/preset' '@vue/cli-plugin-babel/preset',
"@babel/preset-env",
],
"plugins": [
[
"component",
{
"libraryName": "element-ui",
"styleLibraryName": "theme-chalk"
}
]
] ]
}; };

@ -26,6 +26,7 @@
"@vue/cli-plugin-eslint": "^4.1.0", "@vue/cli-plugin-eslint": "^4.1.0",
"@vue/cli-service": "^4.1.0", "@vue/cli-service": "^4.1.0",
"babel-eslint": "^10.0.3", "babel-eslint": "^10.0.3",
"babel-plugin-component": "^1.1.1",
"eslint": "^5.16.0", "eslint": "^5.16.0",
"eslint-plugin-vue": "^5.0.0", "eslint-plugin-vue": "^5.0.0",
"vue-template-compiler": "^2.6.10" "vue-template-compiler": "^2.6.10"

@ -1,12 +1,17 @@
import Vue from 'vue' import Vue from 'vue'
import App from "@/App"; import App from "@/App";
import router from "@/router"; import router from "@/router";
import ElementUI from 'element-ui' // import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' import 'element-ui/lib/theme-chalk/index.css'
import Vuex from 'vuex' import Vuex from 'vuex'
const qiniu = require('qiniu-js'); import qiniu from 'qiniu-js'
import oss from 'ali-oss'
// const qiniu = require('qiniu-js');
//
Vue.prototype.qiniu = qiniu; Vue.prototype.qiniu = qiniu;
Vue.prototype.oss = oss;
//使用vue-cookies //使用vue-cookies
import VueCookies from 'vue-cookies' import VueCookies from 'vue-cookies'
@ -41,7 +46,99 @@ router.beforeEach((to, from, next) => {
Vue.config.productionTip = false; Vue.config.productionTip = false;
Vue.use(ElementUI); import {
Button,
Select,
Table,
TableColumn,
Input,
DatePicker,
Container,
Aside,
Col,
Header,
Popover,
Main,
Dialog,
Checkbox,
CheckboxGroup,
Pagination,
Option,
Upload,
Tabs,
TabPane,
Form,
FormItem,
Divider,
Message,
Row,
ButtonGroup,
MessageBox,
Image,
Loading,
Tag,
Tooltip,
Switch,
Link,
BreadcrumbItem,
Slider,
DropdownMenu,
Dropdown,
Breadcrumb,Avatar,DropdownItem,RadioButton,RadioGroup,OptionGroup,Progress,Timeline,TimelineItem,Card
} from "element-ui";
Vue.use(Progress);
Vue.use(OptionGroup);
Vue.use(Link);
Vue.use(Timeline);
Vue.use(TimelineItem);
Vue.use(Card);
Vue.use(RadioButton);
Vue.use(RadioGroup);
Vue.use(Avatar);
Vue.use(DropdownItem);
Vue.use(BreadcrumbItem);
Vue.use(Slider);
Vue.use(DropdownMenu);
Vue.use(Dropdown);
Vue.use(Breadcrumb);
Vue.use(Input);
Vue.use(CheckboxGroup);
Vue.use(DatePicker);
Vue.use(Button);
Vue.use(ButtonGroup);
Vue.use(Container);
Vue.use(Aside);
Vue.use(Col);
Vue.use(Header);
Vue.use(Popover);
Vue.use(Main);
Vue.use(Dialog);
Vue.use(Checkbox);
Vue.use(Pagination);
Vue.use(Select);
Vue.use(Option);
Vue.use(Table);
Vue.use(TableColumn);
Vue.use(Upload);
Vue.use(Tabs);
Vue.use(TabPane);
Vue.use(Form);
Vue.use(FormItem);
Vue.use(Divider);
Vue.use(Row);
Vue.use(Image);
Vue.use(Loading);
Vue.use(Tag);
Vue.use(Tooltip);
Vue.use(Switch);
Vue.prototype.$message = Message;
// Vue.use(MessageBox);
Vue.prototype.$confirm = MessageBox.confirm;
// Vue.use(ElementUI);
Vue.use(Vuex); Vue.use(Vuex);

@ -2,13 +2,13 @@ import Axios from 'axios'
import VueCookies from 'vue-cookies' import VueCookies from 'vue-cookies'
import router from "../router"; import router from "../router";
const https = require('https'); // const https = require('https');
const Base64 = require('js-base64').Base64; const Base64 = require('js-base64').Base64;
Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded'; Axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
Axios.defaults.withCredentials = true; Axios.defaults.withCredentials = true;
Axios.defaults.httpsAgent = new https.Agent({ // Axios.defaults.httpsAgent = new https.Agent({
keepAlive: true // keepAlive: true
}); // });
const DOMAIN = 'https://fly.harmonygames.cn'; const DOMAIN = 'https://fly.harmonygames.cn';

@ -125,9 +125,8 @@ export function dataURLtoFile(dataurl, filename) {//将base64转换为文件
} }
export function uploadaliyunoss(file, certinfo, app, successcallback, processcallback) { export function uploadaliyunoss(file, certinfo, app, successcallback, processcallback) {
const OSS = require('ali-oss');
let token = certinfo.upload_token; let token = certinfo.upload_token;
let client = new OSS({ let client = new app.oss({
endpoint: token.endpoint, endpoint: token.endpoint,
accessKeyId: token.access_key_id, accessKeyId: token.access_key_id,
accessKeySecret: token.access_key_secret, accessKeySecret: token.access_key_secret,

@ -0,0 +1,24 @@
'use strict';
module.exports = {
pages: {
index: {
// page 的入口
entry: 'src/main.js',
// 模板来源
template: 'public/index.html',
// 在 dist/index.html 的输出
filename: 'index.html',
// 当使用 title 选项时,
// template 中的 title 标签需要是 <title><%= htmlWebpackPlugin.options.title %></title>
title: 'FlyApp',
// 在这个页面中包含的块,默认情况下会包含
// 提取出来的通用 chunk 和 vendor chunk。
chunks: ['chunk-vendors', 'chunk-common', 'index']
},
},
productionSourceMap:false
};
Loading…
Cancel
Save