代理商管理系统初搭建

This commit is contained in:
lyp 2025-08-05 17:00:42 +08:00
parent b3043df980
commit 0898bf1b6f
35 changed files with 2520 additions and 285 deletions

1
.env Normal file
View File

@ -0,0 +1 @@
VUE_APP_BASE_URL=/

1628
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -8,10 +8,16 @@
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^1.11.0",
"core-js": "^3.8.3",
"js-cookie": "^3.0.5",
"postcss-px2rem-exclude": "^0.0.6",
"vant": "^3.6.16",
"vite": "^7.0.6",
"vue": "^3.2.13",
"vue-router": "^4.0.3",
"vuex": "^4.0.0"
"vuex": "^4.0.0",
"weixin-js-sdk": "^1.6.5"
},
"devDependencies": {
"@babel/core": "^7.12.16",
@ -26,7 +32,8 @@
"eslint-plugin-import": "^2.25.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-vue": "^8.0.3",
"eslint-plugin-vue": "^7.20.0",
"postcss-px-to-viewport": "^1.1.1",
"stylus": "^0.55.0",
"stylus-loader": "^6.1.0"
},

20
postcss.config.js Normal file
View File

@ -0,0 +1,20 @@
module.exports = {
plugins: {
autoprefixer: {}, // 用来给不同的浏览器自动添加相应前缀,如-webkit--moz-等等
'postcss-px-to-viewport': {
unitToConvert: 'px', // 要转化的单位
viewportWidth: 375, // UI设计稿的宽度
viewportHeight: 812, // 视口的高度,对应的是设计稿的高度(也可以不配置)
unitPrecision: 6, // 转换后的精度,即小数点位数
propList: ['*'], // 指定转换的css属性的单位*代表全部css属性的单位都进行转换
viewportUnit: 'vw', // 指定需要转换成的视窗单位默认vw
fontViewportUnit: 'vw', // 指定字体需要转换成的视窗单位默认vw
selectorBlackList: ['ignore'], // 指定不转换为视窗单位的类名,
minPixelValue: 1, // 默认值1小于或等于1px则不进行转换
mediaQuery: true, // 是否在媒体查询的css代码中也进行转换默认false
replace: true, // 是否转换后直接更换属性值
exclude: [/node_modules/], // 设置忽略文件,用正则做目录名匹配
landscape: false // 是否处理横屏情况
}
}
}

View File

@ -4,6 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<base href="/">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
</head>

View File

@ -1,17 +1,16 @@
<template>
<nav>
<router-link to="/">Home</router-link> |
<router-link to="/about">About</router-link>
</nav>
<router-view/>
<div id="app">
<router-view/>
</div>
</template>
<style lang="stylus">
#app
font-family Avenir, Helvetica, Arial, sans-serif
-webkit-font-smoothing antialiased
-moz-osx-font-smoothing grayscale
text-align center
color #2c3e50
margin-top 60px
<script>
export default {
name: 'App'
}
</script>
<style>
#app{
height: 100vh;
width: 100vw;
}
</style>

82
src/api/login.js Normal file
View File

@ -0,0 +1,82 @@
import request from '@/utils/request'
export function login (username, password) {
return request({
url: '/seer/admin/user/login',
method: 'post',
data: {
username,
password
}
})
}
export function getInfo() {
return request({
url: '/seer/admin/user/info',
method: 'get'
})
}
export function logout () {
return request({
url: '/seer/admin/user/logout',
method: 'post'
})
}
export function fetchList (params) {
return request({
url: `/seer/admin/user/list/${params.pageNum}/${params.pageSize}`,
method: 'get',
params: {
userName: params.keyword
}
})
}
export function createAdmin (data) {
return request({
url: '/seer/admin/user/register',
method: 'post',
data: data
})
}
export function updateAdmin (id, data) {
return request({
url: '/seer/admin/user/update/' + id,
method: 'post',
data: data
})
}
export function updateStatus (id, params) {
return request({
url: '/seer/admin/user/updateStatus/' + id,
method: 'post',
params: params
})
}
export function deleteAdmin (id) {
return request({
url: '/seer/admin/user/delete/' + id,
method: 'post'
})
}
export function getRoleByAdmin (id) {
return request({
url: `/seer/admin/user/role/${id}`,
method: 'get'
})
}
export function allocRole (data) {
return request({
url: '/seer/admin/user/role/update',
method: 'post',
data: data
})
}

8
src/api/wxConfig.js Normal file
View File

@ -0,0 +1,8 @@
import request from '@/utils/request'
export function getWxConfig (url) {
return request({
url: '/wxconfig/get',
data: url
})
}

5
src/assets/agent.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="21" height="21" viewBox="0 0 21 21" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Vector">
<path id="Vector_2" d="M10.2489 0H15.0614V4.8125C15.0614 5.76432 14.7791 6.69477 14.2503 7.48618C13.7215 8.27759 12.9699 8.89442 12.0905 9.25867C11.2112 9.62292 10.2435 9.71822 9.30999 9.53253C8.37646 9.34684 7.51895 8.88849 6.84591 8.21545C6.17287 7.54241 5.71452 6.68491 5.52883 5.75137C5.34314 4.81784 5.43844 3.85021 5.80269 2.97084C6.16694 2.09147 6.78377 1.33986 7.57518 0.811053C8.36659 0.282248 9.29704 0 10.2489 0ZM0.0271116 19.9089C-0.00583447 20.0381 -0.00879479 20.1732 0.0184568 20.3038C0.0457085 20.4343 0.102451 20.557 0.184347 20.6622C0.266243 20.7675 0.371125 20.8527 0.490976 20.9112C0.610828 20.9698 0.742477 21.0001 0.875862 21H19.6227C19.7561 21.0001 19.8878 20.9698 20.0076 20.9112C20.1275 20.8527 20.2324 20.7675 20.3142 20.6622C20.3961 20.557 20.4529 20.4343 20.4801 20.3038C20.5074 20.1732 20.5044 20.0381 20.4715 19.9089L18.9324 13.8775C18.903 13.7627 18.8507 13.655 18.7785 13.5609C18.7063 13.4669 18.6158 13.3886 18.5124 13.3306L15.8576 11.8431C15.7515 11.7837 15.6342 11.747 15.5131 11.7355C15.3921 11.7239 15.2699 11.7377 15.1545 11.776C15.0391 11.8143 14.9329 11.8762 14.8427 11.9578C14.7526 12.0394 14.6804 12.1389 14.6309 12.25L12.1581 17.7914L11.2779 14.833C11.2295 14.6703 11.2295 14.497 11.2779 14.3342L11.8239 12.4994C11.8627 12.3687 11.8705 12.2307 11.8466 12.0965C11.8227 11.9623 11.7677 11.8355 11.6861 11.7263C11.6045 11.6171 11.4985 11.5284 11.3766 11.4675C11.2547 11.4065 11.1202 11.3748 10.9839 11.375H9.51386C9.37768 11.3751 9.24339 11.4069 9.12168 11.468C8.99998 11.5292 8.89422 11.6178 8.81282 11.727C8.73142 11.8362 8.67663 11.9629 8.65281 12.097C8.62899 12.231 8.6368 12.3688 8.67561 12.4994L9.22074 14.3334C9.26974 14.497 9.26974 14.6702 9.22074 14.8321L8.34049 17.7914L5.86686 12.25C5.81731 12.1389 5.74516 12.0394 5.655 11.9578C5.56484 11.8762 5.45866 11.8143 5.34323 11.776C5.2278 11.7377 5.10566 11.7239 4.98459 11.7355C4.86353 11.747 4.74621 11.7837 4.64011 11.8431L1.98536 13.3306C1.88196 13.3886 1.79142 13.4669 1.71922 13.5609C1.64702 13.655 1.59468 13.7627 1.56536 13.8775L0.0271116 19.9089Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

11
src/assets/cooperate.svg Normal file
View File

@ -0,0 +1,11 @@
<svg width="313" height="70" viewBox="0 0 313 70" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Union">
<path id="Union_2" d="M121.222 8.23975H155.223L154.197 16.9604H135.957L134.84 26.9634H149.323L148.298 35.9399H133.838L132.665 46.4448C137.199 46.2588 144.427 46.0538 148.811 45.9429L147.528 54.9204H131.72L130.087 69.5396H113.416L120.084 16.9604H119.021L115.98 29.0151H102.644L109.312 3.87939L107.004 0.802246L123.162 0.54541L121.222 8.23975ZM175.23 69.5386H158.046L170.87 47.9946H187.669L175.23 69.5386ZM227.81 69.5386H209.855L202.161 47.9946H219.858L227.81 69.5386ZM95.208 69.0259H79.0498L85.7188 16.1899L80.332 17.2163L81.6143 5.67432L103.929 0.80127L95.208 69.0259ZM256.022 66.7173L253.201 69.0259H244.737L248.585 64.6655L249.123 60.3052H242.966L241.403 69.0259H233.452L239.607 36.1958H260.383L256.022 66.7173ZM273.72 57.7407L281.415 69.0259H272.95L269.616 63.3833L265 69.0259H256.536L266.795 58.2534L268.847 44.147H275.516L273.72 57.7407ZM304.498 61.8442H305.524L309.628 57.7407L308.089 69.0259H295.777L297.014 58.4097L292.754 58.6079L292.301 48.8657L289.365 69.0259H281.928L286.544 36.1958H307.576L304.498 61.8442ZM72.3623 38.3228L68.002 67.3052L67.9385 67.731H0L0.0693359 67.1694L3.66016 38.187L3.71387 37.7485H72.4492L72.3623 38.3228ZM19.5625 46.8999L18.0234 57.9292L17.9443 58.4976H52.8096L52.8691 58.0669L54.4082 47.0386L54.4883 46.4692H19.6221L19.5625 46.8999ZM281.415 58.2534H275.516L276.541 41.8384H267.564L264.743 58.2534H259.613L261.922 36.1958H283.979L281.415 58.2534ZM243.978 54.6626H249.821L250.265 51.0718H244.621L243.978 54.6626ZM292.677 46.2866L297.354 46.0698L297.666 52.8101L298.855 42.6079H293.213L292.677 46.2866ZM245.633 45.4292H250.963L251.406 41.8384H246.276L245.633 45.4292ZM191.43 12.6001H207.633L208.828 3.10986L206.776 0.54541H225.243L223.663 12.6001H231.398L230.629 20.5513H222.621L220.74 34.9136H232.426L231.144 44.147H158.815L160.354 34.9136H172.256L174.226 20.5513H165.995L167.021 12.6001H175.315L176.511 3.87939L173.434 0.54541H192.926L191.43 12.6001ZM188.661 34.9136H204.823L206.632 20.5513H190.443L188.661 34.9136ZM76.2236 34.6577L56.2178 34.145L54.4219 28.5024H26.4648L23.3877 34.6577H2.6123L19.54 4.90576L17.2314 2.08447H66.4766L76.2236 34.6577ZM304.498 33.3745H242.942L244.737 20.0376H306.037L304.498 33.3745ZM253.97 28.5024L297.185 28.5015L298.085 24.9116H254.87L253.97 28.5024ZM28.7744 18.7554H50.3193L48.2676 11.061H32.1084L28.7744 18.7554ZM285.519 4.13525H312.962L311.68 10.5474H259.998L259.613 13.3687H307.832L307.319 17.729H244.225L244.777 10.5474H240.634L241.403 4.13525H270.129L266.795 0.80127H285.519V4.13525Z" fill="url(#paint0_linear_1949_1571)"/>
</g>
<defs>
<linearGradient id="paint0_linear_1949_1571" x1="0" y1="35.0425" x2="312.962" y2="35.0425" gradientUnits="userSpaceOnUse">
<stop stop-color="#B38B64"/>
<stop offset="1" stop-color="#FFE3B2"/>
</linearGradient>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

6
src/assets/enter.svg Normal file
View File

@ -0,0 +1,6 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 427321522">
<circle id="Ellipse 3182" cx="11.5" cy="11.5" r="10.5" stroke="white" stroke-width="2"/>
<path id="Vector 712" d="M9 6L14.5 11.5L9 17" stroke="white" stroke-width="2" stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 325 B

6
src/assets/enterItem.svg Normal file
View File

@ -0,0 +1,6 @@
<svg width="23" height="23" viewBox="0 0 23 23" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 427321524">
<circle id="Ellipse 3182" cx="11.5" cy="11.5" r="11" stroke="#666666"/>
<path id="Vector 712" d="M9 6L14.5 11.5L9 17" stroke="#666666" stroke-width="2" stroke-linecap="round"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 310 B

52
src/assets/front.svg Normal file
View File

@ -0,0 +1,52 @@
<svg width="335" height="180" viewBox="0 0 335 180" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 32073">
<g id="Group 427321539">
<g id="Rectangle 34625815" filter="url(#filter0_d_1949_1254)">
<rect width="335" height="168" rx="10" fill="white"/>
<rect x="0.5" y="0.5" width="334" height="167" rx="9.5" stroke="#F1F3FC"/>
</g>
<path id="&#229;&#164;&#180;&#229;&#131;&#143;&#233;&#157;&#162;" d="M21.356 32.144H28.332C28.524 31.376 28.636 30.5547 28.668 29.68V24.96H30.364V29.68C30.332 30.4907 30.2307 31.312 30.06 32.144H35.324V33.776H29.596C29.2547 34.6827 28.8173 35.4827 28.284 36.176C27.0467 37.7013 25.0413 38.8693 22.268 39.68L21.356 38.256C24.1933 37.3813 26.092 36.3147 27.052 35.056C27.3507 34.6187 27.5907 34.192 27.772 33.776H21.356V32.144ZM31.132 34.736C32.8067 35.952 34.2467 37.1787 35.452 38.416L34.188 39.68C33.1747 38.464 31.772 37.184 29.98 35.84L31.132 34.736ZM22.828 28.176C24.14 28.7307 25.356 29.4027 26.476 30.192L25.532 31.632C24.316 30.7147 23.116 30.0053 21.932 29.504L22.828 28.176ZM24.588 25.632C25.7187 26.1547 26.7533 26.7787 27.692 27.504L26.78 28.896C25.8307 28.096 24.8013 27.4453 23.692 26.944L24.588 25.632ZM41.392 29.088L41.168 29.232L40.144 28L39.904 28.512V39.648H38.224V31.376C37.84 31.8987 37.44 32.4107 37.024 32.912L36.464 31.12C37.84 29.3067 38.864 27.1733 39.536 24.72L41.088 25.456C40.8213 26.3733 40.512 27.216 40.16 27.984C41.6 27.216 42.8533 26.1227 43.92 24.704L45.616 25.088L45.088 25.808H48.816V26.848C48.5387 27.2427 48.24 27.6107 47.92 27.952H50.592V31.824H46.096C46.5973 32.368 46.9973 32.96 47.296 33.6C48.2453 33.1733 49.0613 32.6507 49.744 32.032L50.832 33.28C50.4267 33.6 49.9627 33.9093 49.44 34.208C49.8453 35.4987 50.544 36.64 51.536 37.632L50.432 39.008C49.408 37.7387 48.656 36.3467 48.176 34.832L47.808 34.992C47.9253 35.4507 48 35.9787 48.032 36.576C48.032 37.728 47.8347 38.5333 47.44 38.992C47.0987 39.3653 46.4853 39.6053 45.6 39.712C45.216 39.7333 44.9067 39.744 44.672 39.744L44.176 38.24C44.56 38.24 44.9653 38.2293 45.392 38.208C45.68 38.176 45.92 38.064 46.112 37.872C46.2827 37.6373 46.368 37.2053 46.368 36.576V36.512C45.0773 37.6213 43.424 38.5547 41.408 39.312L40.56 37.888C42.9493 37.1307 44.8107 36.1707 46.144 35.008C46.0907 34.8267 46.016 34.6187 45.92 34.384C44.7893 35.376 43.2907 36.192 41.424 36.832L40.624 35.472C42.6293 34.896 44.1973 34.16 45.328 33.264C45.2427 33.136 45.1147 32.9653 44.944 32.752C43.984 33.5627 42.752 34.128 41.248 34.448L40.64 33.088C41.888 32.832 42.9067 32.4107 43.696 31.824H41.392V29.088ZM45.888 27.952C46.1013 27.7707 46.4267 27.472 46.864 27.056H43.968C43.6907 27.3333 43.3653 27.632 42.992 27.952H45.888ZM48.976 30.48V29.296H46.912C46.8053 29.7547 46.688 30.1493 46.56 30.48H48.976ZM44.864 30.48C45.0667 30.096 45.2213 29.7013 45.328 29.296H43.008V30.48H44.864ZM52.516 25.36H66.9V26.96H60.628C60.4787 27.5573 60.324 28.0693 60.164 28.496H66.18V39.712H64.564V39.088H54.884V39.712H53.268V28.496H58.484C58.6653 28.0267 58.8147 27.5147 58.932 26.96H52.516V25.36ZM54.884 37.552H56.564V30.016H54.884V37.552ZM58.116 37.552H61.284V35.952H58.116V37.552ZM62.836 37.552H64.564V30.016H62.836V37.552ZM58.116 34.528H61.284V32.992H58.116V34.528ZM58.116 31.552H61.284V30.016H58.116V31.552Z" fill="#333333"/>
<rect id="Rectangle 34625823" x="20" y="137" width="297" height="10" rx="5" fill="#F1F3FC"/>
<g id="Group 427321538">
<g id="Group 427321534">
<rect id="Rectangle 34625822" x="20" y="84" width="47" height="12" rx="6" fill="#F1F3FC"/>
</g>
<g id="Group 427321536">
<rect id="Rectangle 34625822_2" x="75" y="84" width="130" height="12" rx="6" fill="#F1F3FC"/>
</g>
<g id="Group 427321537">
<rect id="Rectangle 34625822_3" x="75" y="104" width="82" height="12" rx="6" fill="#F1F3FC"/>
</g>
<g id="Group 427321533">
<rect id="Rectangle 34625820" x="20" y="68" width="47" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625821" x="75" y="68" width="65" height="12" rx="6" fill="#F1F3FC"/>
</g>
<g id="Group 427321532">
<rect id="Rectangle 34625816" x="20" y="52" width="47" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625818" x="105" y="52" width="27" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625817" x="75" y="52" width="22" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625819" x="140" y="52" width="22" height="12" rx="6" fill="#F1F3FC"/>
</g>
</g>
<g id="Group 427321535">
<circle id="Ellipse 3185" cx="277" cy="44" r="20" fill="#F1F3FC"/>
<path id="Ellipse 3186" d="M317 107C317 96.3913 312.786 86.2172 305.284 78.7157C297.783 71.2143 287.609 67 277 67C266.391 67 256.217 71.2143 248.716 78.7157C241.214 86.2172 237 96.3913 237 107L277 107H317Z" fill="#F1F3FC"/>
</g>
<g id="Union">
<path id="Union_2" d="M79.5 24C83.6421 24 87 27.3579 87 31.5C87 35.6421 83.6421 39 79.5 39C75.3579 39 72 35.6421 72 31.5C72 27.3579 75.3579 24 79.5 24ZM79.5 25C75.9101 25 73 27.9101 73 31.5C73 35.0899 75.9101 38 79.5 38C83.0899 38 86 35.0899 86 31.5C86 27.9101 83.0899 25 79.5 25ZM79.5 34C80.3284 34 81 34.6716 81 35.5C81 36.3284 80.3284 37 79.5 37C78.6716 37 78 36.3284 78 35.5C78 34.6716 78.6716 34 79.5 34ZM79.5 34L77.335 26.5H81.665L79.5 34Z" fill="#FF6B2E"/>
</g>
</g>
</g>
<defs>
<filter id="filter0_d_1949_1254" x="-4" y="0" width="343" height="176" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1949_1254"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1949_1254" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 5.7 KiB

5
src/assets/imgStyle.svg Normal file
View File

@ -0,0 +1,5 @@
<svg width="25" height="25" viewBox="0 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Vector">
<path id="Vector_2" d="M20.5357 25H4.46429C3.28028 25 2.14477 24.5297 1.30756 23.6924C0.470343 22.8552 0 21.7197 0 20.5357V4.46429C0 3.28028 0.470343 2.14477 1.30756 1.30756C2.14477 0.470343 3.28028 0 4.46429 0L20.5357 0C21.7197 6.47501e-09 22.8552 0.470343 23.6924 1.30756C24.5297 2.14477 25 3.28028 25 4.46429V20.5357C25 21.7197 24.5297 22.8552 23.6924 23.6924C22.8552 24.5297 21.7197 25 20.5357 25ZM22.3214 20.0893V14.7862C21.6227 14.4587 20.8609 14.2879 20.0893 14.2857C19.1477 14.2821 18.222 14.5276 17.406 14.9974C16.5901 15.4672 15.9129 16.1445 15.4434 16.9606C14.9738 17.7767 14.7285 18.7025 14.7324 19.644C14.7363 20.5855 14.9893 21.5093 15.4656 22.3214H20.0893C20.3824 22.3214 20.6727 22.2637 20.9435 22.1515C21.2143 22.0393 21.4604 21.8749 21.6676 21.6676C21.8749 21.4604 22.0393 21.2143 22.1515 20.9435C22.2637 20.6727 22.3214 20.3824 22.3214 20.0893ZM20.0893 2.67857H4.91071C4.61759 2.67857 4.32733 2.73631 4.05651 2.84848C3.78569 2.96066 3.53962 3.12508 3.33235 3.33235C3.12508 3.53962 2.96066 3.78569 2.84848 4.05651C2.73631 4.32733 2.67857 4.61759 2.67857 4.91071V20.0893C2.67857 20.3824 2.73631 20.6727 2.84848 20.9435C2.96066 21.2143 3.12508 21.4604 3.33235 21.6676C3.53962 21.8749 3.78569 22.0393 4.05651 22.1515C4.32733 22.2637 4.61759 22.3214 4.91071 22.3214H12.5263C12.0243 20.93 11.9179 19.4267 12.2189 17.9784C12.5199 16.5302 13.2165 15.1938 14.2314 14.1177C15.2463 13.0416 16.5397 12.2679 17.9679 11.8828C19.3961 11.4976 20.9031 11.5159 22.3214 11.9357V4.91071C22.3214 4.61759 22.2637 4.32733 22.1515 4.05651C22.0393 3.78569 21.8749 3.53962 21.6676 3.33235C21.4604 3.12508 21.2143 2.96066 20.9435 2.84848C20.6727 2.73631 20.3824 2.67857 20.0893 2.67857ZM8.48214 12.9464C7.68749 12.9464 6.91067 12.7108 6.24994 12.2693C5.58921 11.8278 5.07423 11.2003 4.77013 10.4661C4.46602 9.73197 4.38646 8.92411 4.54149 8.14473C4.69652 7.36534 5.07918 6.64942 5.64109 6.08752C6.203 5.52561 6.91891 5.14295 7.6983 4.98792C8.47769 4.83289 9.28554 4.91245 10.0197 5.21656C10.7539 5.52066 11.3814 6.03564 11.8229 6.69637C12.2644 7.3571 12.5 8.13391 12.5 8.92857C12.5 9.99417 12.0767 11.0161 11.3232 11.7696C10.5697 12.5231 9.54775 12.9464 8.48214 12.9464ZM8.48214 7.58929C8.21726 7.58929 7.95832 7.66783 7.73808 7.815C7.51783 7.96216 7.34617 8.17133 7.2448 8.41605C7.14344 8.66077 7.11691 8.93006 7.16859 9.18985C7.22027 9.44965 7.34782 9.68829 7.53513 9.87559C7.72243 10.0629 7.96107 10.1904 8.22086 10.2421C8.48066 10.2938 8.74994 10.2673 8.99467 10.1659C9.23939 10.0645 9.44855 9.89288 9.59572 9.67264C9.74288 9.45239 9.82143 9.19346 9.82143 8.92857C9.82143 8.57337 9.68033 8.23272 9.42916 7.98155C9.178 7.73039 8.83734 7.58929 8.48214 7.58929Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.7 KiB

51
src/assets/license.svg Normal file
View File

@ -0,0 +1,51 @@
<svg width="335" height="180" viewBox="0 0 335 180" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 32076">
<g id="Frame 32075">
<g id="Group 427321581">
<g id="Rectangle 34625815" filter="url(#filter0_d_1949_1260)">
<rect width="335" height="168" rx="10" fill="white"/>
<rect x="0.5" y="0.5" width="334" height="167" rx="9.5" stroke="#F1F3FC"/>
</g>
<g id="Group 427321549">
<g id="Group 427321547">
<g id="Group 427321545">
<path id="Vector 726" d="M20 39V23C20 21.8954 20.8954 21 22 21H35" stroke="#F1F3FC" stroke-width="4" stroke-linecap="round"/>
</g>
<g id="Group 427321546">
<path id="Vector 726_2" d="M317 39V23C317 21.8954 316.105 21 315 21H302" stroke="#F1F3FC" stroke-width="4" stroke-linecap="round"/>
</g>
</g>
<g id="Group 427321548">
<g id="Group 427321545_2">
<path id="Vector 726_3" d="M317 129L317 145C317 146.105 316.105 147 315 147L302 147" stroke="#F1F3FC" stroke-width="4" stroke-linecap="round"/>
</g>
<g id="Group 427321546_2">
<path id="Vector 726_4" d="M20 129L20 145C20 146.105 20.8954 147 22 147L35 147" stroke="#F1F3FC" stroke-width="4" stroke-linecap="round"/>
</g>
</g>
</g>
<g id="Group 427321544">
<path id="Vector" d="M168 13C172.509 13 176.833 14.7271 180.021 17.8014C183.209 20.8756 185 25.0452 185 29.3929C185 33.7405 183.209 37.9101 180.021 40.9844C176.833 44.0586 172.509 45.7857 168 45.7857C163.491 45.7857 159.167 44.0586 155.979 40.9844C152.791 37.9101 151 33.7405 151 29.3929C151 25.0452 152.791 20.8756 155.979 17.8014C159.167 14.7271 163.491 13 168 13ZM168 15.7321C164.243 15.7321 160.639 17.1714 157.983 19.7333C155.326 22.2952 153.833 25.7698 153.833 29.3929C153.833 33.0159 155.326 36.4906 157.983 39.0524C160.639 41.6143 164.243 43.0536 168 43.0536C171.757 43.0536 175.361 41.6143 178.017 39.0524C180.674 36.4906 182.167 33.0159 182.167 29.3929C182.167 25.7698 180.674 22.2952 178.017 19.7333C175.361 17.1714 171.757 15.7321 168 15.7321Z" fill="#F1F3FC"/>
<path id="Vector_2" d="M168.001 19.0718C170.899 19.0718 173.679 20.2232 175.729 22.2727C177.778 24.3222 178.929 27.1019 178.929 30.0003C178.929 32.8988 177.778 35.6785 175.729 37.728C173.679 39.7775 170.899 40.9289 168.001 40.9289C165.102 40.9289 162.323 39.7775 160.273 37.728C158.224 35.6785 157.072 32.8988 157.072 30.0003C157.072 27.1019 158.224 24.3222 160.273 22.2727C162.323 20.2232 165.102 19.0718 168.001 19.0718ZM168.001 21.8039C165.827 21.8039 163.742 22.6675 162.205 24.2046C160.668 25.7417 159.804 27.8265 159.804 30.0003C159.804 32.1742 160.668 34.259 162.205 35.7961C163.742 37.3332 165.827 38.1968 168.001 38.1968C170.175 38.1968 172.259 37.3332 173.797 35.7961C175.334 34.259 176.197 32.1742 176.197 30.0003C176.197 27.8265 175.334 25.7417 173.797 24.2046C172.259 22.6675 170.175 21.8039 168.001 21.8039Z" fill="#F1F3FC"/>
<path id="Vector_3" d="M166.79 44.2649L156.727 39.7144L151 51.6239L157.504 50.6196L161.224 55.8406L166.79 44.2622V44.2649ZM163.1 45.5655L160.755 50.4473L158.795 47.7008L155.722 48.172L158.07 43.2902L163.1 45.5655ZM169.155 44.2703L179.218 39.7197L185 51.7451L178.365 50.5873L174.846 56.1072L169.155 44.2703ZM172.844 45.5709L175.19 50.4526L177 47.6146L180.22 48.1774L177.877 43.2956L172.844 45.5709Z" fill="#F1F3FC"/>
</g>
<rect id="Rectangle 34625823" x="65" y="84" width="103" height="10" rx="5" fill="#F1F3FC"/>
<rect id="Rectangle 34625825" x="65" y="108" width="206" height="10" rx="5" fill="#F1F3FC"/>
<rect id="Rectangle 34625826" x="242" y="131" width="57" height="10" rx="5" fill="#F1F3FC"/>
<rect id="Rectangle 34625824" x="100" y="68" width="135" height="10" rx="5" fill="#F1F3FC"/>
</g>
</g>
</g>
<defs>
<filter id="filter0_d_1949_1260" x="-4" y="0" width="343" height="176" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1949_1260"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1949_1260" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 4.2 KiB

33
src/assets/opposite.svg Normal file
View File

@ -0,0 +1,33 @@
<svg width="335" height="180" viewBox="0 0 335 180" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Frame 32074">
<g id="Group 427321602">
<g id="Group 427321540">
<g id="Rectangle 34625815" filter="url(#filter0_d_1949_1257)">
<rect width="335" height="168" rx="10" fill="white"/>
<rect x="0.5" y="0.5" width="334" height="167" rx="9.5" stroke="#F1F3FC"/>
</g>
<path id="&#229;&#155;&#189;&#229;&#190;&#189;&#233;&#157;&#162;" d="M254.332 27.968H262.252V29.472H259.148V31.296H261.756V32.768H259.148V34.864H260.604C260.359 34.288 260.071 33.7707 259.74 33.312L261.068 32.88C261.452 33.4133 261.761 33.9573 261.996 34.512L261.212 34.864H262.716V36.368H253.9V34.864H257.452V32.768H254.844V31.296H257.452V29.472H254.332V27.968ZM265.084 25.424V39.648H263.388V39.056H253.212V39.648H251.516V25.424H265.084ZM253.212 37.488H263.388V26.992H253.212V37.488ZM270.784 25.424C270.048 27.1733 268.784 28.7627 266.992 30.192L266.48 28.592C267.771 27.4933 268.725 26.2133 269.344 24.752L270.784 25.424ZM271.328 29.328C270.976 30.16 270.517 30.9547 269.952 31.712V39.568H268.384V33.488C267.936 33.8933 267.515 34.2613 267.12 34.592L266.64 33.024C268.133 31.776 269.227 30.32 269.92 28.656L271.328 29.328ZM273.024 24.864H274.336V27.456H275.008V25.504H276.288V28.8H271.088V25.504H272.368V27.456H273.024V24.864ZM271.376 29.584H276V30.992H273.488L274.112 31.232C273.685 31.808 273.205 32.336 272.672 32.816L273.904 32.624C274.203 32.304 274.427 32.0587 274.576 31.888L275.824 32.352C274.981 33.3227 274.048 34.1867 273.024 34.944C273.451 34.88 274.101 34.7627 274.976 34.592C274.88 34.368 274.768 34.1387 274.64 33.904L275.776 33.504C276.139 34.2187 276.453 34.9493 276.72 35.696L275.6 36.208L275.376 35.568L274.56 35.76V37.936C274.56 38.8747 274.139 39.344 273.296 39.344H272.16L271.856 38.08C271.621 38.4747 271.387 38.8213 271.152 39.12L270.128 38.384C270.597 37.8827 271.013 37.28 271.376 36.576L272.4 37.072C272.229 37.424 272.08 37.712 271.952 37.936C272.272 37.9893 272.549 38.016 272.784 38.016C272.997 38.016 273.104 37.8667 273.104 37.568V36.048C272.336 36.176 271.664 36.2667 271.088 36.32L270.784 35.2C271.52 34.72 272.155 34.2507 272.688 33.792C272.155 33.8773 271.675 33.936 271.248 33.968L270.96 32.976C271.6 32.4213 272.181 31.76 272.704 30.992H271.376V29.584ZM275.872 36.32C276.181 36.9067 276.416 37.3707 276.576 37.712C277.163 37.0827 277.669 36.2987 278.096 35.36C277.776 34.5067 277.477 33.472 277.2 32.256C277.115 32.4587 276.976 32.752 276.784 33.136L275.776 31.888C276.555 30.096 277.072 27.7493 277.328 24.848L278.832 25.104C278.768 25.68 278.677 26.384 278.56 27.216H281.296V28.768H280.768C280.704 31.4133 280.309 33.6693 279.584 35.536C280.117 36.6347 280.768 37.5093 281.536 38.16L280.576 39.568C279.925 38.9387 279.349 38.1173 278.848 37.104C278.304 38.032 277.637 38.8587 276.848 39.584L276.32 38.736L275.872 39.04C275.627 38.4213 275.291 37.728 274.864 36.96L275.872 36.32ZM277.92 30.192C278.155 31.4507 278.432 32.5493 278.752 33.488C279.115 32.0907 279.317 30.5173 279.36 28.768H278.272C278.133 29.376 278.016 29.8507 277.92 30.192ZM282.516 25.36H296.9V26.96H290.628C290.479 27.5573 290.324 28.0693 290.164 28.496H296.18V39.712H294.564V39.088H284.884V39.712H283.268V28.496H288.484C288.665 28.0267 288.815 27.5147 288.932 26.96H282.516V25.36ZM284.884 37.552H286.564V30.016H284.884V37.552ZM288.116 37.552H291.284V35.952H288.116V37.552ZM292.836 37.552H294.564V30.016H292.836V37.552ZM288.116 34.528H291.284V32.992H288.116V34.528ZM288.116 31.552H291.284V30.016H288.116V31.552Z" fill="#333333"/>
<rect id="Rectangle 34625823" x="65" y="135" width="206" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625824" x="65" y="119" width="206" height="12" rx="6" fill="#F1F3FC"/>
<rect id="Rectangle 34625825" x="102" y="24" width="130" height="24" rx="12" fill="#F1F3FC"/>
<rect id="Rectangle 34625826" x="102" y="56" width="215" height="24" rx="12" fill="#F1F3FC"/>
<path id="Union" d="M309.5 24C313.642 24 317 27.3579 317 31.5C317 35.6421 313.642 39 309.5 39C305.358 39 302 35.6421 302 31.5C302 27.3579 305.358 24 309.5 24ZM309.5 25C305.91 25 303 27.9101 303 31.5C303 35.0899 305.91 38 309.5 38C313.09 38 316 35.0899 316 31.5C316 27.9101 313.09 25 309.5 25ZM309.5 34C310.328 34 311 34.6716 311 35.5C311 36.3284 310.328 37 309.5 37C308.672 37 308 36.3284 308 35.5C308 34.6716 308.672 34 309.5 34ZM309.5 34L307.335 26.5H311.665L309.5 34Z" fill="#FF6B2E"/>
</g>
<path id="Vector" d="M48 21C55.4261 21 62.548 23.8446 67.799 28.9081C73.05 33.9716 76 40.8392 76 48C76 55.1608 73.05 62.0284 67.799 67.0919C62.548 72.1554 55.4261 75 48 75C40.5739 75 33.452 72.1554 28.201 67.0919C22.95 62.0284 20 55.1608 20 48C20 40.8392 22.95 33.9716 28.201 28.9081C33.452 23.8446 40.5739 21 48 21ZM48 25.5C41.8116 25.5 35.8767 27.8705 31.5008 32.0901C27.125 36.3097 24.6667 42.0326 24.6667 48C24.6667 53.9674 27.125 59.6903 31.5008 63.9099C35.8767 68.1295 41.8116 70.5 48 70.5C54.1884 70.5 60.1233 68.1295 64.4992 63.9099C68.875 59.6903 71.3333 53.9674 71.3333 48C71.3333 42.0326 68.875 36.3097 64.4992 32.0901C60.1233 27.8705 54.1884 25.5 48 25.5Z" fill="#F1F3FC"/>
<path id="Vector_2" d="M48 31C52.7739 31 57.3523 32.8964 60.7279 36.2721C64.1036 39.6477 66 44.2261 66 49C66 53.7739 64.1036 58.3523 60.7279 61.7279C57.3523 65.1036 52.7739 67 48 67C43.2261 67 38.6477 65.1036 35.2721 61.7279C31.8964 58.3523 30 53.7739 30 49C30 44.2261 31.8964 39.6477 35.2721 36.2721C38.6477 32.8964 43.2261 31 48 31ZM48 35.5C44.4196 35.5 40.9858 36.9223 38.4541 39.4541C35.9223 41.9858 34.5 45.4196 34.5 49C34.5 52.5804 35.9223 56.0142 38.4541 58.5459C40.9858 61.0777 44.4196 62.5 48 62.5C51.5804 62.5 55.0142 61.0777 57.5459 58.5459C60.0777 56.0142 61.5 52.5804 61.5 49C61.5 45.4196 60.0777 41.9858 57.5459 39.4541C55.0142 36.9223 51.5804 35.5 48 35.5Z" fill="#F1F3FC"/>
<path id="Vector_3" d="M46.0065 72.4951L29.4324 65L20 84.6158L30.7126 82.9616L36.8393 91.5609L46.0065 72.4906V72.4951ZM39.9301 74.6372L36.0666 82.6777L32.8387 78.1541L27.7773 78.9302L31.6453 70.8896L39.9301 74.6372ZM49.902 72.5039L66.4762 65.0089L76 84.8154L65.0725 82.9083L59.275 92L49.902 72.5039ZM55.9784 74.646L59.8419 82.6866L62.823 78.0122L68.1267 78.9391L64.2678 70.8985L55.9784 74.646Z" fill="#F1F3FC"/>
</g>
</g>
<defs>
<filter id="filter0_d_1949_1257" x="-4" y="0" width="343" height="176" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
<feFlood flood-opacity="0" result="BackgroundImageFix"/>
<feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/>
<feOffset dy="4"/>
<feGaussianBlur stdDeviation="2"/>
<feComposite in2="hardAlpha" operator="out"/>
<feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/>
<feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1949_1257"/>
<feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1949_1257" result="shape"/>
</filter>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
src/assets/seerTeach.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

13
src/assets/tree.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 4.0 MiB

6
src/assets/warehouse.svg Normal file
View File

@ -0,0 +1,6 @@
<svg width="21" height="20" viewBox="0 0 21 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="Group 427321525">
<path id="Vector" d="M17.5191 8.9625C16.4717 8.35386 12.7153 6.18849 11.1863 5.24042C10.7649 4.97121 10.3555 4.90098 10.0064 5.17019C9.8017 5.31064 2.62606 9.57114 2.62606 9.57114C2.62606 9.57114 2 9.84035 2 11.0576L2.42139 18.9817C2.42139 19.5201 2.90297 20 3.54108 20H17.5312C18.085 20 18.5786 19.5318 18.6508 18.9817L19 11.1279V10.5894C18.988 10.5894 18.988 9.85206 17.5191 8.9625ZM15.0871 17.425H5.88881C5.6119 17.425 5.40722 17.226 5.40722 16.9568C5.40722 16.6876 5.6119 16.4886 5.88881 16.4886H15.0149C15.2918 16.4886 15.4965 16.6876 15.4965 16.9568C15.5085 17.226 15.2918 17.425 15.0871 17.425ZM15.0871 14.9904H5.88881C5.6119 14.9904 5.40722 14.7914 5.40722 14.5222C5.40722 14.253 5.6119 14.054 5.88881 14.054H15.0149C15.2918 14.054 15.4965 14.253 15.4965 14.5222C15.5085 14.7914 15.2918 14.9904 15.0871 14.9904ZM15.0871 12.4856H5.88881C5.6119 12.4856 5.40722 12.2866 5.40722 12.0174C5.40722 11.7482 5.6119 11.5492 5.88881 11.5492H15.0149C15.2918 11.5492 15.4965 11.7482 15.4965 12.0174C15.5085 12.2866 15.2918 12.4856 15.0871 12.4856Z" fill="white"/>
<path id="Vector_2" d="M20.587 6.97083L11.0453 0.190105C10.6937 -0.0241554 10.2087 -0.0997768 9.85712 0.190105L0.47301 6.68094C-0.0119569 7.04645 -0.157447 7.70183 0.194154 8.20597C0.545755 8.71012 1.17621 8.86136 1.66118 8.49586L10.4997 2.44614L19.3988 8.78574C19.605 8.93698 19.8232 9 19.9566 9C20.3082 9 20.587 8.84876 20.7931 8.55888C21.1569 7.99171 21.0114 7.33633 20.587 6.97083Z" fill="white"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,59 +0,0 @@
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br>
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener">vue-cli documentation</a>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel" target="_blank" rel="noopener">babel</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router" target="_blank" rel="noopener">router</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint" target="_blank" rel="noopener">eslint</a></li>
</ul>
<h3>Essential Links</h3>
<ul>
<li><a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a></li>
<li><a href="https://forum.vuejs.org" target="_blank" rel="noopener">Forum</a></li>
<li><a href="https://chat.vuejs.org" target="_blank" rel="noopener">Community Chat</a></li>
<li><a href="https://twitter.com/vuejs" target="_blank" rel="noopener">Twitter</a></li>
<li><a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a></li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li><a href="https://router.vuejs.org" target="_blank" rel="noopener">vue-router</a></li>
<li><a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a></li>
<li><a href="https://github.com/vuejs/vue-devtools#vue-devtools" target="_blank" rel="noopener">vue-devtools</a></li>
<li><a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener">vue-loader</a></li>
<li><a href="https://github.com/vuejs/awesome-vue" target="_blank" rel="noopener">awesome-vue</a></li>
</ul>
</div>
</template>
<script>
export default {
name: 'HelloWorld',
props: {
msg: String
}
}
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="stylus">
h3
margin 40px 0 0
ul
list-style-type none
padding 0
li
display inline-block
margin 0 10px
a
color #42b983
</style>

View File

@ -3,4 +3,7 @@ import App from './App.vue'
import router from './router'
import store from './store'
createApp(App).use(store).use(router).mount('#app')
import Vant from 'vant'
import 'vant/lib/index.css'
createApp(App).use(store).use(Vant).use(router).mount('#app')

View File

@ -1,19 +1,28 @@
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
const routes = [
{
path: '/',
name: 'home',
component: HomeView
path: '/login',
name: 'login',
component: () => import('@/views/login/index')
},
{
path: '/about',
name: 'about',
// route level code-splitting
// this generates a separate chunk (about.[hash].js) for this route
// which is lazy-loaded when the route is visited.
component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
path: '/addUser',
name: 'addUser',
component: () => import('@/views/addUser/index')
},
{
path: '/dealer',
name: 'dealer',
redirect: '/dealer/home',
component: () => import('@/views/Layout.vue'),
children: [
{
path: 'home',
name: 'home',
component: () => import('@/views/dealer/home')
}
]
}
]

7
src/store/getters.js Normal file
View File

@ -0,0 +1,7 @@
const getters = {
token: state => state.user.token,
avatar: state => state.user.avatar,
name: state => state.user.name,
roles: state => state.user.roles
}
export default getters

View File

@ -1,14 +1,12 @@
import { createStore } from 'vuex'
import user from './modules/user'
import getters from './getters'
export default createStore({
state: {
},
getters: {
},
mutations: {
},
actions: {
},
const store = createStore({
modules: {
}
user
},
getters
})
export default store

95
src/store/modules/user.js Normal file
View File

@ -0,0 +1,95 @@
import { login, logout, getInfo } from '@/api/login'
import { getToken, setToken, removeToken } from '@/utils/auth'
const user = {
namespaced: true, // 启用命名空间
state: {
token: getToken(),
name: '',
avatar: '',
roles: []
},
mutations: {
SET_TOKEN: (state, token) => {
state.token = token
},
SET_NAME: (state, name) => {
state.name = name
},
SET_AVATAR: (state, avatar) => {
state.avatar = avatar
},
SET_ROLES: (state, roles) => {
state.roles = roles
}
},
actions: {
// 登录
Login ({ commit }, userInfo) {
const username = userInfo.username.trim()
return new Promise((resolve, reject) => {
login(username, userInfo.password).then(response => {
const { data } = response
const tokenStr = data.tokenValue
setToken(tokenStr)
commit('SET_TOKEN', tokenStr)
resolve(data)
}).catch(error => {
reject(error)
})
})
},
// 获取用户信息
GetInfo ({ commit }) {
return new Promise((resolve, reject) => {
getInfo().then(response => {
const { data } = response
if (data.roles && data.roles.length > 0) {
commit('SET_ROLES', data.roles)
} else {
reject(new Error('getInfo: roles must be a non-null array !'))
}
commit('SET_NAME', data.userName)
commit('SET_AVATAR', data.avatar || '')
resolve(data)
}).catch(error => {
reject(error)
})
})
},
// 登出
LogOut ({ commit, state }) {
return new Promise((resolve, reject) => {
logout(state.token).then(() => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_NAME', '')
commit('SET_AVATAR', '')
removeToken()
resolve()
}).catch(error => {
reject(error)
})
})
},
// 前端登出
FedLogOut ({ commit }) {
return new Promise(resolve => {
commit('SET_TOKEN', '')
commit('SET_ROLES', [])
commit('SET_NAME', '')
commit('SET_AVATAR', '')
removeToken()
resolve()
})
}
}
}
export default user

15
src/utils/auth.js Normal file
View File

@ -0,0 +1,15 @@
import Cookies from 'js-cookie'
const TokenKey = 'loginToken'
export function getToken () {
return Cookies.get(TokenKey)
}
export function setToken (token) {
return Cookies.set(TokenKey, token)
}
export function removeToken () {
return Cookies.remove(TokenKey)
}

96
src/utils/request.js Normal file
View File

@ -0,0 +1,96 @@
import axios from 'axios'
import { Toast, Dialog } from 'vant'
import store from '../store'
import { getToken } from '@/utils/auth'
// 创建axios实例
const service = axios.create({
baseURL: process.env.VUE_APP_BASE_API || '/api', // 修改环境变量前缀
timeout: 15000 // 请求超时时间
})
// request拦截器
service.interceptors.request.use(
config => {
if (store.getters.token) {
config.headers.token = getToken() // 让每个请求携带自定义token
}
return config
},
error => {
console.log(error) // for debug
return Promise.reject(error)
}
)
// response拦截器
service.interceptors.response.use(
response => {
/**
* code为非200是抛错 可结合自己业务进行修改
*/
const res = response.data
// 如果返回的是文件流或其他非标准格式,直接返回
if (response.request.responseType === 'blob' || response.request.responseType === 'arraybuffer') {
return response
}
if (res.code !== 200) {
// 401:未登录
if (res.code === 401) {
Dialog.confirm({
title: '确定登出',
message: '你已被登出,可以取消继续留在该页面,或者重新登录',
confirmButtonText: '重新登录',
cancelButtonText: '取消'
}).then(() => {
store.dispatch('user/FedLogOut').then(() => {
location.reload() // 为了重新实例化vue-router对象 避免bug
})
}).catch(() => {
// 用户取消操作
})
return Promise.reject(res)
}
// 弹出错误信息,显示后端返回的消息
Toast(res.msg || '错误')
return Promise.reject(res)
} else {
return res
}
},
error => {
console.log('err' + error) // for debug
// 处理网络错误
if (error.message.includes('timeout')) {
Toast('请求超时,请稍后重试')
} else if (error.message.includes('Network Error')) {
Toast('网络错误,请检查网络连接')
} else {
// 处理token无效的情况
if (error.response && error.response.status === 401) {
Dialog.confirm({
title: '提示',
message: '登录已过期,请重新登录',
confirmButtonText: '重新登录',
cancelButtonText: '取消'
}).then(() => {
store.dispatch('user/FedLogOut').then(() => {
location.reload()
})
}).catch(() => {
// 用户取消操作
})
} else {
Toast(error.message || '网络错误')
}
}
return Promise.reject(error)
}
)
export default service

View File

@ -0,0 +1,19 @@
// 微信授权跳转
export const wxAuthRedirect = () => {
const appId = 'wx8f2aa0defc700688' // 替换实际值
const redirectUri = encodeURIComponent(window.location.origin + '/addUser')
const authUrl = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redirectUri}&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect`
// 清除可能存在的旧code
const cleanUrl = window.location.href.split('?')[0]
window.history.replaceState({}, document.title, cleanUrl)
window.location.href = authUrl
}
// 解析URL参数
export const getUrlParam = (name) => {
const reg = new RegExp(`(^|&)${name}=([^&]*)(&|$)`)
const match = window.location.search.substr(1).match(reg)
return match ? decodeURIComponent(match[2]) : null
}

View File

@ -1,5 +0,0 @@
<template>
<div class="about">
<h1>This is an about page</h1>
</div>
</template>

View File

@ -1,18 +0,0 @@
<template>
<div class="home">
<img alt="Vue logo" src="../assets/logo.png">
<HelloWorld msg="Welcome to Your Vue.js App"/>
</div>
</template>
<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
export default {
name: 'HomeView',
components: {
HelloWorld
}
}
</script>

20
src/views/Layout.vue Normal file
View File

@ -0,0 +1,20 @@
<template>
<div class="management">
<!-- 这里可以放置代理方面的公共部分 -->
<router-view></router-view> <!-- 关键子路由将在这里渲染 -->
</div>
</template>
<script>
export default {
name: 'Layout'
}
</script>
<style scoped>
.management {
padding:0 20px;
background: #fff;
box-sizing: border-box;
}
</style>

173
src/views/addUser/index.vue Normal file
View File

@ -0,0 +1,173 @@
<template>
<div class="body">
<div class="title">
<div class="title-top">上传身份证的正反面<span style="color: #FF6B2E">*</span></div>
<div class="title-bottom">我确认身份证影像是本人名下最新且有效的身份证影像</div>
</div>
<van-uploader v-model="fileList" multiple class="uploader front" >
<div class="uploadStyle">
<div class="imgStyle">
<img src="@/assets/imgStyle.svg" alt="">
</div>
<div class="text">待上传</div>
</div>
</van-uploader>
<van-uploader v-model="fileList" multiple class="uploader opposite" >
<div class="uploadStyle">
<div class="imgStyle">
<img src="@/assets/imgStyle.svg" alt="">
</div>
<div class="text">待上传</div>
</div>
</van-uploader>
<div class="title">
<div class="title-top">上传营业执照<span style="color: #FF6B2E">*</span></div>
<div class="title-bottom">请上传您的营业执照</div>
</div>
<van-uploader v-model="fileList" multiple class="uploader license" >
<div class="uploadStyle">
<div class="imgStyle">
<img src="@/assets/imgStyle.svg" alt="">
</div>
<div class="text">待上传</div>
</div>
</van-uploader>
<div class="title">
<div class="title-top">请完善您的个人信息<span style="color: #FF6B2E">*</span></div>
<van-cell-group>
<van-field
v-model="username"
required
clearable
label="姓名"
placeholder="请输入姓名"
/>
<van-field
v-model="idCard"
label="身份证号"
placeholder="请输入本人身份证号"
required
/>
<van-field
v-model="phone"
label="手机号码"
placeholder="请输入本人的手机号码"
required
/>
</van-cell-group>
<van-button type="primary" size="large" round color="#ff6b2e" style="margin-top: 10px" @click="goDealerHome">提交</van-button>
</div>
</div>
</template>
<script>
import { getUrlParam } from '@/utils/wx-api-config'
export default {
name: 'addUser',
data () {
return {
fileList: [],
username: '',
idCard: '',
phone: ''
}
},
created () {
this.handleWechatAuth()
},
methods: {
async handleWechatAuth () {
try {
const code = getUrlParam('code')
if (!code) {
throw new Error('未获取到授权code')
}
console.log('授权成功获取到的code为', code)
//
// this.$router.replace('/login')
} catch (error) {
console.error('授权失败:', error)
this.error = true
this.errorMsg = error.message || '未知错误'
} finally {
this.loading = false
}
},
goDealerHome () {
this.$router.replace('/dealer/home')
}
}
}
</script>
<style scoped>
.body{
width: 100vw;
display: flex;
padding: 0 20px 20px;
flex-direction: column;
color: #333;
box-sizing: border-box;
}
.title{
margin-top: 10px;
}
.title-top{
font-weight: 600;
font-size: 16px;
}
.title-bottom{
font-size: 10px;
}
.uploader{
width: 100%;
height: 180px;
background-size: 100%; /* 拉伸图片填满整个容器 */
background-repeat: no-repeat;
margin-top: 10px;
}
.opposite{
background-image: url('@/assets/opposite.svg');
}
.front{
background-image: url('@/assets/front.svg');
}
.license{
background-image: url('@/assets/license.svg');
}
.body /deep/ .van-uploader__wrapper{
height: 100%;
}
.body /deep/ .van-uploader__input-wrapper{
width: 100%;
}
.uploadStyle{
width: 100%;
height: 100%;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
.imgStyle{
width: 56px;
height: 56px;
background: #ff6b2e;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
}
.text{
color: #FF6B2E;
font-size: 14px;
font-weight: 600;
margin-top: 10px;
}
.title /deep/ .van-cell{
padding-left: 0;
padding-right: 0;
}
</style>

61
src/views/dealer/home.vue Normal file
View File

@ -0,0 +1,61 @@
<template>
<div class="body">
<div class="item">
<div style="display: flex;flex-direction: column">
<div class="name">黄埔长威</div>
<div>联系方式:13137589630</div>
</div>
<div>退出账号</div>
</div>
<div class="item">
<div>申请提货</div>
<img src="@/assets/enterItem.svg" alt="" class="imgItem">
</div>
<div class="item">
<div>申请退货</div>
<img src="@/assets/enterItem.svg" alt="" class="imgItem">
</div>
<div class="item">
<div>历史记录</div>
<img src="@/assets/enterItem.svg" alt="" class="imgItem">
</div>
</div>
</template>
<script>
export default {
name: 'home',
data () {
return {
}
}
}
</script>
<style scoped>
.body{
height: 100vh;
display: flex;
flex-direction: column;
font-size: 14px;
box-sizing: border-box;
color: #333333;
}
.item{
display: flex;
flex-direction: row;
justify-content: space-between;
box-sizing: border-box;
padding: 0 21px;
align-items: center;
border: 1px solid #DBDBDB;
border-radius: 20px;
height: 60px;
margin-top: 20px;
}
.name{
font-size: 16px;
}
.imgItem{
width: 19px;
height: 19px;
}
</style>

119
src/views/login/index.vue Normal file
View File

@ -0,0 +1,119 @@
<template>
<div class="login-container">
<div class="logo-container">
<img src="@/assets/seerTeach.png" alt="SeerTeach Logo" class="logo">
<img src="@/assets/cooperate.svg" alt="Cooperate Logo" class="cooperate">
</div>
<div class="content">
<div class="loginStyle" @click="goAgent">
<div class="login-item">
<img src="@/assets/agent.svg" alt="" class="imgItem">
<div class="text">代理人</div>
</div>
<img src="@/assets/enter.svg" alt="" class="imgItem">
</div>
<div class="loginStyle">
<div class="login-item">
<img src="@/assets/warehouse.svg" alt="" class="imgItem">
<div class="text">仓管</div>
</div>
<img src="@/assets/enter.svg" alt="" class="imgItem">
</div>
</div>
</div>
</template>
<script>
import { Dialog } from 'vant'
import { wxAuthRedirect } from '@/utils/wx-api-config'
export default {
name: 'Login',
data () {
return {
loading: true,
error: false,
errorMsg: ''
}
},
methods: {
goAgent () {
Dialog.confirm({
title: '提示',
message: '此操作会获取您的昵称和头像信息'
}).then(() => {
// on confirm
wxAuthRedirect()
// this.$router.push('/addUser')
}).catch(() => {
// on cancel
})
}
}
}
</script>
<style scoped>
.login-container {
background: #1e1e1e;
width: 100vw;
display: flex;
height: 100%;
flex-direction: column;
justify-content: flex-start;
align-items: center;
box-sizing: border-box;
padding-top: 30px;
padding-bottom: 80px;
}
.logo-container {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.logo {
width: 150px;
height: auto;
}
.cooperate{
width: 312px;
height: auto;
}
.tree{
width: 100%;
position: relative;
top: -20px;
}
.content {
text-align: center;
}
.loginStyle{
background: #4b4b4b;
width: 335px;
height: 63px;
border: 1px solid #FFFFFF;
border-radius: 40px;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 0 20px;
margin-bottom: 20px;
}
.login-item{
display: flex;
justify-content: center;
flex-direction: row;
}
.imgItem{
width: 20px;
height: 20px;
}
.text{
font-size: 16px;
color: #FFFFFF;
margin-left: 12px;
}
</style>

View File

@ -1,4 +1,102 @@
// const { defineConfig } = require('@vue/cli-service')
// module.exports = defineConfig({
// transpileDependencies: true
// })
const { defineConfig } = require('@vue/cli-service')
const path = require('path')
const resolve = (dir) => path.join(__dirname, dir)
module.exports = defineConfig({
transpileDependencies: true
transpileDependencies: true,
publicPath: '/', // 署应用包时的基本 URL。 vue-router hash 模式使用
outputDir: 'dist', // 生产环境构建文件的目录
assetsDir: 'static', // outputDir的静态资源(js、css、img、fonts)目录
lintOnSave: false, // eslint 检测
productionSourceMap: false, // 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
devServer: {
hot: true,
compress: true,
historyApiFallback: true,
static: {
directory: path.join(__dirname, 'public')
},
port: 8080,
headers: {
'Access-Control-Allow-Origin': '*'
}
},
chainWebpack: (config) => {
config.resolve.alias
.set('@', resolve('src'))
.set('assets', resolve('src/assets'))
.set('api', resolve('src/api'))
.set('views', resolve('src/views'))
.set('components', resolve('src/components'))
}
})
// module.exports = defineConfig({
//
// publicPath: '/', // 应用程序域名后的根目录运行后为http://localhost:8081/ ,如果设置子路径为/myh5/ :http://10.29.0.20:8082/myh5/
// outputDir: 'dist', // 生成生产环境文件的目录,(打包后的文件存放目录)
// assetsDir: 'staticDir', // 防止生成的静态资源(js\css\img\fonts)(相对于outputDir的目录)
// indexPath: 'index.html', // 指定生成的index.html的输出路径在打包后也就是在dist文件中index.html生成的位置如果写成a/b/c.html,那生成的dist里面index.html就是dist/a/b/c.html
// filenameHashing: false, // 默认为true在打包之后生成的dist目录的静态资源的文件名会追加上hash值比如common.f151bhg.js,设置为false就不要hash
// // pages:{ // 多页模式下配置的,每个页面都有对应的条目文件,每个条目中都有entrytemplatefilenametitle和chunks和其他自定义添加的属性
// // index:{}
// // },
// lintOnSave: false, // 设置是否在开发环境下每次保存代码时都进行eslint验证
// // false关闭每次保存都进行检测
// // true开启每次保存都进行检测效果与warning一样
// // error开启每次保存都进行检测lint 错误将显示到浏览器页面上,且编译失败。
// // default同error
// // warning开启每次保存都进行检测lint 错误将显示到控制台命令行,而且编译并不会失败。
// // 所有 webpack-dev-server 的选项都支持
// devServer: { // 配置dev的服务器包括hostport热更新代理服务器配置等
// overlay: {
// warnings: false,
// errors: true
// },
// host: 'http://localhost:8081/',
// port: 8080,
// open: true, // 配置自动启动浏览器
// hotOnly: true, // 开启热更新
// disableHostCheck: true,
// proxy: {
// '/mall': {
// target: 'http://dev.baijin.com',
// changeOrigin: true,
// secure: false,
// pathRewrite: {
// '^/mall': '/mall'
// }
// }
// }
// },
// productionSourceMap: false, // 如果你不需要生产环境的 source map可以将其设置为 false 以加速生产环境构建。
// // configureWebpack 和 chainWebpack 的作用相同(都是修改webpack的默认配置),唯一的区别就是它们修改 webpack 配置的方式不同:
// // ①chainWebpack 通过链式编程的形式,来修改默认的 webpack 配置
// // ②configureWebpack 通过操作对象的形式,来修改默认的 webpack 配置
// configureWebpack: {
// },
// css: { // css
// // modules:false, //启用css的模块化?后面被requireModuleExtension属性替代
// // 为所有的 CSS 及其预处理文件开启 CSS Modules。
// // 这个选项不会影响 `*.vue` 文件。
// requireModuleExtension: true,
// extract: false, // 使用css分离插件 ExtractTextPlugin?生产环境下是true,开发环境下是false
// sourceMap: false, // 开启 CSS source maps?
// loaderOptions: { // 将选项传递给预加载程序处理器
// css: {}, // 这里的选项会传递给 css-loader
// postcss: {} // 这里的选项会传递给 postcss-loader
// } // css预设器配置项
// },
// // 是否为 Babel 或 TypeScript 使用 thread-loader。
// // 该选项在系统的 CPU 有多于一个内核时自动启用,仅作用于生产构建
// parallel: require('os').cpus().length > 1,
// // 向 PWA 插件传递选项
// pwa: {},
// // 可以用来传递任何第三方插件选项
// pluginOptions: {},
// // babel是一个编译器主要作用是将ECMAScript 2015+版本的代码转换为向后兼容的js语法
// // 因为Vue项目中普遍使用ES6语法若要求兼容低版本浏览器就需要引入babel将ES6转换为E5
// babel: {}
// })