@ -0,0 +1,3 @@ |
|||
> 1% |
|||
last 2 versions |
|||
not dead |
@ -0,0 +1,8 @@ |
|||
[*.{js,jsx,ts,tsx,vue}] |
|||
indent_style = space |
|||
indent_size = 2 |
|||
end_of_line = lf |
|||
trim_trailing_whitespace = true |
|||
insert_final_newline = true |
|||
max_line_length = 140 |
|||
root = true |
@ -0,0 +1,3 @@ |
|||
VUE_APP_MODE=production |
|||
VUE_APP_PREVIEW=false |
|||
VUE_APP_URL=http://www.sxwikionline.com/ |
@ -0,0 +1,10 @@ |
|||
VUE_APP_MODE=development |
|||
VUE_APP_NODE_ENV=development |
|||
VUE_APP_SCENE=greenvalley |
|||
VUE_APP_BASE_URL=http://www.sxwikionline.com/ |
|||
VUE_APP_API_URL=http://www.sxwikionline.com/gateway |
|||
VUE_APP_PROXY_URL=/gateway |
|||
VUE_APP_PUBLIC_PATH=/greenvalley |
|||
VUE_APP_MSG_URL=wss://test.tall.wiki/websocket/message/v4.0/ws |
|||
VUE_APP_TITLE=绿谷在线 |
|||
VUE_APP_DESCRIPTION=绿谷在线管理后台 |
@ -0,0 +1,10 @@ |
|||
VUE_APP_MODE=production |
|||
VUE_APP_NODE_ENV=production |
|||
VUE_APP_SCENE=greenvalley |
|||
VUE_APP_BASE_URL=http://www.sxwikionline.com/ |
|||
VUE_APP_API_URL=http://www.sxwikionline.com/gateway |
|||
VUE_APP_PROXY_URL=/gateway |
|||
VUE_APP_PUBLIC_PATH=/greenvalley |
|||
VUE_APP_MSG_URL=wss://www.tall.wiki/websocket/message/v4.0/ws |
|||
VUE_APP_TITLE=绿谷在线 |
|||
VUE_APP_DESCRIPTION=绿谷在线管理后台 |
@ -0,0 +1,47 @@ |
|||
/* |
|||
* Copyright (c) 2019. |
|||
* author: wally |
|||
* email: 18603454788@163.com |
|||
*/ |
|||
|
|||
module.exports = { |
|||
root: true, |
|||
env: { browser: true, node: true }, |
|||
extends: ['plugin:vue/recommended', 'plugin:vue/essential'], |
|||
|
|||
rules: { |
|||
'vue/html-self-closing': 'off', |
|||
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', |
|||
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', |
|||
'no-param-reassign': ['error', { props: true, ignorePropertyModificationsFor: ['state'] }], |
|||
'max-len': ['error', { code: 140, tabWidth: 2 }], |
|||
'object-curly-newline': ['error', { multiline: true }], |
|||
'arrow-parens': ['error', 'as-needed'], |
|||
'linebreak-style': 'off', |
|||
'vue/attributes-order': 'off', |
|||
'no-param-reassign': 'off', |
|||
'vue/singleline-html-element-content-newline': 'off', |
|||
'vue/max-attributes-per-line': 'off', |
|||
'vue/multiline-html-element-content-newline': 'off', |
|||
'vue/html-indent': 'off', |
|||
}, |
|||
|
|||
parserOptions: { parser: 'babel-eslint' }, |
|||
|
|||
overrides: [ |
|||
{ |
|||
files: ['**/__tests__/*.{j,t}s?(x)'], |
|||
env: { jest: true }, |
|||
}, |
|||
], |
|||
|
|||
globals: { |
|||
Vue: true, |
|||
VueRouter: true, |
|||
Vuex: true, |
|||
axios: true, |
|||
_: true, |
|||
Vuetify: true, |
|||
vuetify: true, |
|||
}, |
|||
}; |
@ -0,0 +1,23 @@ |
|||
.DS_Store |
|||
node_modules |
|||
/dist |
|||
|
|||
|
|||
# local env files |
|||
.env.local |
|||
.env.*.local |
|||
|
|||
# Log files |
|||
npm-debug.log* |
|||
yarn-debug.log* |
|||
yarn-error.log* |
|||
pnpm-debug.log* |
|||
|
|||
# Editor directories and files |
|||
.idea |
|||
.vscode |
|||
*.suo |
|||
*.ntvs* |
|||
*.njsproj |
|||
*.sln |
|||
*.sw? |
@ -0,0 +1,13 @@ |
|||
{ |
|||
"printWidth": 140, |
|||
"singleQuote": true, |
|||
"semi": true, |
|||
"trailingComma": "all", |
|||
"arrowParens": "avoid", |
|||
"tabWidth": 2, |
|||
"useTabs": false, |
|||
"bracketSpacing": true, |
|||
"jsxBracketSameLine": false, |
|||
"proseWrap": "always", |
|||
"endOfLine": "lf" |
|||
} |
@ -0,0 +1,24 @@ |
|||
# green-valley |
|||
|
|||
## Project setup |
|||
``` |
|||
yarn install |
|||
``` |
|||
|
|||
### Compiles and hot-reloads for development |
|||
``` |
|||
yarn serve |
|||
``` |
|||
|
|||
### Compiles and minifies for production |
|||
``` |
|||
yarn build |
|||
``` |
|||
|
|||
### Lints and fixes files |
|||
``` |
|||
yarn lint |
|||
``` |
|||
|
|||
### Customize configuration |
|||
See [Configuration Reference](https://cli.vuejs.org/config/). |
@ -0,0 +1,13 @@ |
|||
module.exports = { |
|||
presets: ["@vue/cli-plugin-babel/preset"], |
|||
plugins: [ |
|||
[ |
|||
"import", |
|||
{ |
|||
libraryName: "ant-design-vue", |
|||
libraryDirectory: "es", |
|||
style: true |
|||
} |
|||
] |
|||
] |
|||
}; |
@ -0,0 +1 @@ |
|||
module.exports = {extends: ['./node_modules/vue-cli-plugin-commitlint/lib/lint']}; |
@ -0,0 +1,49 @@ |
|||
{ |
|||
"name": "green-valley", |
|||
"version": "0.1.0", |
|||
"private": true, |
|||
"scripts": { |
|||
"serve": "vue-cli-service serve", |
|||
"build": "vue-cli-service build", |
|||
"lint": "vue-cli-service lint" |
|||
}, |
|||
"dependencies": { |
|||
"ant-design-vue": "^1.2.4", |
|||
"compression-webpack-plugin": "^6.1.1", |
|||
"core-js": "^3.6.5", |
|||
"moment": "^2.29.1", |
|||
"register-service-worker": "^1.7.1", |
|||
"stylus": "^0.54.8", |
|||
"vue": "^2.6.11", |
|||
"vue-dompurify-html": "^2.3.0", |
|||
"vue-router": "^3.2.0", |
|||
"vuex": "^3.4.0" |
|||
}, |
|||
"devDependencies": { |
|||
"@vue/cli-plugin-babel": "~4.5.0", |
|||
"@vue/cli-plugin-eslint": "~4.5.0", |
|||
"@vue/cli-plugin-pwa": "~4.5.0", |
|||
"@vue/cli-plugin-router": "~4.5.0", |
|||
"@vue/cli-plugin-vuex": "~4.5.0", |
|||
"@vue/cli-service": "~4.5.0", |
|||
"@vue/eslint-config-prettier": "^6.0.0", |
|||
"axios": "^0.18.0", |
|||
"babel-eslint": "^10.1.0", |
|||
"babel-plugin-import": "^1.11.0", |
|||
"css-loader": "^5.0.1", |
|||
"eslint": "^6.7.2", |
|||
"eslint-plugin-prettier": "^3.1.3", |
|||
"eslint-plugin-vue": "^6.2.2", |
|||
"less": "^2.7.3", |
|||
"less-loader": "^4.1.0", |
|||
"prettier": "^1.19.1", |
|||
"sass": "^1.26.5", |
|||
"sass-loader": "^8.0.2", |
|||
"stylus": "^0.54.5", |
|||
"stylus-loader": "^3.0.2", |
|||
"svg-sprite-loader": "^5.0.0", |
|||
"vue-cli-plugin-ant-design": "^1.0.1", |
|||
"vue-cli-plugin-axios": "^0.0.4", |
|||
"vue-template-compiler": "^2.6.11" |
|||
} |
|||
} |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 9.2 KiB |
After Width: | Height: | Size: 29 KiB |
After Width: | Height: | Size: 6.3 KiB |
After Width: | Height: | Size: 22 KiB |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 4.0 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 4.6 KiB |
After Width: | Height: | Size: 799 B |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.2 KiB |
After Width: | Height: | Size: 215 B |
@ -0,0 +1,17 @@ |
|||
<!DOCTYPE html> |
|||
<html lang="en"> |
|||
<head> |
|||
<meta charset="utf-8"> |
|||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> |
|||
<meta name="viewport" content="width=device-width,initial-scale=1.0"> |
|||
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> |
|||
<title><%= htmlWebpackPlugin.options.title %></title> |
|||
</head> |
|||
<body> |
|||
<noscript> |
|||
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong> |
|||
</noscript> |
|||
<div id="app"></div> |
|||
<!-- built files will be auto injected --> |
|||
</body> |
|||
</html> |
@ -0,0 +1,2 @@ |
|||
User-agent: * |
|||
Disallow: |
@ -0,0 +1,15 @@ |
|||
{ |
|||
"$shared": { |
|||
"version": "v1", |
|||
"identifier": "wally", |
|||
"credential": "111111" |
|||
}, |
|||
"dev": { |
|||
"name": "dev", |
|||
"url": "http://192.168.0.99/gateway" |
|||
}, |
|||
"local": { |
|||
"version": "v2", |
|||
"url": "http://192.168.0.99/gateway" |
|||
} |
|||
} |
@ -0,0 +1,56 @@ |
|||
# @tall = {{url}}/tall/v1.0 |
|||
@tall = http://www.sxwikionline.com/gateway/tall/v1.0 |
|||
@greenvalley = http://www.sxwikionline.com/gateway/greenvalley |
|||
@type = content-type: application/json;charset=utf-8 |
|||
|
|||
### login |
|||
|
|||
# @name login |
|||
POST {{tall}}/users/signin |
|||
{{type}} |
|||
|
|||
{ |
|||
"client": 1, |
|||
"type": 3, |
|||
"data": { |
|||
"identifier": "song", |
|||
"credential": "999999" |
|||
} |
|||
} |
|||
|
|||
### send code |
|||
|
|||
GET {{tall}}/users/smscode?phone=16603418748 |
|||
|
|||
|
|||
### phone login |
|||
|
|||
# @name phonelogin |
|||
POST {{tall}}/users/signin |
|||
{{type}} |
|||
|
|||
{ |
|||
"client": 1, |
|||
"type": 1, |
|||
"data": { |
|||
"identifier": "16603418748", |
|||
"credential": "1111" |
|||
} |
|||
} |
|||
|
|||
### 根据团队id查看研发团队相关信息 |
|||
|
|||
POST {{greenvalley}}/researchTeam/selectTeam |
|||
{{type}} |
|||
Authorization: Bearer {{login.response.body.$.data.token}} |
|||
|
|||
{ |
|||
"param": { |
|||
"company": "", |
|||
"researchDirection": "", |
|||
"teamId": 0, |
|||
"teamIntroduce": "", |
|||
"teamLeaderName": "", |
|||
"teamName": "" |
|||
} |
|||
} |
@ -0,0 +1,33 @@ |
|||
<template> |
|||
<a-config-provider :locale="zh_CN"> |
|||
<div id="app"> |
|||
<router-view></router-view> |
|||
</div> |
|||
</a-config-provider> |
|||
</template> |
|||
|
|||
<script> |
|||
import zh_CN from 'ant-design-vue/lib/locale-provider/zh_CN'; |
|||
|
|||
export default { |
|||
name: 'App', |
|||
data() { |
|||
return { zh_CN }; |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style> |
|||
html, |
|||
body, |
|||
#app { |
|||
min-height: 100%; |
|||
} |
|||
|
|||
#app { |
|||
background: transparent; |
|||
} |
|||
body::-webkit-scrollbar { |
|||
width: 0; |
|||
} |
|||
</style> |
@ -0,0 +1,21 @@ |
|||
@font-face {font-family: "iconfont"; |
|||
src: url('iconfont.eot?t=1606814380789'); /* IE9 */ |
|||
src: url('iconfont.eot?t=1606814380789#iefix') format('embedded-opentype'), /* IE6-IE8 */ |
|||
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAALAAAsAAAAABnAAAAJ0AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAp8gRABNgIkAwgLBgAEIAWEbQcvG7UFyJ6aPClS2/jAQpBlKUHgLEQQraGzf/cfBIUoGRWCjoqLMLFRrXRVrTH1bMRfztXeEwobfUDy1DOlP3OusGk5nTSH6gmFJ0tKIY+nBgQ4ZZ5fe/U+cbjXxvJA5jvvchlj0FiTJnUBxoEU0N4YbeEC+QD+h7ELXMJlAs2GJMUOR6aWoE1mzQrEm22q0JbzyzJLNQpVzcYsvio1Fp/FAXwJfx//IR9tFMrEqrh4HTag75dmZ6SPmhefIEBA20skLACZuKmNn2kUjNmoOd5kDOyrNPil1bVvE3v954mKVdwKBqDknqSu7Fb5C5DpzRiwMuoDpJaW1veXVeV5b+lxhVLteX355ZA+rS0ZjT+ex05fRr8/jR493lS0+Eefi/THEQbKv8zAm9u5cn11ob622gISIuUCqogn3i5OR1tKlzE/z2iuVkMfQC0tEYA/mX852tS7eVtLBj//5s/CKbVc+kDjvh3BP5L2bMm63LIWWZXWpgtjGs9d1awZddjd7Xusoe+G0qFR3205GwymSBpNEDN1AaUWi6g02kGzeaPbW/QQGkVuwpxNgNDpEoV235B0uiJm6hdK/f5R6YxGNLuLngNbTIXdcSBQlWgQrUZsnQfMscuOqHQBzZKniqw8ZCkoIjtEculsMTWKAYo5lkRlMy8lI0xwn4yA69DzOAkFd1CXaUvKsJDJsLo7pXXuQ4cDAlJJyEBoagibjgswv7PUUfr+AmQq8ahES1NNUIGEiN0/kZOW7UEc1QS9mu7llkiZKU+SGIIROB8xAsYhj4cjwvpxDqST0qwR0VBBxm7H+mrS6+v8r9sFzSxjEfaIpHzjuuoBAAA=') format('woff2'), |
|||
url('iconfont.woff?t=1606814380789') format('woff'), |
|||
url('iconfont.ttf?t=1606814380789') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */ |
|||
url('iconfont.svg?t=1606814380789#iconfont') format('svg'); /* iOS 4.1- */ |
|||
} |
|||
|
|||
.iconfont { |
|||
font-family: "iconfont" !important; |
|||
font-size: 14px; |
|||
font-style: normal; |
|||
-webkit-font-smoothing: antialiased; |
|||
-moz-osx-font-smoothing: grayscale; |
|||
} |
|||
|
|||
.icon-local:before { |
|||
content: "\e662"; |
|||
font-size: 20px; |
|||
} |
After Width: | Height: | Size: 1018 B |
After Width: | Height: | Size: 4.9 KiB |
@ -0,0 +1,244 @@ |
|||
// padding |
|||
.pa-3 { |
|||
padding: 12px; |
|||
} |
|||
|
|||
.pb-3 { |
|||
padding-bottom: 12px; |
|||
} |
|||
|
|||
.pb-4 { |
|||
padding-bottom: 16px; |
|||
} |
|||
|
|||
.pb-5 { |
|||
padding-bottom: 20px; |
|||
} |
|||
|
|||
.pb-10 { |
|||
padding-bottom: 40px; |
|||
} |
|||
|
|||
// margin |
|||
.ma-3 { |
|||
margin: 12px; |
|||
} |
|||
|
|||
.mx-2{ |
|||
margin-left: 8px; |
|||
margin-right: 8px; |
|||
} |
|||
|
|||
.my-2{ |
|||
margin-top: 8px; |
|||
margin-bottom: 8px; |
|||
} |
|||
|
|||
.my-3{ |
|||
margin-top: 12px; |
|||
margin-bottom: 12px; |
|||
} |
|||
|
|||
.my-4{ |
|||
margin-top: 16px; |
|||
margin-bottom: 16px; |
|||
} |
|||
|
|||
.mt-1{ |
|||
margin-top: 4px; |
|||
} |
|||
|
|||
.mt-2{ |
|||
margin-top: 8px; |
|||
} |
|||
|
|||
.mt-3{ |
|||
margin-top: 12px; |
|||
} |
|||
|
|||
.mt-4{ |
|||
margin-top: 16px; |
|||
} |
|||
|
|||
.mb-1{ |
|||
margin-bottom: 4px; |
|||
} |
|||
|
|||
.mb-2{ |
|||
margin-bottom: 8px; |
|||
} |
|||
|
|||
.mb-3{ |
|||
margin-bottom: 12px; |
|||
} |
|||
|
|||
.mb-4{ |
|||
margin-bottom: 16px; |
|||
} |
|||
|
|||
.ml-2{ |
|||
margin-left: 8px; |
|||
} |
|||
|
|||
.ml-3{ |
|||
margin-left: 12px; |
|||
} |
|||
|
|||
.ml-4{ |
|||
margin-left: 16px; |
|||
} |
|||
|
|||
.ml-5{ |
|||
margin-left: 20px; |
|||
} |
|||
|
|||
.ml-6{ |
|||
margin-left: 24px; |
|||
} |
|||
|
|||
.ml-7{ |
|||
margin-left: 28px; |
|||
} |
|||
|
|||
.ml-8{ |
|||
margin-left: 32px; |
|||
} |
|||
|
|||
.mr-1{ |
|||
margin-right: 4px; |
|||
} |
|||
|
|||
.mr-2{ |
|||
margin-right: 8px; |
|||
} |
|||
|
|||
.mr-3{ |
|||
margin-right: 12px; |
|||
} |
|||
|
|||
.mr-4{ |
|||
margin-right: 16px; |
|||
} |
|||
|
|||
.mr-5{ |
|||
margin-right: 20px; |
|||
} |
|||
|
|||
.mr-6{ |
|||
margin-right: 24px; |
|||
} |
|||
|
|||
// background |
|||
.white { |
|||
background: white; |
|||
} |
|||
|
|||
// flex |
|||
.d-flex{ |
|||
display: flex; |
|||
} |
|||
|
|||
.flex-wrap{ |
|||
flex-wrap: wrap; |
|||
} |
|||
|
|||
.flex-nowrap{ |
|||
flex-wrap: nowrap; |
|||
} |
|||
|
|||
.flex-column{ |
|||
flex-direction: column; |
|||
} |
|||
|
|||
.flex-column-reverse{ |
|||
flex-direction: column-reverse; |
|||
} |
|||
|
|||
.flex-row{ |
|||
flex-direction: row; |
|||
} |
|||
|
|||
.flex-row-reverse{ |
|||
flex-direction: row-reverse; |
|||
} |
|||
|
|||
.justify-center{ |
|||
justify-content: center; |
|||
} |
|||
|
|||
.justify-space-between{ |
|||
justify-content: space-between; |
|||
} |
|||
|
|||
.flex-1{ |
|||
display: flex; |
|||
flex: 1; |
|||
} |
|||
|
|||
// other |
|||
.pointer{ |
|||
cursor:pointer; |
|||
} |
|||
|
|||
.fill-height{ |
|||
height:100%; |
|||
} |
|||
|
|||
// font |
|||
.font-bold-24{ |
|||
font-size: 24px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.font-24{ |
|||
font-size: 24px; |
|||
} |
|||
|
|||
.font-bold-16{ |
|||
font-size: 16px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.font-16{ |
|||
font-size: 16px; |
|||
} |
|||
|
|||
.font-bold-14{ |
|||
font-size: 14px; |
|||
font-weight: bold; |
|||
} |
|||
|
|||
.font-14{ |
|||
font-size: 14px; |
|||
} |
|||
|
|||
.icon-size{ |
|||
font-size: 20px; |
|||
} |
|||
|
|||
h2{ |
|||
font-size: 24px; |
|||
font-weight: bold; |
|||
color: rgba(0,0,0,.85) |
|||
} |
|||
|
|||
.textColor{ |
|||
color: rgba(0,0,0,.65) |
|||
} |
|||
|
|||
.baseColor{ |
|||
color: #13ACC4 |
|||
} |
|||
|
|||
.bg{ |
|||
background: #F5F5F5 |
|||
} |
|||
|
|||
.ant-btn-primary{ |
|||
background-color: #13ACC4 |
|||
border-color: #13ACC4; |
|||
} |
|||
|
|||
.ant-btn-link:hover, .ant-btn-link:focus{ |
|||
color: #13ACC4; |
|||
} |
@ -0,0 +1,26 @@ |
|||
/* |
|||
* Copyright (c) 2020. |
|||
* author: wally |
|||
* email: 18603454788@163.com |
|||
*/ |
|||
import axios from 'axios'; |
|||
let { proxyUrl, msgUrl } = require('@/config/setting'); |
|||
|
|||
const tall = `${proxyUrl}/tall/v1.0`; |
|||
// console.log('tall: ', tall);
|
|||
const users = `${tall}/users`; |
|||
|
|||
// 用户登录
|
|||
export const signIn = params => axios.post(`${users}/signin`, params); |
|||
|
|||
// 注册
|
|||
export const signUp = params => axios.post(`${users}/signup`, params); |
|||
|
|||
// 图片验证码
|
|||
export const getPicCode = () => axios.get(`${users}/code`); |
|||
|
|||
// 发送验证码
|
|||
export const getSmscode = params => axios.get(`${users}/smscode`, params); |
|||
|
|||
// 通过手机号修改密码
|
|||
export const changePassword = params => axios.post(`${users}/password`, params); |
@ -0,0 +1,27 @@ |
|||
/* |
|||
* Copyright (c) 2019. |
|||
* author: wally |
|||
* email: 18603454788@163.com |
|||
*/ |
|||
import axios from 'axios'; |
|||
let { proxyUrl, msgUrl } = require('@/config/setting'); |
|||
|
|||
const greenvalley = `${proxyUrl}/greenvalley`; |
|||
const page = `${greenvalley}/page`; // 创新平台相关操作
|
|||
const policy = `${proxyUrl}/policy/policy`; // 创新政策相关接口
|
|||
|
|||
// websocket基础地址
|
|||
export const WS_BASE_URL = msgUrl; |
|||
|
|||
// 页面列表查询
|
|||
export const getPageList = params => axios.post(`${page}/list`, params); |
|||
// 查询政策列表
|
|||
export const selLikePolicy = params => axios.post(`${policy}/selLikePolicy`, params); |
|||
// 查询政策详情
|
|||
export const selPolicy = params => axios.post(`${policy}/selPolicy`, params); |
|||
// 申请加入三大平台
|
|||
export const JoinPlatform = params => axios.post(`${greenvalley}/platform/JoinPlatform`, params); |
|||
// 上传附件
|
|||
export const upload = `${greenvalley}/file/upload`; |
|||
// 加入我们
|
|||
export const joinUs = params => axios.post(`${greenvalley}/PersonApply/joinUs`, params); |
@ -0,0 +1,30 @@ |
|||
const title = process.env.VUE_APP_TITLE; |
|||
const description = process.env.VUE_APP_DESCRIPTION; |
|||
const baseUrl = process.env.VUE_APP_BASE_URL; |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
const proxyUrl = process.env.VUE_APP_PROXY_URL; |
|||
const publicPath = process.env.VUE_APP_PUBLIC_PATH; |
|||
const msgUrl = process.env.VUE_APP_MSG_URL; |
|||
|
|||
module.exports = { |
|||
// 首页标题
|
|||
title, |
|||
|
|||
// 首页描述信息
|
|||
description, |
|||
|
|||
// 基础地址
|
|||
baseUrl, |
|||
|
|||
// api基础地址
|
|||
apiUrl, |
|||
|
|||
// 消息系统地址
|
|||
msgUrl, |
|||
|
|||
// api代理地址
|
|||
proxyUrl, |
|||
|
|||
// 生成文件目录 publicPath
|
|||
publicPath, |
|||
}; |
@ -0,0 +1,19 @@ |
|||
/* |
|||
* Copyright (c) 2019. |
|||
* author: wally |
|||
* email: 18603454788@163.com |
|||
*/ |
|||
|
|||
// 用户登录client
|
|||
export const SIGN_IN_CLIENTS = { mp: 0, h5: 1, android: 2, ios: 3 }; |
|||
|
|||
// 用户登录类型
|
|||
export const SIGN_IN_TYPES = { |
|||
mp: 0, |
|||
phone: 1, |
|||
email: 2, |
|||
username: 3, |
|||
wx: 4, |
|||
wx_web: 5, |
|||
wb: 6, |
|||
}; |
@ -0,0 +1,23 @@ |
|||
// @ts-ignore
|
|||
import Vue from 'vue'; |
|||
import './plugins/axios'; |
|||
import App from './App.vue'; |
|||
import './registerServiceWorker'; |
|||
import router from './router'; |
|||
import store from './store'; |
|||
import './plugins/ant-design-vue.js'; |
|||
import 'common/portrait.styl'; |
|||
import './assets/icon/iconfont.css'; |
|||
import VueDOMPurifyHTML from 'vue-dompurify-html'; |
|||
import moment from 'moment'; //导入文件
|
|||
Vue.prototype.$moment = moment; //赋值使用
|
|||
|
|||
Vue.config.productionTip = false; |
|||
|
|||
Vue.use(VueDOMPurifyHTML); |
|||
|
|||
window.vm = new Vue({ |
|||
router, |
|||
store, |
|||
render: h => h(App), |
|||
}).$mount('#app'); |
@ -0,0 +1,68 @@ |
|||
import Vue from 'vue'; |
|||
import { |
|||
Pagination, |
|||
Button, |
|||
Input, |
|||
message, |
|||
notification, |
|||
Modal, |
|||
Tag, |
|||
Table, |
|||
Tabs, |
|||
Icon, |
|||
Empty, |
|||
Form, |
|||
Select, |
|||
Upload, |
|||
Badge, |
|||
Popconfirm, |
|||
DatePicker, |
|||
Switch, |
|||
Radio, |
|||
Dropdown, |
|||
Menu, |
|||
Row, |
|||
Col, |
|||
Timeline, |
|||
Checkbox, |
|||
BackTop, |
|||
} from 'ant-design-vue'; |
|||
import { ConfigProvider } from 'ant-design-vue'; |
|||
Vue.component(ConfigProvider.name, ConfigProvider); |
|||
Vue.use(Pagination); |
|||
Vue.use(Button); |
|||
Vue.use(Input); |
|||
Vue.use(Modal); |
|||
Vue.use(Tag); |
|||
Vue.use(Table); |
|||
Vue.use(Tabs); |
|||
Vue.use(Icon); |
|||
Vue.use(Empty); |
|||
Vue.use(Form); |
|||
Vue.use(Select); |
|||
Vue.use(Upload); |
|||
Vue.use(Badge); |
|||
Vue.use(Popconfirm); |
|||
Vue.use(DatePicker); |
|||
Vue.use(Switch); |
|||
Vue.use(Radio); |
|||
Vue.use(Dropdown); |
|||
Vue.use(Menu); |
|||
Vue.use(Row); |
|||
Vue.use(Col); |
|||
Vue.use(Timeline); |
|||
Vue.use(Checkbox); |
|||
Vue.use(BackTop); |
|||
|
|||
Vue.prototype.$message = message; |
|||
Vue.prototype.$notification = notification; |
|||
Vue.prototype.$info = Modal.info; |
|||
Vue.prototype.$success = Modal.success; |
|||
Vue.prototype.$error = Modal.error; |
|||
Vue.prototype.$warning = Modal.warning; |
|||
Vue.prototype.$confirm = Modal.confirm; |
|||
|
|||
message.config({ |
|||
duration: 3, |
|||
maxCount: 3, |
|||
}); |
@ -0,0 +1,77 @@ |
|||
'use strict'; |
|||
|
|||
import Vue from 'vue'; |
|||
import axios from 'axios'; |
|||
import router from '../router/index'; |
|||
import store from '../store/index'; |
|||
|
|||
// Full config: https://github.com/axios/axios#request-config
|
|||
// axios.defaults.baseURL = process.env.baseURL || process.env.apiUrl || '';
|
|||
// axios.defaults.headers.common['Authorization'] = AUTH_TOKEN;
|
|||
// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded';
|
|||
let config = { |
|||
// baseURL: process.env.baseURL || process.env.apiUrl || ""
|
|||
timeout: 60 * 1000, // Timeout
|
|||
// withCredentials: true, // Check cross-site Access-Control
|
|||
}; |
|||
|
|||
const _axios = axios.create(config); |
|||
axios.interceptors.request.use( |
|||
function(config) { |
|||
let token = store.state.anyringToken || sessionStorage.getItem('anyringToken'); |
|||
|
|||
if (token) { |
|||
config.headers.Authorization = `Bearer ${token}`; |
|||
} |
|||
return config; |
|||
}, |
|||
function(error) { |
|||
// Do something with request error
|
|||
return Promise.reject(error); |
|||
}, |
|||
); |
|||
|
|||
// Add a response interceptor
|
|||
axios.interceptors.response.use( |
|||
function(response) { |
|||
if (response.data && response.data.code >= 400 && response.data.code < 500) { |
|||
store.commit('user/sign', ''); |
|||
router.replace({ |
|||
path: '/user/login', |
|||
query: { redirect: router.currentRoute.fullPath }, |
|||
}); |
|||
} |
|||
// Do something with response data
|
|||
return response; |
|||
}, |
|||
function(error) { |
|||
// Do something with response error
|
|||
return Promise.reject(error); |
|||
}, |
|||
); |
|||
|
|||
Plugin.install = function(Vue) { |
|||
Vue.axios = _axios; |
|||
window.axios = _axios; |
|||
Object.defineProperties(Vue.prototype, { |
|||
axios: { |
|||
get() { |
|||
return _axios; |
|||
}, |
|||
}, |
|||
$axios: { |
|||
get() { |
|||
return _axios; |
|||
}, |
|||
}, |
|||
$http: { |
|||
get() { |
|||
return _axios; |
|||
}, |
|||
}, |
|||
}); |
|||
}; |
|||
|
|||
Vue.use(Plugin); |
|||
|
|||
export default Plugin; |
@ -0,0 +1,34 @@ |
|||
/* eslint-disable no-console */ |
|||
|
|||
import { register } from "register-service-worker"; |
|||
|
|||
if (process.env.NODE_ENV === "production") { |
|||
register(`${process.env.BASE_URL}service-worker.js`, { |
|||
ready() { |
|||
console.log( |
|||
"App is being served from cache by a service worker.\n" + |
|||
"For more details, visit https://goo.gl/AFskqB" |
|||
); |
|||
}, |
|||
registered() { |
|||
console.log("Service worker has been registered."); |
|||
}, |
|||
cached() { |
|||
console.log("Content has been cached for offline use."); |
|||
}, |
|||
updatefound() { |
|||
console.log("New content is downloading."); |
|||
}, |
|||
updated() { |
|||
console.log("New content is available; please refresh."); |
|||
}, |
|||
offline() { |
|||
console.log( |
|||
"No internet connection found. App is running in offline mode." |
|||
); |
|||
}, |
|||
error(error) { |
|||
console.error("Error during service worker registration:", error); |
|||
} |
|||
}); |
|||
} |
@ -0,0 +1,28 @@ |
|||
import Vue from 'vue'; |
|||
import VueRouter from 'vue-router'; |
|||
import Home from 'views/Index/Index.vue'; |
|||
|
|||
Vue.use(VueRouter); |
|||
|
|||
const routes = [ |
|||
// 首页
|
|||
{ |
|||
path: '/', |
|||
name: 'Home', |
|||
component: Home, |
|||
}, |
|||
// 白框框显示内容界面
|
|||
// {
|
|||
// path: '/Index',
|
|||
// name: 'Index',
|
|||
// component: () => import(/* webpackChunkName: "Index" */ 'views/Index/Index.vue'),
|
|||
// },
|
|||
]; |
|||
|
|||
const router = new VueRouter({ |
|||
mode: 'history', |
|||
base: process.env.BASE_URL, |
|||
routes, |
|||
}); |
|||
|
|||
export default router; |
@ -0,0 +1,143 @@ |
|||
import axios from 'axios'; |
|||
import { message } from 'ant-design-vue'; |
|||
import { getSmscode, getPicCode, signIn, changePassword, signUp, getUserId } from 'config/api-user'; |
|||
|
|||
const actions = { |
|||
/** |
|||
* sendCode 发送验证码 |
|||
* @param {any} commit |
|||
* @param {object} params 提交的数据 |
|||
* @param {string} params.phone 手机号 |
|||
*/ |
|||
async sendCode({ commit }, params) { |
|||
try { |
|||
const res = await getSmscode({ params }); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
return data; |
|||
} else { |
|||
message.error(msg || '发送失败'); |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw error || '发送失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* sendPicCode 获取图片验证码 |
|||
* @param {any} commit |
|||
* @param {object} params 提交的数据 |
|||
*/ |
|||
async sendPicCode({ commit }) { |
|||
try { |
|||
const res = await getPicCode(); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
commit('setPicCode', data); |
|||
return data; |
|||
} else { |
|||
throw msg; |
|||
} |
|||
} catch (error) { |
|||
throw error || '获取失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* signIn 登录 |
|||
* @param {any} commit |
|||
* @param {string} identifier 身份标识 手机号 用户名 |
|||
* @param {string} credential 身份凭证 验证码 密码 |
|||
* @return {Promise} result 服务器返回信息 |
|||
*/ |
|||
async signIn({ commit }, params) { |
|||
const hideLoading = message.loading('登录中', 0); |
|||
try { |
|||
const res = await signIn(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
commit('sign', data.token); |
|||
commit('setUser', data); |
|||
hideLoading(); |
|||
message.success('登录成功'); |
|||
return data; |
|||
} else { |
|||
hideLoading(); |
|||
throw msg || '登录失败'; |
|||
} |
|||
} catch (error) { |
|||
hideLoading(); |
|||
throw error || '登录失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 修改密码 忘记密码 |
|||
* @param {any} commit |
|||
* @param {object} params 要提交的参数 |
|||
*/ |
|||
async changePassword({ commit }, params) { |
|||
try { |
|||
const res = await changePassword(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
message.success('修改密码成功'); |
|||
return data; |
|||
} else { |
|||
throw msg || '修改密码失败'; |
|||
} |
|||
} catch (error) { |
|||
throw error || '修改密码失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* singUp 注册新用户 |
|||
* @param {any} commit |
|||
* @param {object} params 提交的数据 |
|||
* @param {string} params.account 用户名 |
|||
* @param {string} params.password 密码 |
|||
* @param {string} params.phone 手机号 |
|||
* @param {string} params.smsCode 验证码 |
|||
*/ |
|||
async signUp({ commit }, params) { |
|||
try { |
|||
const res = await signUp(params); |
|||
const { code, msg, data } = res.data; |
|||
if (code === 200) { |
|||
commit('sign', data.token); |
|||
commit('setUser', data); |
|||
message.success('注册成功'); |
|||
return data; |
|||
} else { |
|||
throw msg || '注册失败'; |
|||
} |
|||
} catch (error) { |
|||
throw error || '注册失败'; |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 通过userId获取token |
|||
* @param {any} commit |
|||
* @param {object} params 提交的参数 |
|||
*/ |
|||
// async getUserId({ commit }, params) {
|
|||
// try {
|
|||
// const res = await getUserId({ params });
|
|||
// const { code, msg, data } = res.data;
|
|||
// if (code === 200) {
|
|||
// commit('sign', data.token);
|
|||
// commit('setUser', data);
|
|||
// return data;
|
|||
// } else {
|
|||
// throw msg;
|
|||
// }
|
|||
// } catch (error) {
|
|||
// throw error || '获取个人信息失败';
|
|||
// }
|
|||
// },
|
|||
}; |
|||
|
|||
export default actions; |
@ -0,0 +1,7 @@ |
|||
const getters = {}; |
|||
// 域定制导航展示形式
|
|||
// 0 -> 无特殊导航文字
|
|||
// 1 -> 横向定制导航
|
|||
// 2 -> 纵向定制导航
|
|||
|
|||
export default getters; |
@ -0,0 +1,16 @@ |
|||
import Vue from "vue"; |
|||
import Vuex from "vuex"; |
|||
import mutations from './mutations'; |
|||
import actions from './actions'; |
|||
import state from './state'; |
|||
import getters from './getters'; |
|||
|
|||
Vue.use(Vuex); |
|||
|
|||
const store = new Vuex.Store({ |
|||
state, |
|||
mutations, |
|||
actions, |
|||
}); |
|||
|
|||
export default store; |
@ -0,0 +1,24 @@ |
|||
const mutations = { |
|||
/** |
|||
* 设置token |
|||
* @param { object } state |
|||
* @param { string } token |
|||
*/ |
|||
sign(state, token) { |
|||
state.anyringToken = token; |
|||
sessionStorage.setItem('anyringToken', token); |
|||
}, |
|||
|
|||
/** |
|||
* 设置user用户信息 |
|||
* @param {object} state |
|||
* @param {object} user {id, account, phone} |
|||
*/ |
|||
setUser(state, user) { |
|||
if (!user) return; |
|||
state.user = { ...user }; |
|||
sessionStorage.setItem('user', JSON.stringify(user)); |
|||
}, |
|||
}; |
|||
|
|||
export default mutations; |
@ -0,0 +1,6 @@ |
|||
const state = { |
|||
anyringToken: '', |
|||
user: { id: '', phone: '', account: '' }, |
|||
}; |
|||
|
|||
export default state; |
@ -0,0 +1,13 @@ |
|||
<template> |
|||
<div>index.vue界面</div> |
|||
</template> |
|||
|
|||
<script> |
|||
export default { |
|||
data() { |
|||
return {}; |
|||
}, |
|||
}; |
|||
</script> |
|||
|
|||
<style lang="stylus" scoped></style> |
@ -0,0 +1,138 @@ |
|||
/* |
|||
* Copyright (c) 2019. |
|||
* author: wally |
|||
* email: 18603454788@163.com |
|||
*/ |
|||
const path = require('path'); |
|||
const productionGzipExtensions = /\.(js|css|json|txt|html|ico|svg|ttf|woff|woff2)(\?.*)?$/i; |
|||
const CompressionWebpackPlugin = require('compression-webpack-plugin'); |
|||
|
|||
const resolve = dir => path.join(__dirname, dir); |
|||
const isPro = process.env.VUE_APP_NODE_ENV === 'production'; |
|||
const publicPath = process.env.VUE_APP_PUBLIC_PATH; |
|||
const proxyUrl = process.env.VUE_APP_PROXY_URL; |
|||
const apiUrl = process.env.VUE_APP_API_URL; |
|||
const title = process.env.VUE_APP_TITLE; |
|||
console.log('proxyUrl: ', proxyUrl); |
|||
console.log('apiUrl: ', apiUrl); |
|||
|
|||
// 本地环境是否需要使用cdn
|
|||
const devNeedCdn = true; |
|||
|
|||
// cdn 链接及配置
|
|||
const cdn = { |
|||
css: [ |
|||
'https://cdn.jsdelivr.net/npm/@mdi/font@5.x/css/materialdesignicons.min.css', |
|||
'https://cdn.bootcdn.net/ajax/libs/ant-design-vue/1.6.5/antd.min.css', |
|||
], |
|||
js: [ |
|||
isPro ? 'https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.min.js' : 'https://cdn.bootcdn.net/ajax/libs/vue/2.6.12/vue.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/vue-router/3.4.3/vue-router.min.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/vuex/3.5.1/vuex.min.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/moment.js/2.9.0/moment.min.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/lodash.js/4.17.20/lodash.min.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/axios/0.20.0/axios.min.js', |
|||
'https://cdn.bootcdn.net/ajax/libs/ant-design-vue/1.6.5/antd.min.js', |
|||
], |
|||
// externals: {
|
|||
// vue: 'Vue',
|
|||
// vuex: 'Vuex',
|
|||
// 'vue-router': 'VueRouter',
|
|||
// moment: 'moment',
|
|||
// axios: 'axios',
|
|||
// 'ant-design-vue': 'antd',
|
|||
// lodash: '_',
|
|||
// },
|
|||
}; |
|||
|
|||
module.exports = { |
|||
lintOnSave: true, |
|||
publicPath: isPro ? publicPath : '/', |
|||
devServer: { |
|||
open: true, |
|||
overlay: { |
|||
warnings: false, |
|||
errors: true, |
|||
}, |
|||
proxy: { |
|||
[proxyUrl]: { |
|||
target: apiUrl, // 代理接口
|
|||
changeOrigin: true, |
|||
pathRewrite: { [`^${proxyUrl}`]: '' }, |
|||
}, |
|||
}, |
|||
}, |
|||
productionSourceMap: false, // 去掉生产环境的sourcemap 加快构建速度
|
|||
|
|||
configureWebpack: { |
|||
// provide the app's title in webpack's name field, so that
|
|||
// it can be accessed in index.html to inject the correct title.
|
|||
|
|||
name: title, |
|||
resolve: { |
|||
alias: { |
|||
'~': __dirname, |
|||
'@': resolve('src'), |
|||
assets: resolve('src/assets'), |
|||
views: resolve('src/views'), |
|||
components: resolve('src/components'), |
|||
common: resolve('src/common'), |
|||
config: resolve('src/config'), |
|||
router: resolve('src/router'), |
|||
store: resolve('src/store'), |
|||
util: resolve('src/util'), |
|||
request: resolve('src/request'), |
|||
}, |
|||
}, |
|||
plugins: isPro |
|||
? [ |
|||
new CompressionWebpackPlugin({ |
|||
test: productionGzipExtensions, |
|||
threshold: 10240, |
|||
deleteOriginalAssets: false, |
|||
}), |
|||
] |
|||
: [], |
|||
externals: isPro || devNeedCdn ? cdn.externals : {}, |
|||
}, |
|||
|
|||
chainWebpack(config) { |
|||
if (isPro) { |
|||
config.optimization |
|||
.runtimeChunk('single') |
|||
.minimize(true) |
|||
.splitChunks({ |
|||
chunks: 'all', |
|||
maxInitialRequests: Infinity, |
|||
minSize: 20000, // 依赖包超过20000bit将被单独打包
|
|||
cacheGroups: { |
|||
vendor: { |
|||
test: /[\\/]node_modules[\\/]/, |
|||
name(module) { |
|||
// get the name. E.g. node_modules/packageName/not/this/part.js
|
|||
// or node_modules/packageName
|
|||
const packageName = module.context.match(/[\\/]node_modules[\\/](.*?)([\\/]|$)/)[1]; |
|||
// npm package names are URL-safe, but some servers don't like @ symbols
|
|||
return `npm.${packageName.replace('@', '')}`; |
|||
}, |
|||
}, |
|||
}, |
|||
}); |
|||
} |
|||
|
|||
// set svg-sprite-loader
|
|||
// config.module
|
|||
// .rule('svg')
|
|||
// .exclude.add(resolve('src/icons'))
|
|||
// .end();
|
|||
// config.module
|
|||
// .rule('icons')
|
|||
// .test(/\.svg$/)
|
|||
// .include.add(resolve('src/icons'))
|
|||
// .end()
|
|||
// .use('svg-sprite-loader')
|
|||
// .loader('svg-sprite-loader')
|
|||
// .options({ symbolId: 'icon-[name]' })
|
|||
// .end();
|
|||
}, |
|||
}; |