登录    关于
马育民老师的博客

马育民的博客

QQ:65242847

vue-admin-template 说明

工程目录介绍

src/views:页面
src/utils:工具包,发http请求等
src/api:页面中使用的函数,发请求等

登录

登录请求

post 请求

请求链接在 api/user.js 修改

格式如下:

{"code":20000,"data":{"token":"admin-token"}}

code 必须是 20000,在 utils/request.js 49行上下修改值

获取用户信息

get 请求

请求链接在 api/user.js 修改

格式如下:

{
    "code":20000,
    "data":{
        "roles":[
            "admin"
        ],
        "introduction":"I am a super administrator",
        "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
        "name":"Super Admin"
    }
}

退出登录

post 请求

请求链接

api/user.js 文件中的 logout() 方法

返回数据

{"code":20000,"data":"success"}

发请求

上层:

api/user.js

底层实现:

baseUrl在这里修改

utils/request.js

table

链接

http://localhost:9528/dev-api/vue-admin-template/table/list

数据格式

{"code":20000,"data":{"total":30,"items":[{"id":"150000197804140370","title":"Vkjfm xbfqfflx tjhqtvaip kggc ukvcby nxwvlhiqp tsik xyxjhtrh cneyns wntuw hybyvovxt fuuwtyymlr mxbq eqkxgplxv snufth iifywdrj tls.","status":"published","author":"name","display_time":"1999-11-03 14:09:43","pageviews":4910},{"id":"50000019810530695X","title":"Ttqehi iifynhpkjl srciux mpzfry woxw fngtssg prjtkx desach ghjfwnb eqnvusjvzd xgdd svupghjiit ysfcymgz kbnpih qoqsswgnkn iwzc rkbygga rcgxt pdlpuduqt odfhkpbsis.","status":"draft","author":"name","display_time":"1992-02-13 01:01:30","pageviews":1021},{"id":"510000201307286324","title":"Uwqwtwru qivroc mcsqfyqds xpvz mgtqelh gbvobg ccjchbna aicxok mrriysudyr qwgyzjwcx deiduke nsedp.","status":"draft","author":"name","display_time":"2011-06-20 13:21:54","pageviews":3545},{"id":"360000201309154124","title":"Nsvfzc gytuwnp shfy pgdyvjkd yxglffj dlv gppinij puawfttyk lano bzbx sheeeryknv qbuvd ipfakxkc vvij repdaf yqsjp uzywbserr zbpewqukyg.","status":"published","author":"name","display_time":"1993-03-11 04:27:37","pageviews":2145},{"id":"420000200103266421","title":"Hyfa ceovxsni njcrwxsbp yrpt dtioror kpnqwuash pptdop zjq kkc mljep yjgqvoc xpvc hfscem.","status":"published","author":"name","display_time":"2011-02-01 23:17:45","pageviews":4819},{"id":"340000200411291354","title":"Boi xfiwbtkk lccxqf tjmze ztsay hzyqly wndjjeyy xjpw qgrsrjllm sci vuhv gkkrnzef vnjwcir.","status":"deleted","author":"name","display_time":"1999-11-29 12:02:21","pageviews":691},{"id":"810000197903217562","title":"Euftem gvoldkho mfeexyoqq kvjtuzm ecquewl tstlb tctjdj vvaztvftql xbhkvef vhqmbcjit cqtd.","status":"deleted","author":"name","display_time":"2019-09-25 15:27:00","pageviews":730},{"id":"610000199808185154","title":"Bgville mhhmpotez cjeqqnhkh aujfbeyfuk xtenvhdm ipii ksroqxyz jxtaltmo nsewnxkj gjhfwkrdb uumtnhpl nxmu pifmx iqbyyl jhmgxmnit.","status":"draft","author":"name","display_time":"2018-08-02 03:15:22","pageviews":435},{"id":"82000020120627807X","title":"Fyxn fanfvpg qsqypulq lkbbd mwpzw ordckidsbm gnyq xcufmfjrqo njtxv iwnovyk fiswgoyino jxtzunmpn sxgjuyoolj prxzumpyyr nsvkmdlub lukvyyyrwo.","status":"published","author":"name","display_time":"2015-03-03 23:53:49","pageviews":3152},{"id":"520000197610201250","title":"Nbruyysp rddh cixutcc ddmhuwndf qqxhsijds tqqsomy ifelthtg yikwix qxseqnmebp pvwnpd ukoexjrc dmigohdz wofuv ydyrjgdj rfyps pufhyv tlygqidj nyxpl cypigrjlw.","status":"published","author":"name","display_time":"2006-03-05 23:14:13","pageviews":4024},{"id":"140000199609130625","title":"Ynbufssrue gymzmk wrqcbucc rwextlxsw gupdmjp ljhp froe ugik htmibnwc pepcja cvtxoki six ivtkqizis zxf vdsadiubs.","status":"draft","author":"name","display_time":"1975-05-17 05:03:44","pageviews":3368},{"id":"120000198503308976","title":"Men clvlttj uqqy xamrwe sjmnx cizgdheunj sytebhqew uzi vfyoeas sjz nslxtju isou gjvoqc hkfndb mmydc pjupbbqjgg llyhxackmo dwrm hsctvhog.","status":"draft","author":"name","display_time":"1995-09-02 17:55:46","pageviews":692},{"id":"710000201603145144","title":"Hcfdxdl dki nytg xbjlgcs qnmjzcm dlth yvyg tyzmgknby vuog voredfqo cbezotjnxe tooqjurm pjwtlnap jdffvm aplnfzpr jaglqene.","status":"draft","author":"name","display_time":"1983-11-01 17:29:43","pageviews":4300},{"id":"350000197007254516","title":"Ifbfe wwfjsvigbb ccjjqjwim yziuwp ipcz mcuzxsn okftpwi dqqfpdawdp ruvqbntbu fpyqed hsyxrk.","status":"deleted","author":"name","display_time":"1985-02-09 11:02:08","pageviews":3174},{"id":"310000199901201330","title":"Okbpkootm blvhqphb lrkhgbgcu ffjtdevu qlvmnrehlc qixes ztjy hqwd djkmdvlik qxppiab vlihudxl qguhcdca ifzbqwcqm dxbwydafp iszlyh cwbnguadc.","status":"deleted","author":"name","display_time":"1981-05-28 15:02:41","pageviews":1531},{"id":"330000199006236864","title":"Oakoosel fkk rtt ijbkyvnzd poetxh olau dvvqfjv undzkni rhic pxjkdtga hsys gtyviwul bgbvn vgrjimkm.","status":"draft","author":"name","display_time":"2015-09-20 21:52:48","pageviews":1448},{"id":"640000200101157556","title":"Qmvcw asefkdod wstpulrohf nqt lpodjb ldkc plvxfzcdn htxiehoj vtecy irlytqfoir uuk xmzgvpwwdo elphctsvo wxgefqfdwv mfquwtj onmftks.","status":"draft","author":"name","display_time":"2005-01-24 08:46:53","pageviews":3427},{"id":"220000199809134751","title":"Acmdw waiwdd cxejoafsjy pvnusxloa lwad omrpdxrp khvovtkb deoq zltvjmu qpigbqogco kfexvkdojg hbxfnpco eeeiund kvgmcif ayepyc pvmlfpq uwayzvz iicyly lulqi.","status":"published","author":"name","display_time":"2016-03-15 13:49:48","pageviews":2629},{"id":"430000201804239991","title":"Qtjxgll iqf uuxjo szuhyzgb jumzxptsoo wow wnfg qxmwpsu nkle ncywcuyr mwgdpb vueow wlhtklvm csnizsohc skdzgrgpc nhjy ilgrijjj woi.","status":"draft","author":"name","display_time":"2005-06-17 20:21:50","pageviews":2414},{"id":"150000200706094416","title":"Sgxwu jjrelfhpl dnxlpg aifbcvtsu jrad cgrkrt aqvhmbjx hsxdxzjpi lgujj idcbg nnxctj jvbdl rlmjndvxw iyuhy nirj mvimdfi dboos kuo eiy jnjithcfy.","status":"draft","author":"name","display_time":"2003-09-23 04:43:33","pageviews":1278},{"id":"530000201101082362","title":"Tcse ruqs nenvxzhls voknesg zym xwse cetxpwr mejfqg uxssdqxe ifhqdbhm rrqdlhvrk lmqlsed ujnn qxxwsg ipq qdr kwrlc timjkegvhj.","status":"draft","author":"name","display_time":"1975-01-03 17:47:45","pageviews":4310},{"id":"540000199809247224","title":"Tvv jwg jknh prlhk lrkokxs fdbbf fefi lmvyky qvjhqw hqbcho kmcsjpl hhpnqb boy xuyfbydw udi txl yrpjw ohyutucy uddweg.","status":"deleted","author":"name","display_time":"1996-01-04 09:31:05","pageviews":1629},{"id":"430000201311120204","title":"Fdolmlcqq powjd skavmussoc wulzocweh jbyz gbulphx nupdcqctr ngdsey eijvq qyy yqxxm mtjsx tuystosa gmdvwy dhdpiebksy jdnrww fjirvn.","status":"draft","author":"name","display_time":"1972-10-01 09:57:06","pageviews":1415},{"id":"140000199801126415","title":"Endmrhti llmrwble lbh jncwlmtb nxxuuwdv oshzhy gxm qgbzsohc mflhur htl asoowk.","status":"deleted","author":"name","display_time":"1974-08-13 08:19:44","pageviews":4499},{"id":"61000020160818363X","title":"Cpetcoxw lsswet grxcuvc vxppqg bdevotd ekwyjphbg bpyizwpho mke myhymf cjuqeu bbhbefzdn ptzkbbc mekjqvej otrr.","status":"deleted","author":"name","display_time":"2008-04-24 11:34:36","pageviews":2164},{"id":"350000199904218354","title":"Mbjgy ucrpmitl kkbt wlzfy faxumctr ahsfdmmkd mjmrhtq dcdnnb evcn lygeed oqequ ukchpvv pjjnsvvu kpljncgojg fjgq mywln rwrymus oalurjhnqx hxqx sufrfe.","status":"draft","author":"name","display_time":"2020-11-13 07:23:45","pageviews":933},{"id":"530000198302127753","title":"Cnehrhgjg gkoafxy xdcvxnag fkmucngvs vbj ywqjpiys vztgvbmn rvgfh enwrzxd xbqs wfinfuit gefheehv.","status":"deleted","author":"name","display_time":"1999-09-02 01:33:55","pageviews":2288},{"id":"530000201010263424","title":"Tuv mpwjxak ihdyjc fkpczve cupgpt kvjtwokqs enzy ztiaqimh bpjtyegsa zzn tpb lrjysmnj xnm eupnb vapwpttqfr.","status":"draft","author":"name","display_time":"1979-11-11 07:30:48","pageviews":1175},{"id":"150000197811243351","title":"Weii qmoa lcb tsymysirx xlgzq cqyk osjdhqhjt ilmtv zygydngqur jedgpger cftyht igsjefcc vmpnqtwyj.","status":"deleted","author":"name","display_time":"2010-05-11 11:44:25","pageviews":2670},{"id":"530000200701228615","title":"Xpfdwrliy lqqfetwlx tol wgemdjptd dkqmyuedr lxnpvooedi afkubsyhz jts nyoqvlts umpgmujwf bxguz axghfo syhidnmnp kxycqpjs olevc rpqbjzrm qct.","status":"deleted","author":"name","display_time":"2006-06-20 11:06:10","pageviews":3859}]}}

原文出处:https://malaoshi.top/show_1IX2LlZYKHgv.html