diff --git a/README.md b/README.md
index 6b4fea47e6..b71d8dc8e7 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+# guors-goldenhome
+> dudududududu
# vue-webpack-boilerplate
> A full-featured Webpack setup with hot-reload, lint-on-save, unit testing & css extraction.
diff --git a/template/README.md b/template/README.md
index 4b0258a35b..20fb821c01 100644
--- a/template/README.md
+++ b/template/README.md
@@ -1,6 +1,10 @@
-# {{ name }}
+# githubtemp
-> {{ description }}
+默认使用vux,vuex,axios,vue-router
+
+封装axios请求,添加拦截,公共处理请求。
+
+> A Vue.js project
## Build Setup
@@ -16,21 +20,6 @@ npm run build
# build for production and view the bundle analyzer report
npm run build --report
-{{#unit}}
-
-# run unit tests
-npm run unit
-{{/unit}}
-{{#e2e}}
-
-# run e2e tests
-npm run e2e
-{{/e2e}}
-{{#if_or unit e2e}}
-
-# run all tests
-npm test
-{{/if_or}}
```
For a detailed explanation on how things work, check out the [guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader).
diff --git a/template/src/App.vue b/template/src/App.vue
index 0156030e49..ffda99645e 100644
--- a/template/src/App.vue
+++ b/template/src/App.vue
@@ -1,25 +1,27 @@
-

- {{#router}}
+
- {{else}}
-
- {{/router}}
diff --git a/template/src/api/test.js b/template/src/api/test.js
new file mode 100644
index 0000000000..fe46f90a61
--- /dev/null
+++ b/template/src/api/test.js
@@ -0,0 +1,16 @@
+import fetch from '../utils/fetch';
+
+export function testRequest (id) {
+ return fetch({
+ url: process.env.BASE_API + '/jeegoldenhome/jrest/goldenhomecrm/dictApi/getDictList?type=' + id,
+ method: 'get'
+ });
+}
+
+export function request (params) {
+ return fetch({
+ url: process.env.BASE_API + '/grs/guors',
+ method: 'post',
+ data: params
+ });
+}
diff --git a/template/src/assets/d-plus.png b/template/src/assets/d-plus.png
new file mode 100644
index 0000000000..50f0b383c3
Binary files /dev/null and b/template/src/assets/d-plus.png differ
diff --git a/template/src/components/HelloWorld.vue b/template/src/components/HelloWorld.vue
index ce0edd8ac1..dd059b836c 100644
--- a/template/src/components/HelloWorld.vue
+++ b/template/src/components/HelloWorld.vue
@@ -1,97 +1,42 @@
-
\{{ msg }}
-
Essential Links
-
-
Ecosystem
-
+
MY NAME IS {{ name }}
+
run
diff --git a/template/src/main.js b/template/src/main.js
index 48833b5ab7..478f0d06dc 100644
--- a/template/src/main.js
+++ b/template/src/main.js
@@ -1,26 +1,26 @@
-{{#if_eq build "standalone"}}
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
-{{/if_eq}}
-import Vue from 'vue'
-import App from './App'
-{{#router}}
-import router from './router'
-{{/router}}
+import Vue from 'vue';
+import App from './App';
+import router from './router';
+import axios from 'axios';
+import store from './store';
+import { AlertPlugin, ToastPlugin, ConfirmPlugin, LoadingPlugin } from 'vux';
+Vue.use(AlertPlugin);
+Vue.use(ToastPlugin);
+Vue.use(ConfirmPlugin);
+Vue.use(LoadingPlugin);
-Vue.config.productionTip = false
+Vue.prototype.$http = axios;
+Vue.config.productionTip = false;
+
+console.log(process.env.BASE_API);
/* eslint-disable no-new */
new Vue({
- el: '#app',
- {{#router}}
- router,
- {{/router}}
- {{#if_eq build "runtime"}}
- render: h => h(App)
- {{/if_eq}}
- {{#if_eq build "standalone"}}
- components: { App },
- template: ''
- {{/if_eq}}
-})
+ el: '#app',
+ store,
+ router,
+ components: { App },
+ template: ''
+});
diff --git a/template/src/router/index.js b/template/src/router/index.js
index 5fa7f9d319..b68ef548fa 100644
--- a/template/src/router/index.js
+++ b/template/src/router/index.js
@@ -1,15 +1,21 @@
-import Vue from 'vue'
-import Router from 'vue-router'
-import HelloWorld from '@/components/HelloWorld'
+import Vue from 'vue';
+import Router from 'vue-router';
+import HelloWorld from '@/components/HelloWorld';
+import Test from '@/components/Test';
-Vue.use(Router)
+Vue.use(Router);
export default new Router({
- routes: [
- {
- path: '/',
- name: 'HelloWorld',
- component: HelloWorld
- }
- ]
-})
+ routes: [
+ {
+ path: '/',
+ name: 'HelloWorld',
+ component: HelloWorld
+ },
+ {
+ path: '/Test',
+ name: 'Test',
+ component: Test
+ }
+ ]
+});
diff --git a/template/src/store/actions.js b/template/src/store/actions.js
new file mode 100644
index 0000000000..1ac53673af
--- /dev/null
+++ b/template/src/store/actions.js
@@ -0,0 +1,12 @@
+const actions = {
+ changeName ({commit}, payload) { // 自定义触发mutations里函数的方法,context与store 实例具有相同方法和属性
+ return new Promise((resolve, reject) => {
+ setTimeout(() => {
+ commit('CHANGE_NAME');
+ resolve();
+ }, 500);
+ });
+ }
+};
+
+export default actions;
diff --git a/template/src/store/getters.js b/template/src/store/getters.js
new file mode 100644
index 0000000000..814651f3b8
--- /dev/null
+++ b/template/src/store/getters.js
@@ -0,0 +1,8 @@
+const getters = {
+ name: state => state.name,
+ age: state => state.age,
+ sex: (state, getters) => {
+ return getters.name + state.sex;
+ }
+};
+export default getters;
diff --git a/template/src/store/index.js b/template/src/store/index.js
new file mode 100644
index 0000000000..259691f60a
--- /dev/null
+++ b/template/src/store/index.js
@@ -0,0 +1,24 @@
+import Vue from 'vue';
+import Vuex from 'vuex';
+import getters from './getters';
+import mutations from './mutations';
+import actions from './actions';
+
+Vue.use(Vuex);
+
+const state = {
+ name: '1',
+ age: '',
+ sex: 'boy',
+ userInfo: { mobile: '12345678901' }
+};
+
+const store = new Vuex.Store({
+ state,
+ getters,
+ mutations,
+ actions,
+ modules: {}
+});
+
+export default store;
diff --git a/template/src/store/mutations.js b/template/src/store/mutations.js
new file mode 100644
index 0000000000..9b38ada918
--- /dev/null
+++ b/template/src/store/mutations.js
@@ -0,0 +1,11 @@
+const mutations = {
+ CHANGE_NAME: (state, payload) => {
+ // return new Promise((resolve, reject) => {
+ // console.log(payload);
+ state.name++;
+ // resolve();
+ // });
+ }
+};
+
+export default mutations;
diff --git a/template/src/utils/fetch.js b/template/src/utils/fetch.js
new file mode 100644
index 0000000000..4ddd2635df
--- /dev/null
+++ b/template/src/utils/fetch.js
@@ -0,0 +1,88 @@
+import axios from 'axios';
+// import {
+// Message,
+// MessageBox
+// } from 'element-ui';
+// import store from '../store';
+// import {
+// getToken
+// } from 'utils/auth';
+
+// 创建axios实例
+const service = axios.create({
+ // baseURL: process.env.BASE_API, // api的base_url
+ timeout: 5000 // 请求超时时间
+});
+
+// request拦截器
+service.interceptors.request.use(config => {
+ // // Do something before request is sent
+ // if (store.getters.token) {
+ // // 让每个请求携带token--['Authorization']为自定义key 请根据实际情况自行修改
+ // config.headers['Authorization'] = getToken();
+ // }
+ return config;
+}, error => {
+ // Do something with request error
+ console.log(error); // for debug
+ Promise.reject(error);
+});
+
+// respone拦截器
+service.interceptors.response.use(
+ response => {
+ /**
+ * 下面的注释为通过response自定义code来标示请求状态,当code返回如下情况为权限有问题,登出并返回到登录页
+ * 如通过xmlhttprequest 状态码标识 逻辑可写在下面error中
+ */
+ // const res = response.data;
+ return response.data;
+ // if (response.status === 401 || res.status === 40101) {
+ // MessageBox.confirm('你已被登出,可以取消继续留在该页面,或者重新登录', '确定登出', {
+ // confirmButtonText: '重新登录',
+ // cancelButtonText: '取消',
+ // type: 'warning'
+ // }).then(() => {
+ // store.dispatch('FedLogOut').then(() => {
+ // location.reload(); // 为了重新实例化vue-router对象 避免bug
+ // });
+ // });
+ // return Promise.reject(new Error('error'));
+ // }
+ // if (res.status === 40301) {
+ // Message({
+ // message: '当前用户无相关操作权限!',
+ // type: 'error',
+ // duration: 5 * 1000
+ // });
+ // return Promise.reject(new Error('error'));
+ // }
+ // if (res.status === 40001) {
+ // Message({
+ // message: '账户或密码错误!',
+ // type: 'warning'
+ // });
+ // return Promise.reject(new Error('error'));
+ // }
+ // if (response.status !== 200 && res.status !== 200) {
+ // Message({
+ // message: res.message,
+ // type: 'error',
+ // duration: 5 * 1000
+ // });
+ // } else {
+ // return response.data;
+ // }
+ },
+ error => {
+ console.log(error); // for debug
+ // Message({
+ // message: error.message,
+ // type: 'error',
+ // duration: 5 * 1000
+ // });
+ return Promise.reject(error);
+ }
+);
+
+export default service;
diff --git a/template/src/utils/validate.js b/template/src/utils/validate.js
new file mode 100644
index 0000000000..99c6925d37
--- /dev/null
+++ b/template/src/utils/validate.js
@@ -0,0 +1,35 @@
+/* 是否是公司邮箱 */
+export function isWscnEmail (str) {
+ const reg = /^[a-z0-9](?:[-_.+]?[a-z0-9]+)*@wallstreetcn\.com$/i
+ return reg.test(str.trim())
+}
+
+/* 合法uri */
+export function validateURL (textval) {
+ const urlregex = /^(https?|ftp):\/\/([a-zA-Z0-9.-]+(:[a-zA-Z0-9.&%$-]+)*@)*((25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9][0-9]?)(\.(25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}|([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+\.(com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|[a-zA-Z]{2}))(:[0-9]+)*(\/($|[a-zA-Z0-9.,?'\\+&%$#=~_-]+))*$/
+ return urlregex.test(textval)
+}
+
+/* 小写字母 */
+export function validateLowerCase (str) {
+ const reg = /^[a-z]+$/
+ return reg.test(str)
+}
+
+/* 验证key */
+// export function validateKey(str) {
+// var reg = /^[a-z_\-:]+$/;
+// return reg.test(str);
+// }
+
+/* 大写字母 */
+export function validateUpperCase (str) {
+ const reg = /^[A-Z]+$/
+ return reg.test(str)
+}
+
+/* 大小写字母 */
+export function validatAlphabets (str) {
+ const reg = /^[A-Za-z]+$/
+ return reg.test(str)
+}