From f6225b2afb303461cb0d97717df8115ae1b25b62 Mon Sep 17 00:00:00 2001 From: zcxee <495141071@qq.com> Date: Tue, 11 Apr 2023 18:36:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 2 +- .env.production | 2 +- .eslintrc.js | 2 +- package.json | 2 +- public/index.html | 8 +- src/api/sch/file.js | 44 ++ src/api/sch/rules.js | 44 ++ src/api/zs/clue.js | 13 +- src/api/zs/sign.js | 12 +- src/assets/images/place/position_black.png | Bin 0 -> 903 bytes src/assets/images/place/position_blue.png | Bin 0 -> 958 bytes src/assets/images/place/position_green.png | Bin 0 -> 926 bytes src/assets/images/place/position_purple.png | Bin 0 -> 926 bytes src/assets/images/place/position_red.png | Bin 0 -> 950 bytes src/assets/images/place/position_yellow.png | Bin 0 -> 970 bytes src/assets/styles/index.scss | 5 + src/layout/components/Sidebar/Logo.vue | 2 +- src/permission.js | 33 +- src/router/index.js | 141 ++-- src/utils/request.js | 49 +- src/views/login.vue | 4 +- .../{classType.vue => classType/index.vue} | 0 src/views/sch/file/index.vue | 234 +++++++ src/views/sch/{place.vue => place/index.vue} | 2 +- src/views/sch/rules/index.vue | 236 +++++++ .../{ => school}/components/schoolForm.vue | 0 .../sch/{school.vue => school/index.vue} | 2 +- .../ClueForm/components/ClassTypeDialog.vue | 42 ++ .../clue/ClueForm/components/FollowRecord.vue | 36 + .../zs/clue/ClueForm/components/MapDialog.vue | 170 +++++ .../zs/clue/ClueForm/components/PlaceMap.vue | 232 +++++++ src/views/zs/clue/ClueForm/index.vue | 328 +++++++++ src/views/zs/clue/columns.js | 104 +++ .../zs/clue/components/BatchUpdateDialog.vue | 90 +++ .../zs/clue/components/ClueFormDialog.vue | 635 +++++++++++++++++ src/views/zs/clue/components/PublicDialog.vue | 79 +++ src/views/zs/clue/components/SearchForm.vue | 161 +++-- src/views/zs/clue/components/UploadDialog.vue | 85 +++ src/views/zs/clue/index.vue | 277 ++++++++ src/views/zs/components/clueForm.vue | 4 +- src/views/zs/sign.vue | 411 +++++++++++ src/views/zs/sign/columns.js | 156 +++++ .../CheckDialog/components/CheckForm.vue | 59 ++ .../CheckDialog/components/SignForm.vue | 293 ++++++++ .../zs/sign/components/CheckDialog/index.vue | 82 +++ src/views/zs/sign/components/CheckRecord.vue | 44 ++ src/views/zs/sign/components/SearchForm.vue | 122 ++++ .../zs/sign/components/SignFormDialog.vue | 641 ++++++++++++++++++ src/views/zs/sign/components/UploadDialog.vue | 95 +++ src/views/zs/sign/index.vue | 254 +++++++ vue.config.js | 22 +- 51 files changed, 5066 insertions(+), 193 deletions(-) create mode 100644 src/api/sch/file.js create mode 100644 src/api/sch/rules.js create mode 100644 src/assets/images/place/position_black.png create mode 100644 src/assets/images/place/position_blue.png create mode 100644 src/assets/images/place/position_green.png create mode 100644 src/assets/images/place/position_purple.png create mode 100644 src/assets/images/place/position_red.png create mode 100644 src/assets/images/place/position_yellow.png rename src/views/sch/{classType.vue => classType/index.vue} (100%) create mode 100644 src/views/sch/file/index.vue rename src/views/sch/{place.vue => place/index.vue} (99%) create mode 100644 src/views/sch/rules/index.vue rename src/views/sch/{ => school}/components/schoolForm.vue (100%) rename src/views/sch/{school.vue => school/index.vue} (99%) create mode 100644 src/views/zs/clue/ClueForm/components/ClassTypeDialog.vue create mode 100644 src/views/zs/clue/ClueForm/components/FollowRecord.vue create mode 100644 src/views/zs/clue/ClueForm/components/MapDialog.vue create mode 100644 src/views/zs/clue/ClueForm/components/PlaceMap.vue create mode 100644 src/views/zs/clue/ClueForm/index.vue create mode 100644 src/views/zs/clue/columns.js create mode 100644 src/views/zs/clue/components/BatchUpdateDialog.vue create mode 100644 src/views/zs/clue/components/ClueFormDialog.vue create mode 100644 src/views/zs/clue/components/PublicDialog.vue create mode 100644 src/views/zs/clue/components/UploadDialog.vue create mode 100644 src/views/zs/sign/columns.js create mode 100644 src/views/zs/sign/components/CheckDialog/components/CheckForm.vue create mode 100644 src/views/zs/sign/components/CheckDialog/components/SignForm.vue create mode 100644 src/views/zs/sign/components/CheckDialog/index.vue create mode 100644 src/views/zs/sign/components/CheckRecord.vue create mode 100644 src/views/zs/sign/components/SearchForm.vue create mode 100644 src/views/zs/sign/components/SignFormDialog.vue create mode 100644 src/views/zs/sign/components/UploadDialog.vue create mode 100644 src/views/zs/sign/index.vue diff --git a/.env.development b/.env.development index b586625..25cced7 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ # 页面标题 -VUE_APP_TITLE = 对嘛管理系统 +VUE_APP_TITLE = 若依管理系统 # 开发环境配置 ENV = 'development' diff --git a/.env.production b/.env.production index 5cb33eb..0934cda 100644 --- a/.env.production +++ b/.env.production @@ -5,4 +5,4 @@ VUE_APP_TITLE = 对嘛管理系统 ENV = 'production' # 对嘛管理系统/生产环境 -VUE_APP_BASE_API = '/prod-api' +VUE_APP_BASE_API = '/duima' diff --git a/.eslintrc.js b/.eslintrc.js index 17be2f1..7059116 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -14,7 +14,7 @@ module.exports = { // 添加全局变量 globals: { uni: 'readonly', - wx: 'readonly' + wx: 'readonly', }, extends: ['plugin:vue/recommended', 'eslint:recommended'], // 使用的默认的规则集 diff --git a/package.json b/package.json index 470f7e0..8a77d71 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "river", "version": "1.0.0", - "description": "对嘛管理系统", + "description": "若依管理系统", "author": "对嘛", "license": "MIT", "scripts": { diff --git a/public/index.html b/public/index.html index caf21b6..64becb8 100644 --- a/public/index.html +++ b/public/index.html @@ -88,5 +88,11 @@ - + + + diff --git a/src/api/sch/file.js b/src/api/sch/file.js new file mode 100644 index 0000000..8aa1d40 --- /dev/null +++ b/src/api/sch/file.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询文件列表 +export function listFile(query) { + return request({ + url: '/sch/file/list', + method: 'get', + params: query + }) +} + +// 查询文件详细 +export function getFile(fileId) { + return request({ + url: '/sch/file/' + fileId, + method: 'get' + }) +} + +// 新增文件 +export function addFile(data) { + return request({ + url: '/sch/file', + method: 'post', + data: data + }) +} + +// 修改文件 +export function updateFile(data) { + return request({ + url: '/sch/file', + method: 'put', + data: data + }) +} + +// 删除文件 +export function delFile(fileId) { + return request({ + url: '/sch/file/' + fileId, + method: 'delete' + }) +} diff --git a/src/api/sch/rules.js b/src/api/sch/rules.js new file mode 100644 index 0000000..1d243b4 --- /dev/null +++ b/src/api/sch/rules.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询规章制度列表 +export function listRules(query) { + return request({ + url: '/sch/rules/list', + method: 'get', + params: query + }) +} + +// 查询规章制度详细 +export function getRules(ruleId) { + return request({ + url: '/sch/rules/' + ruleId, + method: 'get' + }) +} + +// 新增规章制度 +export function addRules(data) { + return request({ + url: '/sch/rules', + method: 'post', + data: data + }) +} + +// 修改规章制度 +export function updateRules(data) { + return request({ + url: '/sch/rules', + method: 'put', + data: data + }) +} + +// 删除规章制度 +export function delRules(ruleId) { + return request({ + url: '/sch/rules/' + ruleId, + method: 'delete' + }) +} diff --git a/src/api/zs/clue.js b/src/api/zs/clue.js index 58785e0..3427994 100644 --- a/src/api/zs/clue.js +++ b/src/api/zs/clue.js @@ -9,6 +9,15 @@ export function getClueList(query) { }); } +// 查询线索列表 +export function getClueInfo(id) { + return request({ + url: '/zs/clue/' + id, + method: 'get', + }); +} + + // 新增线索 export function addClue(data) { return request({ @@ -39,8 +48,8 @@ export function deleteClue(data) { export function exportData(query) { return request({ url: '/zs/clue/export', - method: 'get', - params: query + method: 'post', + data: query }); } diff --git a/src/api/zs/sign.js b/src/api/zs/sign.js index de910a1..31ebf4b 100644 --- a/src/api/zs/sign.js +++ b/src/api/zs/sign.js @@ -9,12 +9,20 @@ export function getSignList(query) { }); } +// 查询线索列表 +export function getSign(id) { + return request({ + url: '/zs/sign/' + id, + method: 'get' + }); +} + // 导出 export function exportData(query) { return request({ url: '/zs/sign/export', - method: 'get', - params: query + method: 'post', + data: query }); } diff --git a/src/assets/images/place/position_black.png b/src/assets/images/place/position_black.png new file mode 100644 index 0000000000000000000000000000000000000000..8e83901ced94dd7a2bfc6236161fb55945506313 GIT binary patch literal 903 zcmV;219<$2P)Px&K}keGR9Hu~mrrOEcNE9JZ?akOkc+Vgi%^BsEc^S-1jU1?M0%;vf`^hqu|_e? zLC``K>LD$Nil}JO#-fyBo3u4;56Q(-4~0TESbAy7{N4=fp&Cl5;Gcq}Acoy}Wx__1 z-I@K(#?9PjfA4+Xhnac5-&;Zpm)3eafZYII6Ok8*XhWPXBKL^sZxNXyq7pOvS+SHQ z(DS^3D2m<(FqkDCz_jByW4`Z~Z1GkBt@RlIAK5@j>qPX4G3Hpa+@=Cr>ze@ftfcso zoZp#wYZ@a}Kx_R7z`ExwzL@?eGryGhl#+hbTHgS$uT8}lF&{JY@p@*%6HrPG646wf zi!b0rfmISH1wpVYRX}U~Hh}L}qxd3|h=z$*TdLLSZJPiQ zdBzx1FVHU{w`|E#6m^AR_+L_7Z*Ol`XJ_ZXHU<&BVvPA^nLwdX*p$oV?%I+8>}2Ld zQKi&QBAT%=DwWFSa=ARWOrTgS<{ig*YD)$%!_0~Mgx30N0Q+r>D2mpEVK~1`AimLB z{{-Mw8$d)Z=kxh_}_Fc(1--gDjX6Jpph>M5+K@ z2Cz0u9)MHKd@@nM^So_Q6vZD$J|nEvuzAOE`hDO3Em5HM8sa{V`*}64h7+;jF!DTa zW3^f>5z(f08i>eTM@Pqi@B4o(cGq?8&bqJ!;_ z5Rr)>2!@kbO=m*ab-xvnz0V^-MBf=>-brI*nTo#xaA1WJ-!OC2T&qB>Gp+*|X;EUF znd2k6>6J;KCh-}7LpET%E+U@?L69jnvp@`1N_|R1?^z_SG4qiuq6<4}*1*L$*L5$6 zNZP-hF=js63bSQ_+UtnVi~1QqaqhRttVp0HaTdU6t-v{E{?Jye<$b^gR7#zWV}c+! dVT(;${~z9l8ZdL^n%4jT002ovPDHLkV1h;Rrf2{F literal 0 HcmV?d00001 diff --git a/src/assets/images/place/position_blue.png b/src/assets/images/place/position_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..12f5513bf90b2e6cdfd3dbe734807981814e83bb GIT binary patch literal 958 zcmV;v13~Px&cu7P-R9Hu~mrrOMWf;bvcM?-P1l-B?P$?L3W@88zT0EGBNG}Qs9wbsxqqONk zXC{p;G>23uRm8MOQ1fSIgIE*)L`B+*Cl7+qgqB{4w3IYE8!e@@V3Kc*2E^^|ys}BR zY_c=^eH+s~E&Dys@BJ~m-^{m!DqivN`KLL^Js&`Oj(|r2?6_CI!@z9~I2#~8ow1+1 zqKYMzV9c9qCur{i=upW6IL8QvGj`LoEH4#^CDR`g^LsK-#QLYgHjh^7RupLP{2v*3 zX_Lc?wO@s8?v7$a3g}*H2_XG{4qvMi-4vGbSQsl*puzROVZs|*GQ0?39uiKXcO$b* zKu@MRz;t#?hZkYQuLvt~u9RIa;HA$4-2OlWK-0oDo{bdH-MLpm+V>A;_!^Z7of*rV zx_?nhhs9jqC4#Le@Dn)r8Kf*+z|Pf0ve-+Js|-ipG-ZHe#NUF#^gx{-@P^W1RqgxK^hx z*8M9h13V+_MCg4Y=J{U{@TQC*;@NH3-;!M~03hc1zYwrb1_0xeY##k9J?26oyWLG2 zdEyZOFG#zW@l|ys`Ic^s{ z=B?67#CafffQcrQ*$P2oKDgv0CO1Z-PejS|1egyfu;me=NnsfW!-5shgnBadEtp=D zPpFU}`c7EJ>rn~$so3+sB;c*hNHFkq#x^T z*Q%OuF{^v&0f0B0@o7ldM%lSv#^02{>eu1<9}&=3c+b%KGxih5Wy7kz56FPJoB9CI gAROa_EE~1{AH|*^Fdkvt<8 literal 0 HcmV?d00001 diff --git a/src/assets/images/place/position_green.png b/src/assets/images/place/position_green.png new file mode 100644 index 0000000000000000000000000000000000000000..e8f80cf3c88f5aa313a11775fb3bad6836b2f86b GIT binary patch literal 926 zcmV;P17ZA$P)Px&SV=@dR9Hu~mtBYrVHn5%&sp;xl!zr~&K7DhGaE%Ne6(^yQ7%NuXFe_z3dIFV zNC^3iB&=^PxN+q|DJya#p_x&>V&^@w2nlD#&ZDy*+GFRO_dScbJM;ekzvq9R>3!!J zLIqbQ961hLH4Vg5iD80}X|*$QOppXzO>x}Vlz#e17fU+AOytz3Vyt1}**bb+x)!H! zC}+5hD!np5CbD-BW3vjBv`&PBf#Izy=Pet+jGXIWp4pw^ojebv@Wzy4lnh{o_6Gp{ z|FU?8{k0U{ki;$}-84h%0zeD?QSmkm^FEpOH~h)$(t%9gnoUGk|7r1d7&FhwrTuH2 z*)Q@-kuA>mH$+{{YlWmT-v?ZQKP5>W@sM;uu>}k@eOLh z%{WD$!I(va8CpK@MJfD+r2@PIFi;Jm8=CkDw-Rjf#nsXLwayRr{vrljliAvOla5oT8_y z04e6tO=}@aqRZ#$k9q}pRyvhvVjuc+vIgt(Ra||p}G5Q&l zcF7Hk0u+8^Li-j0Q&a#34zLmJdP~om3)&j4tL2~ZVP;I%@ZQe}Z+!ALjO-0y>`_5l z*9qUjcmbdVz;FP)w0z9lWZK`F7$6hcV~KDN450<9R741wF(D_s2Z;d+H_g1Y7ewnT zWozjZ-iTdZM%iz*HQd7}j8a3jp!%X$^fRgtdOvIGY)KqQvZ1wvK@IwBwUWR~1L2?f zQ(0yravA_$qDJc|=!_KZ(j;a1nJ~030hp&#qKxLU6yE$&>*}dEw9gW-xH};TI3EbF ztXCPJb!UY3NdU_$3&9Oi_{&rttpIJOq;;G?D^$R?Gm1_G!qwF35Zg6o=o|rfwZd{t z3U8GzR=Wcoz-(miXGY@J4grS(;jPsz-qx*dTxQPx&SV=@dR9Hu~ms^NTaU93Lzq8xmVT(Dl52Wmz8J84A9$Z>^p(qccW^WdNnIIYlVCb*Fyvd12VX+h@*cdmPJ)#W&=7-4xxTY~5 z?9SO8s=QJ_Pgpy_NU1b zzYH(xK6j)T5qy>c_UeXt0iY%QH2epKnfJOmd&}R0p7IO9mMGKf`iO&B%IO9Wcor8`P8^aE-N#N(((rPC{$r_)D_PW`0pLM@Vrs^}$3)Bru z05E@T+l~~LYFO3p0TnP7w|4lMd`@grWy>A^4wb7IFrl9MRR91007*qoM6N<$f@=Jz AqyPW_ literal 0 HcmV?d00001 diff --git a/src/assets/images/place/position_red.png b/src/assets/images/place/position_red.png new file mode 100644 index 0000000000000000000000000000000000000000..884978cd7bbe3b22d40ee9a9ce9252f1ada52e91 GIT binary patch literal 950 zcmV;n14;aeP)Px&a7jc#R9Hu~mrrOEXBftxcQ*Ttie4If&}3#JnC^_CQt?ogh!+bLJcxp*QKB9S zw$K*zpaoHpDn`^OiWF`9uLr$&@*oH%w0IG1X=avI&CJGD{0E8<_uK5eve}JfliB@d zW8B;BJkRg@?Z?hH?-FWwc}8*pgT5y4GJvLoFm15T_#fc^NYk!yp1bTm`Da`##R;a3 zx)vtw2LP+$$F)9kUrg%xfXCJwEu}%nVUs_SDNCD3j7Xhpvm&HpEW*l-da{EZ;C;`_JtB7%J zJQp8gF=4gi%j?70qXaxtzXNc~rw{>_E0w5_krp&y^tJEw-QgZFtVJlAFPFM%88D zl@rMNQ37rQ>M0>!r~m})NComhRL-^ZZN%KJVsKtgb)Mj5@eVD$+(t2nG$_yT9MjA> zne4+zfd>5xN^n{!5Mr*=C;uuF_{XYSm}l*GRXN`;r_6qiw^2E7DyCqPc%xz@C|uO+ z5ByQS15Fc}C=4H~%1q&6#~+9k^~}1(fYz;KXxa>?_g!z9z~8eV5^qITRR*Zr4ziKw zglCHL05+%?`N>kB-2+)BP&523KTwc4be`7ZDW8dD^X9xQ4gaB4HFynM7}UeH7SX;1$wjjM9aJ<{e8o0k@J9S zB-@Cnvo?P9G&65~JyX%KIzNrKR6`*O3Y6H8$5_B8cV1pZb9EFMzy zYbwab%*G*>GOm$4PDI~VtuUXoGr8~LVq@>X5HM{e4>MDRe>>b^2e}{PE?zp)Yl#=L zo+%2?i}D$tambFC`&IOscVGzUn&Owjcvkur`%{73samY&b3g_346(P6u`_a)DqHFL Ydobl4FcDq(=Kufz07*qoM6N<$f`TKfTmS$7 literal 0 HcmV?d00001 diff --git a/src/assets/images/place/position_yellow.png b/src/assets/images/place/position_yellow.png new file mode 100644 index 0000000000000000000000000000000000000000..bbab56f0bcfc11160d1c91c522c23115c613a8f5 GIT binary patch literal 970 zcmV;*12z1KP)Px&gh@m}R9Hu~mrraIWf;bvcM3(ivm2ny3^h%}q~Ol1l4v+sn-VXOXu`o@VpK2% z4kThCBydm?qQ-!MMkxeB4A8289@>j14<;tIk#I4lwqI+aKnM|LhC;=?=37D)SKfbq{RD@bH1I|SJxxGERA=BOf&XP_-Ne+ZTLb;7 zSW*dQJ*Sm`4++?!l4qcYfsT|ZdS!X3K;FxI&fo(wQ0zLG%&`t4TIYwE5oa>AbVa5L(K3ONi^@JgwiDShI1g>))gm)KW_#+0RUAM&k$C)Jp zqi$wPNZh@k!>3^y)0=hHV9#83i9p~vzXE7|5&{5vbyI98E0FW-w+QsZ6B<5+C2Z9V zabadg(H+RS_DLdoUs2#EFn%VD?=jOG0A5$>F)rwq*cvMkxV8r(Lk1#XXTlWc=H~LA zvx9-NvMw|3BrQ>2B9P6d>$NfMwhRE^Bi$5V#N`6l*$2W=86$iuT$xG@k4!z0=_|OE zegT>$-NOs4H7&CS{)rnh=BL*dSo=#RfG}LAuNwZdNMLj%-5gG6zsbs@K+-ft5SR1) z=aNggCM#oTHQ_6D^~0Bn1n%BUuU=fEU6qwX)>=~5K&tKLuPA(QIN9*G zA7#h9Oj7}T9KdU`E)gy#4DoXO&(OE`gXxG2GG$KxG4T~JPXJg0&{CBiGd@jP;*(f` zyl=k*&?RQns=%tv5MdnP=7cfyd#u3ZV{o0LAndCau9S~?BbL4mZ>(z!YYWj)YPAwn zJ#SuS>+=sVpQtk{(v%Oh~!%ba2G&MGB3 zbyMt+b(91mNX~Um6JeJOIJrp?zD^iIEvo{Y$>coe1OXpZ>M--Eq&2i#m8*OQW`Kcj ze+i~C|8}TDHwX8q4xhYR)r4myoFiZqpYaLpx>0)Wm+|K%5J3aaITRhwroYAEgeg9j s4Xb(|kO6b9{aKVrT0;kA*>dX-0WWnUFft=&?f?J)07*qoM6N<$g2K(YEC2ui literal 0 HcmV?d00001 diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index b13527e..0b52bad 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -233,3 +233,8 @@ aside { padding: 15px 20px 0 20px; } } + +.amap-sug-result { + z-index: 9999; +} + diff --git a/src/layout/components/Sidebar/Logo.vue b/src/layout/components/Sidebar/Logo.vue index 8a2d3d2..9ce5bf0 100644 --- a/src/layout/components/Sidebar/Logo.vue +++ b/src/layout/components/Sidebar/Logo.vue @@ -27,7 +27,7 @@ export default { }, data() { return { - title: '对嘛管理系统', + title: '若依管理系统', logo: logoImg }; }, diff --git a/src/permission.js b/src/permission.js index 012ffa3..c25eba8 100644 --- a/src/permission.js +++ b/src/permission.js @@ -1,12 +1,20 @@ import router from './router'; import store from './store'; -import { Message } from 'element-ui'; +import { + Message +} from 'element-ui'; import NProgress from 'nprogress'; import 'nprogress/nprogress.css'; -import { getToken } from '@/utils/auth'; -import { isRelogin } from '@/utils/request'; +import { + getToken +} from '@/utils/auth'; +import { + isRelogin +} from '@/utils/request'; -NProgress.configure({ showSpinner: false }); +NProgress.configure({ + showSpinner: false +}); const whiteList = ['/login', '/auth-redirect', '/bind', '/register']; @@ -16,7 +24,9 @@ router.beforeEach((to, from, next) => { to.meta.title && store.dispatch('settings/setTitle', to.meta.title); /* has token*/ if (to.path === '/login') { - next({ path: '/' }); + next({ + path: '/' + }); NProgress.done(); } else { if (store.getters.roles.length === 0) { @@ -24,18 +34,25 @@ router.beforeEach((to, from, next) => { // 判断当前用户是否已拉取完user_info信息 store .dispatch('GetInfo') - .then(() => { + .then((resp) => { isRelogin.show = false; + localStorage.setItem('admin', resp.user.admin); + localStorage.setItem('userId', resp.user.userId); store.dispatch('GenerateRoutes').then((accessRoutes) => { // 根据roles权限生成可访问的路由表 router.addRoutes(accessRoutes); // 动态添加可访问路由表 - next({ ...to, replace: true }); // hack方法 确保addRoutes已完成 + next({ + ...to, + replace: true + }); // hack方法 确保addRoutes已完成 }); }) .catch((err) => { store.dispatch('LogOut').then(() => { Message.error(err); - next({ path: '/' }); + next({ + path: '/' + }); }); }); } else { diff --git a/src/router/index.js b/src/router/index.js index 4a90961..ce60396 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -29,17 +29,14 @@ import Layout from '@/layout'; */ // 公共路由 -export const constantRoutes = [ - { +export const constantRoutes = [{ path: '/redirect', component: Layout, hidden: true, - children: [ - { - path: '/redirect/:path(.*)', - component: () => import('@/views/redirect') - } - ] + children: [{ + path: '/redirect/:path(.*)', + component: () => import('@/views/redirect') + }] }, { path: '/login', @@ -65,18 +62,16 @@ export const constantRoutes = [ path: '', component: Layout, redirect: 'index', - children: [ - { - path: 'index', - component: () => import('@/views/index'), - name: 'Index', - meta: { - title: '首页', - icon: 'dashboard', - affix: true - } + children: [{ + path: 'index', + component: () => import('@/views/index'), + name: 'Index', + meta: { + title: '首页', + icon: 'dashboard', + affix: true } - ] + }] }, // { // path: '/demo', @@ -111,89 +106,93 @@ export const constantRoutes = [ component: Layout, hidden: true, redirect: 'noredirect', - children: [ - { - path: 'profile', - component: () => import('@/views/system/user/profile/index'), - name: 'Profile', - meta: { - title: '个人中心', - icon: 'user' - } + children: [{ + path: 'profile', + component: () => import('@/views/system/user/profile/index'), + name: 'Profile', + meta: { + title: '个人中心', + icon: 'user' } - ] + }] } ]; // 动态路由,基于用户权限动态去加载 -export const dynamicRoutes = [ - { +export const dynamicRoutes = [{ path: '/system/user-auth', component: Layout, hidden: true, permissions: ['system:user:edit'], - children: [ - { - path: 'role/:userId(\\d+)', - component: () => import('@/views/system/user/authRole'), - name: 'AuthRole', - meta: { - title: '分配角色', - activeMenu: '/system/user' - } + children: [{ + path: 'role/:userId(\\d+)', + component: () => import('@/views/system/user/authRole'), + name: 'AuthRole', + meta: { + title: '分配角色', + activeMenu: '/system/user' } - ] + }] }, { path: '/system/role-auth', component: Layout, hidden: true, permissions: ['system:role:edit'], - children: [ - { - path: 'user/:roleId(\\d+)', - component: () => import('@/views/system/role/authUser'), - name: 'AuthUser', - meta: { - title: '分配用户', - activeMenu: '/system/role' - } + children: [{ + path: 'user/:roleId(\\d+)', + component: () => import('@/views/system/role/authUser'), + name: 'AuthUser', + meta: { + title: '分配用户', + activeMenu: '/system/role' } - ] + }] }, { path: '/system/dict-data', component: Layout, hidden: true, permissions: ['system:dict:list'], - children: [ - { - path: 'index/:dictId(\\d+)', - component: () => import('@/views/system/dict/data'), - name: 'Data', - meta: { - title: '字典数据', - activeMenu: '/system/dict' - } + children: [{ + path: 'index/:dictId(\\d+)', + component: () => import('@/views/system/dict/data'), + name: 'Data', + meta: { + title: '字典数据', + activeMenu: '/system/dict' } - ] + }] }, { path: '/monitor/job-log', component: Layout, hidden: true, permissions: ['monitor:job:list'], - children: [ - { - path: 'index', - component: () => import('@/views/monitor/job/log'), - name: 'JobLog', - meta: { - title: '调度日志', - activeMenu: '/monitor/job' - } + children: [{ + path: 'index', + component: () => import('@/views/monitor/job/log'), + name: 'JobLog', + meta: { + title: '调度日志', + activeMenu: '/monitor/job' + } + }] + }, + { + path: '/zs/clue-form', + component: Layout, + hidden: true, + permissions: ['zs:clue:add', 'zs:clue:edit'], + children: [{ + path: 'index/:clueId(\\d+)', + component: () => import('@/views/zs/clue/ClueForm'), + name: 'ClueForm', + meta: { + title: '线索详情', + activeMenu: '/zs/clue' } - ] + }] } ]; diff --git a/src/utils/request.js b/src/utils/request.js index 182d17d..d81c1a6 100644 --- a/src/utils/request.js +++ b/src/utils/request.js @@ -1,16 +1,32 @@ import axios from 'axios'; -import { Notification, MessageBox, Message, Loading } from 'element-ui'; +import { + Notification, + MessageBox, + Message, + Loading +} from 'element-ui'; import store from '@/store'; -import { getToken } from '@/utils/auth'; +import { + getToken +} from '@/utils/auth'; import errorCode from '@/utils/errorCode'; -import { tansParams, blobValidate } from '@/utils/ruoyi'; +import { + tansParams, + blobValidate +} from '@/utils/ruoyi'; import cache from '@/plugins/cache'; -import { saveAs } from 'file-saver'; -import { successCode } from '@/global/global'; +import { + saveAs +} from 'file-saver'; +import { + successCode +} from '@/global/global'; let downloadLoadingInstance; // 是否显示重新登录 -export const isRelogin = { show: false }; +export const isRelogin = { + show: false +}; axios.defaults.headers['Content-Type'] = 'application/json;charset=utf-8'; // 创建axios实例 @@ -31,6 +47,11 @@ service.interceptors.request.use( if (getToken() && !isToken) { config.headers['Authorization'] = 'Bearer ' + getToken(); // 让每个请求携带自定义token 请根据实际情况自行修改 } + if (config.url.includes("http")) { + config.baseURL = ""; + } else if (config.url.includes("amap")) { + config.baseURL = ""; + } // get请求映射params参数 if (config.method === 'get' && config.params) { let url = config.url + '?' + tansParams(config.params); @@ -84,10 +105,10 @@ service.interceptors.response.use( if (!isRelogin.show) { isRelogin.show = true; MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { - confirmButtonText: '重新登录', - cancelButtonText: '取消', - type: 'warning' - }) + confirmButtonText: '重新登录', + cancelButtonText: '取消', + type: 'warning' + }) .then(() => { isRelogin.show = false; store.dispatch('LogOut').then(() => { @@ -116,7 +137,9 @@ service.interceptors.response.use( }, (error) => { console.log('err' + error); - let { message } = error; + let { + message + } = error; if (message === 'Network Error') { message = '后端接口连接异常'; } else if (message.includes('timeout')) { @@ -147,7 +170,9 @@ export function download(url, params, filename, config) { return tansParams(params); } ], - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, responseType: 'blob', ...config }) diff --git a/src/views/login.vue b/src/views/login.vue index 862b8bf..778ea29 100644 --- a/src/views/login.vue +++ b/src/views/login.vue @@ -1,7 +1,7 @@