{"id":1419,"date":"2024-11-09T19:41:43","date_gmt":"2024-11-09T11:41:43","guid":{"rendered":"https:\/\/note.ui11.cc\/?p=1419"},"modified":"2024-11-11T11:12:55","modified_gmt":"2024-11-11T03:12:55","slug":"%e4%b8%aa%e4%ba%ba%e5%81%a5%e5%ba%b7%e5%b9%b3%e5%8f%b0%e9%a1%b9%e7%9b%ae%e7%ac%94%e8%ae%b0","status":"publish","type":"post","link":"https:\/\/note.ui11.cc\/index.php\/2024\/11\/09\/%e4%b8%aa%e4%ba%ba%e5%81%a5%e5%ba%b7%e5%b9%b3%e5%8f%b0%e9%a1%b9%e7%9b%ae%e7%ac%94%e8%ae%b0\/","title":{"rendered":"\u4e2a\u4eba\u5065\u5eb7\u5e73\u53f0\u9879\u76ee\u7b14\u8bb0"},"content":{"rendered":"\n<p class=\"has-vivid-red-color has-text-color has-link-color wp-elements-c9854bcf3a0899f739332373e51cd1fb\"><strong>\u6b63\u5f0f\u5f00\u53d1<\/strong><\/p>\n\n\n\n<p>\u4e00\uff1a\u6570\u636e\u5e93\u8bbe\u8ba1\u3001<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>SET FOREIGN_KEY_CHECKS=0;\n\n\n\u5173\u95ed\u5916\u952e\u7ea6\u675f\u68c0\u67e5\uff1a\u5f53\u6267\u884c SET FOREIGN_KEY_CHECKS=0; \u8bed\u53e5\u65f6\uff0c\u6570\u636e\u5e93\u4f1a\u6682\u65f6\u5173\u95ed\u5bf9\u5916\u952e\u7ea6\u675f\u7684\u68c0\u67e5\u673a\u5236\u3002\n<\/code><\/pre>\n\n\n\n<p>\u9996\u5148\u521b\u5efa\u7b80\u5355\u7684\u7528\u6237\u8868\uff08easyuser\uff09\uff1a<\/p>\n\n\n\n<p>\u7528\u6237\u8868\u7684\u5b57\u6bb5\u6709\uff1a<\/p>\n\n\n\n<p>id,\u81ea\u589e\uff0c\u4e3b\u952e<\/p>\n\n\n\n<p>username,password,email,role,state,<\/p>\n\n\n\n<p>ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8;<\/p>\n\n\n\n<p>\u6570\u636e\u5e93\u521b\u5efa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u6743\u9650\u7cfb\u7edf\u8868\u8bbe\u8ba1\ncreate schema db_authority_system;\ndrop table if exists 'easyuaer';\nSET FOREIGN_KEY_CHECKS=0;\nuse db_authority_system;\ncreate table easyuser(\n  id int(24) auto_increment comment '\u4e3b\u952e',\n  username varchar(255) not null  comment '\u8d26\u53f7',\n  password varchar(255) default '123456'  ,\n  email varchar(255) not null  comment '\u90ae\u7bb1',\n   role  varchar(255) not null comment '\u89d2\u8272',\n    state tinyint(255) not null comment '\u72b6\u6001',\nprimary key (id)\n) ENGINE =InnoDB AUTO_INCREMENT=2 default charset =utf8;\n\nINSERT INTO easyuser\n    (username, password, email, role, state) VALUES\n                                                                  ('\u5f20\u4e00', 'password1', 'zhangyi@example.com', '\u7ba1\u7406\u5458', 1),\n                                                                  ('\u674e\u4e8c', 'password2', 'lier@example.com', '\u666e\u901a\u7528\u6237', 1),\n                                                                  ('\u738b\u4e09', 'password3', 'wangsan@example.com', '\u7f16\u8f91\u4eba\u5458', 0),\n                                                                  ('\u8d75\u56db', 'password4', 'zhaosi@example.com', '\u7ba1\u7406\u5458', 1),\n                                                                  ('\u5b59\u4e94', 'password5', 'sunwu@example.com', '\u666e\u901a\u7528\u6237', 0),\n                                                                  ('\u5468\u516d', 'password6', 'zhouliu@example.com', '\u7f16\u8f91\u4eba\u5458', 1),\n                                                                  ('\u5434\u4e03', 'password7', 'wuqi@example.com', '\u7ba1\u7406\u5458', 0),\n                                                                  ('\u90d1\u516b', 'password8', 'zhengba@example.com', '\u666e\u901a\u7528\u6237', 1),\n                                                                  ('\u51af\u4e5d', 'password9', 'fengjiu@example.com', '\u7f16\u8f91\u4eba\u5458', 0),\n                                                                  ('\u9648\u5341', 'password10', 'chenshi@example.com', '\u7ba1\u7406\u5458', 1),\n                                                                  ('\u891a\u5341\u4e00', 'password11', 'chushiyi@example.com', '\u666e\u901a\u7528\u6237', 0),\n                                                                  ('\u536b\u5341\u4e8c', 'password12', 'weisier@example.com', '\u7f16\u8f91\u4eba\u5458', 1),\n                                                                  ('\u848b\u5341\u4e09', 'password13', 'jiangshisan@example.com', '\u7ba1\u7406\u5458', 0),\n                                                                  ('\u6c88\u5341\u56db', 'password14', 'shenshisi@example.com', '\u666e\u901a\u7528\u6237', 1),\n                                                                  ('\u97e9\u5341\u4e94', 'password15', 'hanshiwu@example.com', '\u7f16\u8f91\u4eba\u5458', 0),\n                                                                  ('\u6768\u5341\u516d', 'password16', 'yangshiliu@example.com', '\u7ba1\u7406\u5458', 1),\n                                                                  ('\u6731\u5341\u4e03', 'password17', 'zhushiyi@example.com', '\u666e\u901a\u7528\u6237', 0),\n                                                                  ('\u79e6\u5341\u516b', 'password18', 'qinshiba@example.com', '\u7f16\u8f91\u4eba\u5458', 1),\n                                                                  ('\u5c24\u5341\u4e5d', 'password19', 'youshijiu@example.com', '\u7ba1\u7406\u5458', 0),\n                                                                  ('\u8bb8\u4e8c\u5341', 'password20', 'xushi@example.com', '\u666e\u901a\u7528\u6237', 1);<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u4eceid=2\u5f00\u59cb\u63d2\u5165\u4e8620\u6761\u6570\u636e<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-66-1024x498.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"498\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-66-1024x498.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1421\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p><strong>\u83dc\u5355\u8868(mainmenu)\uff1a<\/strong><\/p>\n\n\n\n<p>SET FOREIGN_KEY_CHECKS=0;<br><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>drop table if exists mainmenu;\nset foreign_key_checks =0;\ncreate table  mainmenu(\n    id  int (50) auto_increment primary key not null ,\n    title varchar(255) not null ,\n    path varchar(255) not null\n\n)ENGINE =InnoDB char set =utf8,auto_increment=1;\nINSERT INTO `mainmenu` VALUES ('100', '\u6743\u9650\u7ba1\u7406', '\/admin');\nINSERT INTO `mainmenu` VALUES ('200', '\u8fd0\u52a8\u5e73\u53f0', '\/use');<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>id,title,path<\/p>\n\n\n\n<p>submenu(\u63d0\u4ea4\u83dc\u5355\u8868)\uff1a<\/p>\n\n\n\n<p>id,title,path,mid,<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#\u63d0\u4ea4\u83dc\u5355\ndrop table if exists submenu;\nset foreign_key_checks =0;\ncreate table submenu(\n    id int(50) primary key  auto_increment not null comment '\u4e3b\u952e',\n    title varchar(255) not null   comment '\u540d\u79f0',\n    path varchar(255) not null comment '\u8def\u5f84',\n    mid int(50) not null ,\n    INDEX mid_idx (mid),\n    constraint submenu_ibfk_1 foreign key (mid) references mainmenu (id) #\u5916\u952e\n)ENGINE =InnoDB char set =utf8 auto_increment=1;\nINSERT INTO `submenu` VALUES ('101', '\u7528\u6237\u5217\u8868', '\/user', '100');\nINSERT INTO `submenu` VALUES ('102', '\u4fee\u6539\u6743\u9650', '\/rights', '100');\nINSERT INTO `submenu` VALUES ('103', ' \u8fd0\u52a8\u6a21\u5757', '\/sport', '100');\nINSERT INTO `submenu` VALUES ('104', '\u5546\u54c1\u6a21\u5757', '\/goods', '100');\nINSERT INTO `submenu` VALUES ('201', '\u8fd0\u52a8\u79d1\u666e', '\/Introduction', '200');\nINSERT INTO `submenu` VALUES ('202', '\u5361\u8def\u91cc', '\/calories', '200');\nINSERT INTO `submenu` VALUES ('203', '\u8425\u517b\u914d\u9910', '\/food', '200');<\/code><\/pre>\n\n\n\n<p>\u521b\u5efa\u7d22\u5f15\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>CREATE TABLE submenu (\n    id INT(50) PRIMARY KEY AUTO_INCREMENT NOT NULL COMMENT '\u4e3b\u952e',\n    title VARCHAR(255) NOT NULL COMMENT '\u540d\u79f0',\n    path VARCHAR(255) NOT NULL COMMENT '\u8def\u5f84',\n    mid INT(50) NOT NULL,\n    -- \u521b\u5efa\u7d22\u5f15\u4f7f\u7528\u4ee5\u4e0b\u65b9\u5f0f\u4e4b\u4e00\n    -- INDEX mid_idx (mid),\n    -- \u6216\u8005\u4f7f\u7528 CREATE INDEX \u8bed\u53e5\u5355\u72ec\u521b\u5efa\u7d22\u5f15\n    -- CREATE INDEX mid_idx ON submenu(mid);\n    CONSTRAINT submenu_ibfk_1 FOREIGN KEY (mid) REFERENCES mainmenu(id)\n) ENGINE=InnoDB CHARSET=utf8mb4;<\/code><\/pre>\n\n\n\n<p>\u4e8c\uff1a\u521b\u5efaSpringBoot\u9879\u76ee<\/p>\n\n\n\n<p>\u521b\u5efa\u5de5\u7a0b\u65f6\u52fe\u9009SpringWEB,JDBC API\uff0c\u521b\u5efaMybatis\u6846\u67b6\uff0c\u4ee5\u53caMysql\u9a71\u52a8<\/p>\n\n\n\n<p>\u542f\u52a8\u7c7b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-68-1024x348.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"348\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-68-1024x348.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1423\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u521b\u5efa\u540e\u6211\u4eec\u770b\u5230\u5de5\u7a0b\u91cc\u7684\u542f\u52a8\u7c7b\uff0c\u8fd9\u65f6\u6211\u4eec\u542f\u52a8\u4e0d\u4e86\uff0c\u56e0\u4e3a\u6211\u4eec\u6ca1\u6709\u914d\u7f6e\u6570\u636e\u6e90<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-67-1024x134.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"134\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-67-1024x134.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1422\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u5728Spring Boot\u5f00\u53d1\u4e2d\uff0c\u9700\u8981\u5728application.yml\u4e2d\u88ab\u6307\u6570\u636e\u5e93\u7684\u8fde\u63a5\u4fe1\u606f\uff0c\u4ee5\u4e0b\u662fMySQL\u8fde\u63a5\u914d\u7f6e\u4ee5\u53capom\u6587\u4ef6\u7684<a href=\"https:\/\/so.csdn.net\/so\/search?q=MySQL%E4%BE%9D%E8%B5%96&amp;spm=1001.2101.3001.7020\" target=\"_blank\" rel=\"noreferrer noopener\">MySQL\u4f9d\u8d56<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>server:\n  port: 8080\nspring:\n  datasource:\n    driver-class-name: com.mysql.cj.jdbc.Driver\n    url: jdbc:mysql:\/\/localhost:3306\/test?&amp;useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=Asia\/Shanghai\n    username: root\n    password: 123456<\/code><\/pre>\n\n\n\n<p>1\u3001port\u662f\u7aef\u53e3<br>2\u3001drive-class-name\uff1a\u8868\u793aMySql\u7248\u672c\u662f8.0\u7248\u672c<br>3\u3001URL:\u8fde\u63a5\u6570\u636e\u5e93\u5176\u4e2d jdbc:mysql\u8868\u793a\u901a\u8fc7jdbc\u6765\u8fde\u63a5\u6570\u636e\u5e93\u3002<br>4\u3001Localhost\uff1a\u8868\u793a\u672c\u673a\u5730\u5740\uff0c<br>5\u3001\u628atest\u6362\u6210\u81ea\u5df1\u6570\u636e\u5e93\u540d\u79f0\u5373\u53ef\uff0c<br>6\u3001username\uff1a\u8868\u793a\u8d26\u53f7\u540d\u79f0\uff0c<br>7\u3001password\uff1a\u8f93\u5165\u81ea\u5df1\u7684\u5bc6\u7801\u5373\u53ef\uff0c<br>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                        \n<\/code><\/pre>\n\n\n\n<p>\u8bb0\u5f97\u5237\u65b0maven\u54e6\u3002<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>\u89e3\u51b3\u8de8\u57df\u95ee\u9898\uff08\u4e00\u79cd\u65b9\u6cd5\uff0c\u4e5f\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u91cc\u8bbe\u7f6e\uff09\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-65-1024x437.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"437\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-65-1024x437.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1420\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>\u521b\u5efa\u524d\u7aef\u9879\u76ee\u4f7f\u7528\u547d\u4ee4<\/p>\n\n\n\n<p>vue ui<\/p>\n\n\n\n<p>\u63d2\u4ef6\uff1aelement ui<\/p>\n\n\n\n<p>\u4f9d\u8d56\uff1aless lessloder  axios<\/p>\n\n\n\n<p>\u8def\u7531\u914d\u7f6e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Vue.use(VueRouter)\n\nconst routes = &#91;\n  {     \n    path : \"\/\",\n    redirect:\"\/login\" \/\/\u91cd\u5b9a\u5411\n   \n  },\n  {\n   path:\"\/login\",\/\/\u8bbf\u95ee\u8def\u5f84\n   component: login\/\/ \u8bbf\u95ee\u5230\u7684\u7ec4\u4ef6\n  }\n]\n\nconst router = new VueRouter({\n  routes\n})\n\nexport default router<\/code><\/pre>\n\n\n\n<p>Css\u5168\u5c40\u6837\u5f0f\uff1aheight:\u9ad8\u5ea6<\/p>\n\n\n\n<p>margin:\u5916\u8fb9\u8ddd<\/p>\n\n\n\n<p>padding:\u5185\u8fb9\u8ddd<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-70-1024x466.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"466\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-70-1024x466.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1430\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<p>login\u9875\u9762\u8bbe\u8ba1\uff1a<\/p>\n\n\n\n<p>\u77e5\u8bc6\u70b9\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template &gt;\n    &lt;div class=\"login_container\"&gt;\n        &lt;!-- \u767b\u5f55\u5757 --&gt;\n        \u6b22\u8fce\u767b\u5f55\u5927\u5065\u5eb7\u5e78\u798f\u7cfb\u7edf\n        &lt;div class=\"login_box\"&gt;\n            &lt;!-- \u5934\u50cf\u533a --&gt;\n            &lt;div class=\"avatar_box\"&gt;\n\n                &lt;img src=\"..\/assets\/image\/xinxin.jpg\" alt=\"6666\" height=\"200\" width=\"200\"&gt;\n\n            &lt;\/div&gt;\n            &lt;!-- \u8868\u5355\u533a\u57df --&gt;\n\n            &lt;el-form ref=\"loginFormRef\" :model=\"loginForm\" class=\"login_form\" label-width=\"0\"&gt;\n                &lt;!-- \u7528\u6237\u540d --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.username\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u5bc6\u7801 --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.password\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u6309\u94ae --&gt;\n                &lt;el-form-item class=\"btns\"&gt;\n                    &lt;el-button type=\"primary\" disabled&gt;\u63d0\u4ea4&lt;\/el-button&gt;\n                    &lt;el-button type=\"info\" disabled&gt;\u91cd\u7f6e&lt;\/el-button&gt;\n                &lt;\/el-form-item&gt;\n\n            &lt;\/el-form&gt;\n\n\n        &lt;\/div&gt;\n\n    &lt;\/div&gt;\n\n\n&lt;\/template&gt;\n\n\n\n&lt;script&gt;\nexport default {\n    data() {\n        return {\n            loginForm:{\n                   username:\"username\",\n                   password:\"password\" \n\n\n            }\n        }\n    },\n\n}\n&lt;\/script&gt;\n\n\n&lt;style lang=\"less\" scoped&gt;\n\n&lt;\/style&gt;<\/code><\/pre>\n\n\n\n<p>div\u6807\u7b7e\u4e2d\u52a0class:<\/p>\n\n\n\n<p><strong>\u5173\u8054 CSS \u6837\u5f0f\u89c4\u5219<\/strong>\uff1a\u8fd9\u662f\u6700\u4e3b\u8981\u7684\u4f5c\u7528\u3002\u5728\u5bf9\u5e94\u7684 CSS \u6587\u4ef6\uff08\u6216\u8005\u5728 Vue \u7ec4\u4ef6\u7684&nbsp;<code>&lt;style&gt;<\/code>&nbsp;\u90e8\u5206\u7b49\uff09\u4e2d\uff0c\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49&nbsp;<code>.login_container<\/code>&nbsp;\u8fd9\u4e2a CSS \u7c7b\u6765\u4e3a\u8be5&nbsp;<code>&lt;div&gt;<\/code>&nbsp;\u5143\u7d20\u8bbe\u7f6e\u5404\u79cd\u5404\u6837\u7684\u6837\u5f0f\u5c5e\u6027\uff0c\u6bd4\u5982\u8bbe\u7f6e\u80cc\u666f\u989c\u8272\u3001\u5b57\u4f53\u5927\u5c0f\u3001\u8fb9\u6846\u6837\u5f0f\u3001\u5185\u8fb9\u8ddd\u3001\u5916\u8fb9\u8ddd\u7b49\u7b49\u3002\u4f8b\u5982\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.login_container {\n    background-color: #f5f5f5;\n    font-size: 16px;\n    border: 1px solid #ccc;\n    padding: 20px;\n    margin: 10px;\n}<\/code><\/pre>\n\n\n\n<p><code>&lt;el-form&gt;<\/code>&nbsp;\u7ec4\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;el-form ref=\"loginFormRef\" :model=\"loginForm\" class=\"login_form\" label-width=\"0\"&gt;\n                &lt;!-- \u7528\u6237\u540d --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.username\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u5bc6\u7801 --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.password\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u6309\u94ae --&gt;\n                &lt;el-form-item class=\"btns\"&gt;\n                    &lt;el-button type=\"primary\" disabled&gt;\u63d0\u4ea4&lt;\/el-button&gt;\n                    &lt;el-button type=\"info\" disabled&gt;\u91cd\u7f6e&lt;\/el-button&gt;\n                &lt;\/el-form-item&gt;\n\n            &lt;\/el-form&gt;<\/code><\/pre>\n\n\n\n<p><strong>\u529f\u80fd\u6982\u8ff0<\/strong>\uff1a\u8fd9\u662f Element UI \u5e93\u4e2d\u7528\u4e8e\u521b\u5efa\u8868\u5355\u7684\u7ec4\u4ef6\u3002\u5b83\u63d0\u4f9b\u4e86\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u6784\u5efa\u548c\u7ba1\u7406\u8868\u5355\u76f8\u5173\u7684\u529f\u80fd\uff0c\u6bd4\u5982\u6536\u96c6\u7528\u6237\u8f93\u5165\u3001\u8fdb\u884c\u8868\u5355\u9a8c\u8bc1\u7b49<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u5c5e\u6027\u8bf4\u660e<\/strong>\uff1a\n<ul class=\"wp-block-list\">\n<li><code>ref=\"loginFormRef\"<\/code>\uff1a\u8fd9\u4e2a\u5c5e\u6027\u4e3a\u8868\u5355\u7ec4\u4ef6\u8bbe\u7f6e\u4e86\u4e00\u4e2a\u5f15\u7528\u6807\u8bc6\u3002\u5728 Vue \u7ec4\u4ef6\u7684\u811a\u672c\u90e8\u5206\uff0c\u53ef\u4ee5\u901a\u8fc7\u8fd9\u4e2a\u5f15\u7528\uff08<code>this.$refs.loginFormRef<\/code>\uff09\u6765\u83b7\u53d6\u5230\u8868\u5355\u5b9e\u4f8b\uff0c\u8fdb\u800c\u5bf9\u8868\u5355\u8fdb\u884c\u5404\u79cd\u64cd\u4f5c\uff0c\u6bd4\u5982\u624b\u52a8\u89e6\u53d1\u8868\u5355\u9a8c\u8bc1\u3001\u83b7\u53d6\u8868\u5355\u6570\u636e\u7b49\u3002<\/li>\n\n\n\n<li><code>:model=\"loginForm\"<\/code>\uff1a\u8fd9\u91cc\u4f7f\u7528\u4e86 Vue \u7684\u52a8\u6001\u7ed1\u5b9a\u8bed\u6cd5\uff08\u901a\u8fc7&nbsp;<code>:<\/code>&nbsp;\u7b26\u53f7\uff09\uff0c\u5c06\u4e00\u4e2a\u540d\u4e3a&nbsp;<code>loginForm<\/code>&nbsp;\u7684\u6570\u636e\u5bf9\u8c61\u4e0e\u8868\u5355\u8fdb\u884c\u7ed1\u5b9a\u3002\u8fd9\u6837\u505a\u7684\u597d\u5904\u662f\uff0c\u8868\u5355\u4e2d\u7684\u5404\u4e2a\u8f93\u5165\u5b57\u6bb5\u7684\u503c\u4f1a\u81ea\u52a8\u4e0e&nbsp;<code>loginForm<\/code>&nbsp;\u5bf9\u8c61\u4e2d\u7684\u5bf9\u5e94\u5c5e\u6027\u4fdd\u6301\u540c\u6b65\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5f53\u7528\u6237\u5728\u8868\u5355\u7684\u8f93\u5165\u5b57\u6bb5\u4e2d\u8f93\u5165\u6570\u636e\u65f6\uff0c<code>loginForm<\/code>&nbsp;\u5bf9\u8c61\u4e2d\u7684\u76f8\u5e94\u5c5e\u6027\u503c\u4f1a\u5b9e\u65f6\u66f4\u65b0\uff0c\u53cd\u4e4b\u4ea6\u7136\u3002<\/li>\n\n\n\n<li><code>class=\"login_form\"<\/code>\uff1a\u7ed9\u8868\u5355\u7ec4\u4ef6\u8bbe\u7f6e\u4e86\u4e00\u4e2a CSS \u7c7b\u540d\uff0c\u76ee\u7684\u662f\u4e3a\u4e86\u5728\u6837\u5f0f\u90e8\u5206\uff08\u901a\u5e38\u662f\u5728&nbsp;<code>&lt;style&gt;<\/code>&nbsp;\u533a\u57df\u6216\u8005\u76f8\u5173\u7684 CSS \u6587\u4ef6\u4e2d\uff09\u53ef\u4ee5\u901a\u8fc7\u5b9a\u4e49&nbsp;<code>.login_form<\/code>&nbsp;\u8fd9\u4e2a CSS \u7c7b\u6765\u4e3a\u8868\u5355\u8bbe\u7f6e\u7279\u5b9a\u7684\u6837\u5f0f\uff0c\u6bd4\u5982\u8bbe\u7f6e\u8868\u5355\u7684\u6574\u4f53\u5916\u89c2\u3001\u8fb9\u6846\u6837\u5f0f\u3001\u5185\u8fb9\u8ddd\u7b49\u3002<\/li>\n\n\n\n<li><code>label-width=\"0\"<\/code>\uff1a\u901a\u5e38\u5728\u8868\u5355\u4e2d\uff0c\u6bcf\u4e2a\u8f93\u5165\u5b57\u6bb5\u524d\u9762\u53ef\u80fd\u4f1a\u6709\u4e00\u4e2a\u6807\u7b7e\u6765\u6807\u8bc6\u8be5\u5b57\u6bb5\u7684\u7528\u9014\uff08\u6bd4\u5982 \u201c\u7528\u6237\u540d\u201d\u201c\u5bc6\u7801\u201d \u7b49\uff09\uff0c\u8fd9\u4e2a\u5c5e\u6027\u7528\u4e8e\u63a7\u5236\u8fd9\u4e9b\u6807\u7b7e\u7684\u5bbd\u5ea6\u3002\u8bbe\u7f6e\u4e3a&nbsp;<code>0<\/code>&nbsp;\u610f\u5473\u7740\u4e0d\u5e0c\u671b\u663e\u793a\u8fd9\u4e9b\u6807\u7b7e\u7684\u5bbd\u5ea6\uff0c\u53ef\u80fd\u662f\u6839\u636e\u8bbe\u8ba1\u9700\u6c42\uff0c\u91c7\u7528\u4e86\u5176\u4ed6\u65b9\u5f0f\u6765\u6807\u8bc6\u8f93\u5165\u5b57\u6bb5\u7684\u7528\u9014\uff0c\u6216\u8005\u4e0d\u9700\u8981\u8fd9\u79cd\u4f20\u7edf\u7684\u5e26\u6807\u7b7e\u5bbd\u5ea6\u7684\u8868\u5355\u6837\u5f0f\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<p><code>&lt;el-form-item&gt;<\/code>&nbsp;\u7ec4\u4ef6<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.username\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u5bc6\u7801 --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.password\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u6309\u94ae --&gt;\n                &lt;el-form-item class=\"btns\"&gt;\n                    &lt;el-button type=\"primary\" disabled&gt;\u63d0\u4ea4&lt;\/el-button&gt;\n                    &lt;el-button type=\"info\" disabled&gt;\u91cd\u7f6e&lt;\/el-button&gt;\n                &lt;\/el-form-item&gt;<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>\u529f\u80fd\u6982\u8ff0<\/strong>\uff1a\u5b83\u662f\u914d\u5408&nbsp;<code>&lt;el-form&gt;<\/code>&nbsp;\u7ec4\u4ef6\u4f7f\u7528\u7684\uff0c\u7528\u4e8e\u5305\u88f9\u8868\u5355\u4e2d\u7684\u5404\u4e2a\u8f93\u5165\u9879\uff08\u5982\u6587\u672c\u8f93\u5165\u6846\u3001\u5bc6\u7801\u8f93\u5165\u6846\u7b49\uff09\uff0c\u8d77\u5230\u4e00\u4e2a\u5206\u7ec4\u548c\u7ec4\u7ec7\u7684\u4f5c\u7528\uff0c\u5e76\u4e14\u53ef\u4ee5\u5728\u8fd9\u4e2a\u7ec4\u4ef6\u4e0a\u8bbe\u7f6e\u4e00\u4e9b\u4e0e\u5177\u4f53\u8f93\u5165\u9879\u76f8\u5173\u7684\u5c5e\u6027\u548c\u64cd\u4f5c\u3002<\/li>\n\n\n\n<li><strong>\u540e\u7eed\u53ef\u80fd\u7684\u7528\u6cd5<\/strong>\uff1a\u901a\u5e38\u5728&nbsp;<code>&lt;el-form-item&gt;<\/code>&nbsp;\u5185\u90e8\u4f1a\u653e\u7f6e\u5177\u4f53\u7684\u8f93\u5165\u7ec4\u4ef6\uff0c\u6bd4\u5982&nbsp;<code>&lt;el-input&gt;<\/code>\uff08\u7528\u4e8e\u6587\u672c\u8f93\u5165\uff09\u3001<code>&lt;el-password&gt;<\/code>\uff08\u7528\u4e8e\u5bc6\u7801\u8f93\u5165\uff09\u7b49\uff0c\u5e76\u4e14\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8bbe\u7f6e\u8fd9\u4e9b\u8f93\u5165\u7ec4\u4ef6\u7684\u5404\u79cd\u5c5e\u6027\uff0c\u5982\u7ed1\u5b9a\u6570\u636e\u3001\u8bbe\u7f6e\u8f93\u5165\u7c7b\u578b\u3001\u6dfb\u52a0\u9a8c\u8bc1\u89c4\u5219\u7b49\u3002\u4f8b\u5982\uff1a<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><code>data<\/code>&nbsp;\u51fd\u6570<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5728 Vue \u7ec4\u4ef6\u4e2d\uff0c<code>data<\/code>&nbsp;\u51fd\u6570\u662f\u4e00\u4e2a\u7279\u6b8a\u7684\u51fd\u6570\uff0c\u5b83\u7528\u4e8e\u5b9a\u4e49\u7ec4\u4ef6\u5185\u90e8\u7684\u6570\u636e\u3002\u5b83\u8fd4\u56de\u7684\u5bf9\u8c61\u4e2d\u7684\u6bcf\u4e2a\u5c5e\u6027\u90fd\u4ee3\u8868\u4e86\u7ec4\u4ef6\u7684\u4e00\u79cd\u6570\u636e\u72b6\u6001\u3002<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;script&gt;\nexport default {\n    data() {\n        return {\n            loginForm:{\n                   username:\"username\",\n                   password:\"password\" \n\n\n            }\n        }\n    },\n\n}\n&lt;\/script&gt;<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u7684loginForm:{<br>                   username:&#8221;username&#8221;,<br>                   password:&#8221;password&#8221; <br>            }\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u800cusername\u548cpassword\u662f\u5b83\u7684\u5c5e\u6027\uff0c<\/p>\n\n\n\n<p>\u8fd9\u91cc\u901a\u8fc7&nbsp;<code>:model=\"loginForm\"<\/code>&nbsp;\u5c06\u811a\u672c\u90e8\u5206\uff08<code>&lt;script&gt;<\/code>\uff09\u4e2d\u5b9a\u4e49\u7684&nbsp;<code>loginForm<\/code>&nbsp;\u5bf9\u8c61\u4e0e&nbsp;<code>&lt;el-form&gt;<\/code>&nbsp;\u7ec4\u4ef6\u8fdb\u884c\u4e86\u7ed1\u5b9a\u3002<\/p>\n\n\n\n<p>\u5f53\u5bf9\u8c61\u540d\u548c&nbsp;<code>model<\/code>&nbsp;\u5c5e\u6027\u503c\u4e2d\u7684\u540d\u79f0\u4e0d\u4e00\u81f4\u65f6\uff0c\u53ef\u80fd\u4f1a\u5728\u4ee3\u7801\u9605\u8bfb\u548c\u540e\u7eed\u7ef4\u62a4\u8fc7\u7a0b\u4e2d\u589e\u52a0\u4e00\u4e9b\u6df7\u6dc6\u56e0\u7d20\u3002\u5c24\u5176\u662f\u5728\u8f83\u4e3a\u590d\u6742\u7684\u9879\u76ee\u4e2d\uff0c\u53ef\u80fd\u4f1a\u6709\u591a\u4e2a\u8868\u5355\uff0c\u6bcf\u4e2a\u8868\u5355\u90fd\u6709\u81ea\u5df1\u7684\u6570\u636e\u7ed1\u5b9a\uff0c\u5982\u679c\u540d\u79f0\u4e0d\u4e00\u81f4\u4e14\u7f3a\u4e4f\u6e05\u6670\u7684\u6587\u6863\u6216\u6ce8\u91ca\uff0c\u53ef\u80fd\u4f1a\u5bfc\u81f4\u65b0\u52a0\u5165\u9879\u76ee\u7684\u5f00\u53d1\u4eba\u5458\u96be\u4ee5\u5feb\u901f\u7406\u89e3\u4ee3\u7801\u903b\u8f91\u3002<\/p>\n\n\n\n<p>\u56fe\u6807\uff1a<a href=\"https:\/\/www.iconfont.cn\/\">https:\/\/www.iconfont.cn\/<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.password\" placeholder=\"\u8bf7\u8f93\u5165\u5bc6\u7801\" prefix-icon=\"el-icon-loading\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;<\/code><\/pre>\n\n\n\n<p>placeholder=&#8221;\u8bf7\u8f93\u5165\u5bc6\u7801&#8221;\u4f1a\u5728\u65b9\u6846\u5185\u663e\u793a\u201c\u8bf7\u8f93\u5165\u5bc6\u7801\u201d   <\/p>\n\n\n\n<p>prefix-icon=&#8221;el-icon-loading&#8221;&gt;\u8fd9\u662f\u5728\u65b9\u6846\u5185\u663e\u793a\u56fe\u6807<\/p>\n\n\n\n<p>\u5176\u4ed6\u56fe\u6807\u4e5f\u53ef\u4ee5\u5728\u963f\u91cc\u5df4\u5df4\u56fe\u6807\u56fe\u5e93\u5bfb\u627e<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-71-1024x541.png'><img class=\"lazyload lazyload-style-1\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"541\" data-original=\"https:\/\/note.ui11.cc\/wp-content\/uploads\/2024\/11\/image-71-1024x541.png\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" class=\"wp-image-1431\"  sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/div><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;template &gt;\n    &lt;div class=\"login_container\"&gt;\n        &lt;!-- \u767b\u5f55\u5757 --&gt;\n        \u6b22\u8fce\u767b\u5f55\u5927\u5065\u5eb7\u5e78\u798f\u7cfb\u7edf\n        &lt;div class=\"login_box\"&gt;\n            &lt;!-- \u5934\u50cf\u533a --&gt;\n            &lt;div class=\"avatar_box\"&gt;\n\n                &lt;img src=\"..\/assets\/image\/xinxin.jpg\" alt=\"6666\" height=\"200\" width=\"200\"&gt;\n\n            &lt;\/div&gt;\n            &lt;!-- \u8868\u5355\u533a\u57df --&gt;\n\n            &lt;el-form ref=\"loginFormRef\" :model=\"loginForm\" class=\"login_form\" label-width=\"0\"&gt;\n                &lt;!-- \u7528\u6237\u540d --&gt;\n                &lt;!-- \u7528\u6237\u540d --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.username\" prefix-icon=\"el-icon-s-custom\"\n                        placeholder=\"\u8bf7\u8f93\u5165\u8d26\u53f7\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u5bc6\u7801 --&gt;\n                &lt;el-form-item&gt;\n                    &lt;el-input v-model=\"loginForm.password\" placeholder=\"\u8bf7\u8f93\u5165\u5bc6\u7801\" prefix-icon=\"el-icon-loading\"\n                        type=\"password\"&gt;&lt;\/el-input&gt;\n                &lt;\/el-form-item&gt;\n                &lt;!-- \u6309\u94ae --&gt;\n                &lt;el-form-item class=\"btns\"&gt;\n                    &lt;el-button type=\"info\" plain&gt;\u63d0\u4ea4&lt;\/el-button&gt;\n\n\n                    &lt;el-button type=\"warning\" plain&gt;\u91cd\u7f6e&lt;\/el-button&gt;\n\n                &lt;\/el-form-item&gt;\n\n            &lt;\/el-form&gt;\n\n\n        &lt;\/div&gt;\n\n    &lt;\/div&gt;\n\n\n&lt;\/template&gt;\n\n\n\n&lt;script&gt;\nexport default {\n    data() {\n        return {\n            loginForm:{\n                   username:\"\",\n                   password:\"\" \n\n\n            }\n        }\n    },\n\n}\n&lt;\/script&gt;\n\n\n&lt;style lang=\"less\" scoped&gt;\n\/\/\u6839\u8282\u70b9\u6837\u5f0f\u80cc\u666f\u989c\u8272\u5168\u8986\u76d6\n.login_container{\nbackground-color: #2b4b6b;\nheight: 100%;\n}\n\n.login_box{\nwidth: 450px;\nheight: 300px;\nbackground-color: #c7a3ab;\nborder-radius: 5px;\nposition: absolute;\/\/\u7edd\u5bf9\u5b9a\u4f4d\nleft: 50%;\ntop: 50%;\ntransform: translate(-50%,-50%);\n\n.avatar_box {\n        width: 130px;\n        height: 130px;\n        border: 1px solid#eeeeee;\n        \/\/ background-color: #fff;\n        border-radius: 50%;\n\n        padding: 10px;\n        box-shadow: 0 0 10px #ddd;\n        position: absolute; \/\/\u7edd\u5bf9\u5b9a\u4f4d\n        left: 50%;\n        top: 0%;\n        transform: translate(-50%, -50%);\n        background-color: #0ee;\n\n      \n\n    }\n\n         img {\n    \n             width: 100%;\n             height: 100%;\n             border-radius: 50%;\n             background-color: #eee;\n    \n    \n    \n         }\n}\n.btns{\n\n\ndisplay: flex;\njustify-content: center;\nalign-items: center;\n    \/* \u5c06\u6309\u94ae\u5728\u4ea4\u53c9\u8f74\u65b9\u5411\u4e0a\u5c45\u4e2d *\/\n    \n.btns.el-button {\n        margin-left: 80px;\n        \/* \u7ed9\u6bcf\u4e2a\u6309\u94ae\u8bbe\u7f6e\u5de6\u8fb9\u8ddd\uff0c\u53ef\u6839\u636e\u9700\u8981\u8c03\u6574\u8fd9\u4e2a\u503c *\/\n    }\n}\n\n\n.login_form{\n\nposition: absolute;\nbottom: 0%;\nwidth: 100%;\npadding: 0% 10px;\nbox-sizing: border-box;\n}\n\n.custom-submit-button {\n    background-color: #0088cc;\n    \/* \u8bbe\u7f6e\u63d0\u4ea4\u6309\u94ae\u7684\u80cc\u666f\u8272\u4e3a\u6d45\u84dd\u8272 *\/\n    color: white;\n    \/* \u8bbe\u7f6e\u6587\u5b57\u989c\u8272\u4e3a\u767d\u8272 *\/\n}\n\n.custom-reset-button {\n    background-color: #ff9900;\n    \/* \u8bbe\u7f6e\u91cd\u7f6e\u6309\u94ae\u7684\u80cc\u666f\u8272\u4e3a\u6a59\u9ec4\u8272 *\/\n    color: white;\n    \/* \u8bbe\u7f6e\u6587\u5b57\u989c\u8272\u4e3a\u767d\u8272 *\/\n}\n \n&lt;\/style&gt;<\/code><\/pre>\n\n\n\n<details class=\"wp-block-details is-layout-flow wp-block-details-is-layout-flow\"><summary>\u767b\u5f55\u9875\u9762\u4ee3\u7801<\/summary>\n<p>&lt;template &gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &lt;div class=&#8221;login_container&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u767b\u5f55\u5757 &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \u6b22\u8fce\u767b\u5f55\u5927\u5065\u5eb7\u5e78\u798f\u7cfb\u7edf<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&#8221;login_box&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u5934\u50cf\u533a &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div class=&#8221;avatar_box&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;img src=&#8221;..\/assets\/image\/xinxin.jpg&#8221; alt=&#8221;6666&#8243; height=&#8221;200&#8243; width=&#8221;200&#8243;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u8868\u5355\u533a\u57df &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-form ref=&#8221;loginFormRef&#8221; :rules=&#8221;loginRules&#8221; :model=&#8221;loginForm&#8221; class=&#8221;login_form&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; label-width=&#8221;0&#8243;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u7528\u6237\u540d &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u7528\u6237\u540d &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-form-item prop=&#8221;username&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-input v-model=&#8221;loginForm.username&#8221; prefix-icon=&#8221;el-icon-s-custom&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; placeholder=&#8221;\u8bf7\u8f93\u5165\u8d26\u53f7&#8221;&gt;&lt;\/el-input&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el-form-item&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u5bc6\u7801 &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-form-item prop=&#8221;password&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-input v-model=&#8221;loginForm.password&#8221; placeholder=&#8221;\u8bf7\u8f93\u5165\u5bc6\u7801&#8221; prefix-icon=&#8221;el-icon-loading&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; type=&#8221;password&#8221;&gt;&lt;\/el-input&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el-form-item&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;!&#8211; \u6309\u94ae &#8211;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-form-item class=&#8221;btns&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-button type=&#8221;info&#8221; plain&gt;\u63d0\u4ea4&lt;\/el-button&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;el-button type=&#8221;warning&#8221; plain&gt;\u91cd\u7f6e&lt;\/el-button&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el-form-item&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el-form&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &lt;\/div&gt;<\/p>\n\n\n\n<p>&lt;\/template&gt;<\/p>\n\n\n\n<p>&lt;script&gt;<\/p>\n\n\n\n<p>export default {<\/p>\n\n\n\n<p>&nbsp; &nbsp; data() {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; return {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u8868\u5355\u6570\u636e\u5bf9\u8c61<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loginForm:{<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;username:&#8221;&#8221;,<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;password:&#8221;&#8221;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u9a8c\u8bc1\u5bf9\u8c61<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; loginRules:{<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u6821\u9a8c\u89c4\u5219<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u7528\u6237\u540d<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; username:[<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { required: true, message: &#8216;\u8bf7\u8f93\u5165\u8d26\u53f7&#8217;, trigger: &#8216;blur&#8217; },\/\/\u5fc5\u586b\u9879\u9a8c\u8bc1<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { min: 5, max: 20, message: &#8216;\u957f\u5ea6\u5728 5 \u5230 20 \u4e2a\u5b57\u7b26&#8217;, trigger: &#8216;blur&#8217; }\/\/\u9a8c\u8bc1\u957f\u5ea6<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/\u5bc6\u7801<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; password:[<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { required: true, message: &#8216;\u8bf7\u8f93\u5165\u5bc6\u7801&#8217;, trigger: &#8216;blur&#8217; },\/\/\u5fc5\u586b\u9879\u9a8c\u8bc1<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; { min: 6, max: 20, message: &#8216;\u957f\u5ea6\u5728 6 \u5230 20 \u4e2a\u5b57\u7b26&#8217;, trigger: &#8216;blur&#8217; }\/\/\u9a8c\u8bc1\u957f\u5ea6<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ],<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; },<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; };<\/p>\n\n\n\n<p>&nbsp; &nbsp; },<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/script&gt;<\/p>\n\n\n\n<p>&lt;style lang=&#8221;less&#8221; scoped&gt;<\/p>\n\n\n\n<p>\/\/\u6839\u8282\u70b9\u6837\u5f0f\u80cc\u666f\u989c\u8272\u5168\u8986\u76d6<\/p>\n\n\n\n<p>.login_container{<\/p>\n\n\n\n<p>background-color: #2b4b6b;<\/p>\n\n\n\n<p>height: 100%;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>.login_box{<\/p>\n\n\n\n<p>width: 450px;<\/p>\n\n\n\n<p>height: 300px;<\/p>\n\n\n\n<p>background-color: #c7a3ab;<\/p>\n\n\n\n<p>border-radius: 5px;<\/p>\n\n\n\n<p>position: absolute;\/\/\u7edd\u5bf9\u5b9a\u4f4d<\/p>\n\n\n\n<p>left: 50%;<\/p>\n\n\n\n<p>top: 50%;<\/p>\n\n\n\n<p>transform: translate(-50%,-50%);<\/p>\n\n\n\n<p>.avatar_box {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; width: 130px;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; height: 130px;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; border: 1px solid#eeeeee;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ background-color: #fff;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; border-radius: 50%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; padding: 10px;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; box-shadow: 0 0 10px #ddd;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; position: absolute; \/\/\u7edd\u5bf9\u5b9a\u4f4d<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; left: 50%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; top: 0%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; transform: translate(-50%, -50%);<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; background-color: #0ee;<\/p>\n\n\n\n<p>&nbsp; &nbsp; }<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;img {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;width: 100%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;height: 100%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;border-radius: 50%;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;background-color: #eee;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>.btns{<\/p>\n\n\n\n<p>display: flex;<\/p>\n\n\n\n<p>justify-content: center;<\/p>\n\n\n\n<p>align-items: center;<\/p>\n\n\n\n<p>&nbsp; &nbsp; \/* \u5c06\u6309\u94ae\u5728\u4ea4\u53c9\u8f74\u65b9\u5411\u4e0a\u5c45\u4e2d *\/<\/p>\n\n\n\n<p>.btns.el-button {<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; margin-left: 80px;<\/p>\n\n\n\n<p>&nbsp; &nbsp; &nbsp; &nbsp; \/* \u7ed9\u6bcf\u4e2a\u6309\u94ae\u8bbe\u7f6e\u5de6\u8fb9\u8ddd\uff0c\u53ef\u6839\u636e\u9700\u8981\u8c03\u6574\u8fd9\u4e2a\u503c *\/<\/p>\n\n\n\n<p>&nbsp; &nbsp; }<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>.login_form{<\/p>\n\n\n\n<p>position: absolute;<\/p>\n\n\n\n<p>bottom: 0%;<\/p>\n\n\n\n<p>width: 100%;<\/p>\n\n\n\n<p>padding: 0% 10px;<\/p>\n\n\n\n<p>box-sizing: border-box;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>.custom-submit-button {<\/p>\n\n\n\n<p>&nbsp; &nbsp; background-color: #0088cc;<\/p>\n\n\n\n<p>&nbsp; &nbsp; \/* \u8bbe\u7f6e\u63d0\u4ea4\u6309\u94ae\u7684\u80cc\u666f\u8272\u4e3a\u6d45\u84dd\u8272 *\/<\/p>\n\n\n\n<p>&nbsp; &nbsp; color: white;<\/p>\n\n\n\n<p>&nbsp; &nbsp; \/* \u8bbe\u7f6e\u6587\u5b57\u989c\u8272\u4e3a\u767d\u8272 *\/<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>.custom-reset-button {<\/p>\n\n\n\n<p>&nbsp; &nbsp; background-color: #ff9900;<\/p>\n\n\n\n<p>&nbsp; &nbsp; \/* \u8bbe\u7f6e\u91cd\u7f6e\u6309\u94ae\u7684\u80cc\u666f\u8272\u4e3a\u6a59\u9ec4\u8272 *\/<\/p>\n\n\n\n<p>&nbsp; &nbsp; color: white;<\/p>\n\n\n\n<p>&nbsp; &nbsp; \/* \u8bbe\u7f6e\u6587\u5b57\u989c\u8272\u4e3a\u767d\u8272 *\/<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>&lt;\/style&gt;<\/p>\n<\/details>\n\n\n\n<p>\u6302\u8f7daxios<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import Vue from 'vue'\nimport App from '.\/App.vue'\nimport router from '.\/router'\nimport '.\/plugins\/element.js'\n\/\/\u6dfb\u52a0\u5168\u5c40\u6837\u5f0f\nimport '..\/src\/assets\/css\/global.css'\n\/\/\u5f15\u5165\u89e3\u51b3\u8de8\u57df\u8bf7\u6c42\u989d\u5ea6axios\nimport axios from 'axios'\n\/\/\u6302\u8f7d\u8bbeaxios\nVue.prototype.$http=axios\n\/\/\u8bbe\u7f6e\u8bbf\u95ee\u8def\u5f84\naxios.defaults.baseURL=\"http:\/\/localhost:9002\"\n\n\nVue.config.productionTip = false\n\nnew Vue({\n  router,\n  render: h =&gt; h(App)\n}).$mount('#app')\n<\/code><\/pre>\n\n\n\n<p>\u8868\u5355\u91cd\u7f6e\uff1a<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u770b\u5230\u8868\u5355\u6709\u4e2aref\u5c5e\u6027\uff0c\u6211\u4eec\u901a\u8fc7\u8fd9\u4e2a\u5c5e\u6027\u6765\u83b7\u53d6\u8fd9\u4e2a\u8868\u5355\u7684\u5bf9\u8c61<\/p>\n\n\n\n<p>&nbsp;<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;el-form ref=\"loginFormRef\" :rules=\"loginRules\" :model=\"loginForm\" class=\"login_form\" label-width=\"0\"&gt;\n\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \u7701\u7565\n\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;\/el-form-item&gt;<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u5728\u91cd\u7f6e\u6309\u94ae\u90a3\u91cc@click\u6765\u7ed1\u5b9a\u4e8b\u4ef6\uff0c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;el-button type=\"warning\" plain  @click=\"resetLoginForm\"&gt;\u91cd\u7f6e&lt;\/el-button&gt;\n<\/code><\/pre>\n\n\n\n<p>\u5199\u4e00\u4e2a\u65b9\u6cd5\u5c31\u53ebresetLoginFormRef(),\u6211\u4eec\u8c03\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>   this.$refs.loginFormRef.resetFields();\n<\/code><\/pre>\n\n\n\n<p>\u5176\u4e2dresetFields()\u8fd9\u4e2a\u65b9\u6cd5\u662f\u7528\u6765\u91cd\u7f6e\u8868\u5355\u7684<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> login(){\n\n            \/\/\u7bad\u5934\u51fd\u6570,\u5982\u679c\u8f93\u5165\u4e86\u8d26\u53f7\u5bc6\u7801\u5c31\u4f1a\u8fd4\u56detrue,\u5426\u5219\u8fd4\u56defalse\n        this.$refs.loginFormRef.validate( valid=&gt;{\n            console.log(valid)\n\n\n        }  )<\/code><\/pre>\n\n\n\n<p>validate&nbsp;\u65b9\u6cd5\u4e3b\u8981\u7528\u4e8e\u89e6\u53d1\u8868\u5355\u7684\u9a8c\u8bc1\u64cd\u4f5c\uff0c\u5e76\u6839\u636e\u9a8c\u8bc1\u7ed3\u679c\u6267\u884c\u76f8\u5e94\u7684\u903b\u8f91<br><\/p>\n\n\n\n<p>\u53d1\u9001\u767b\u5f55\u8bf7\u6c42\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$refs.loginFormRef.validate(async valid=>{   \/\/\u5f53\u8868\u5355\u4e2d\u7684\u6240\u6709\u9a8c\u8bc1\u89c4\u5219\u90fd\u6ee1\u8db3\u65f6\uff0cvalid \u4f1a\u88ab\u8bbe\u7f6e\u4e3a true\n          if(!valid) return;\n          const {data:res}=await this.$http.post(\"test\");\n            console.log(res);\n\n<\/code><\/pre>\n\n\n\n<p>\u5f53\u524d\u6240\u5728\u7684\u51fd\u6570\uff08\u4e5f\u5c31\u662f\u5305\u542b\u8fd9\u884c\u4ee3\u7801\u7684\u5916\u5c42\u51fd\u6570\uff0c\u6bd4\u5982\u53ef\u80fd\u662f\u67d0\u4e2a\u7ec4\u4ef6\u65b9\u6cd5\uff09\u662f\u4e00\u4e2a\u5f02\u6b65\u51fd\u6570\uff08\u56e0\u4e3a\u80fd\u4f7f\u7528\u00a0<code>await<\/code>\u00a0\u5173\u952e\u5b57\u7684\u51fd\u6570\u5fc5\u987b\u662f\u5f02\u6b65\u51fd\u6570\uff0c\u901a\u5e38\u7528\u00a0<code>async<\/code>\u00a0\u5173\u952e\u5b57\u6765\u58f0\u660e\uff09\u3002\u5b83\u4f1a\u6682\u505c\u5f53\u524d\u51fd\u6570\u7684\u6267\u884c\uff0c\u76f4\u5230\u00a0<code>this.$http.post(\"test\")<\/code>\u00a0\u8fd9\u4e2a\u5f02\u6b65\u64cd\u4f5c\u5b8c\u6210\u3002<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>this.$http.post(\"test\")<\/code>\uff1a\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u91cc\u5047\u8bbe\u00a0<code>this.$http<\/code>\u00a0\u662f\u4e00\u4e2a\u7528\u4e8e\u5904\u7406 HTTP \u8bf7\u6c42\u7684\u5bf9\u8c61\uff08\u5728 Vue \u9879\u76ee\u4e2d\uff0c\u53ef\u80fd\u662f\u57fa\u4e8e\u00a0<code>axios<\/code>\u00a0\u6216\u8005\u5176\u4ed6 HTTP \u5ba2\u6237\u7aef\u5e93\u8fdb\u884c\u4e86\u5c01\u88c5\u540e\u7684\u5bf9\u8c61\uff09\u3002<code>post<\/code>\u00a0\u662f\u5b83\u63d0\u4f9b\u7684\u7528\u4e8e\u53d1\u9001 POST \u8bf7\u6c42\u7684\u65b9\u6cd5\uff0c\u53c2\u6570\u00a0<code>\"test\"<\/code>\u00a0\u8868\u793a\u8bf7\u6c42\u8981\u53d1\u9001\u5230\u7684\u76ee\u6807 URL \u8def\u5f84\uff08\u8fd9\u91cc\u7b80\u5355\u5199\u4e3a\u00a0<code>\"test\"<\/code>\uff0c\u5b9e\u9645\u5e94\u7528\u4e2d\u5e94\u8be5\u662f\u5b8c\u6574\u7684\u3001\u6709\u6548\u7684 URL \u5730\u5740\uff0c\u6bd4\u5982\u00a0<code>\"https:\/\/example.com\/api\/test\"<\/code>\uff09\u3002<\/li>\n\n\n\n<li>\u8fd9\u4e2a\u65b9\u6cd5\u8c03\u7528\u4f1a\u53d1\u8d77\u4e00\u4e2a POST \u8bf7\u6c42\u5230\u6307\u5b9a\u7684 URL\uff0c\u5e76\u8fd4\u56de\u4e00\u4e2a\u00a0<code>Promise<\/code>\u00a0\u5bf9\u8c61\u3002\u8fd9\u4e2a\u00a0<code>Promise<\/code>\u00a0\u5bf9\u8c61\u4f1a\u5728\u8bf7\u6c42\u5b8c\u6210\uff08\u6210\u529f\u6216\u5931\u8d25\uff09\u65f6\u88ab\u89e3\u51b3\uff08resolved\uff09\u6216\u88ab\u62d2\u7edd\uff08rejected\uff09\u3002<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><code>console.log(res);<\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u8fd9\u4e00\u884c\u5f88\u7b80\u5355\uff0c\u5c31\u662f\u5c06\u524d\u9762\u901a\u8fc7\u89e3\u6784\u8d4b\u503c\u5f97\u5230\u7684\u53d8\u91cf\u00a0<code>res<\/code>\uff08\u4e5f\u5c31\u662f POST \u8bf7\u6c42\u6240\u83b7\u53d6\u5230\u7684\u54cd\u5e94\u6570\u636e\uff09\u8f93\u51fa\u5230\u6d4f\u89c8\u5668\u7684\u63a7\u5236\u53f0\u4e2d\u3002\u8fd9\u6837\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u5f00\u53d1\u4eba\u5458\u5c31\u53ef\u4ee5\u65b9\u4fbf\u5730\u67e5\u770b\u8bf7\u6c42\u8fd4\u56de\u7684\u6570\u636e\u5185\u5bb9\uff0c\u4ee5\u4fbf\u8fdb\u884c\u8c03\u8bd5\u3001\u9a8c\u8bc1\u6570\u636e\u662f\u5426\u7b26\u5408\u9884\u671f\u7b49\u64cd\u4f5c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5982\u679c\u767b\u5f55\u6210\u529f\u540e\u5c31\u63d0\u793a\u767b\u5f55\u6210\u529f\u7684\u4fe1\u606f\u5426\u5219\u63d0\u793a\u767b\u5f55\u5931\u8d25<\/p>\n\n\n\n<p>Vue \u63d0\u4f9b\u4e86\u8fd9\u4e48\u51e0\u4e2a\u63d0\u793a\u4fe1\u606f\u7684\uff1a<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">1. error<\/h3>\n\n\n\n<p>\u7528\u4e8e\u5c55\u793a\u9519\u8bef\u6d88\u606f\uff0c\u544a\u77e5\u7528\u6237\u64cd\u4f5c\u51fa\u73b0\u4e86\u95ee\u9898\u6216\u53d1\u751f\u4e86\u9519\u8bef\u60c5\u51b5\u3002\u4f8b\u5982\u5728\u767b\u5f55\u65f6\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\u3001\u7f51\u7edc\u8bf7\u6c42\u5931\u8d25\u7b49\u573a\u666f\u4e0b\u4f1a\u4f7f\u7528\u5230\u3002\u4ee5 Element UI \u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$message.error(\"\u7528\u6237\u540d\u6216\u5bc6\u7801\u9519\u8bef\uff0c\u8bf7\u91cd\u65b0\u8f93\u5165\u3002\");<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">2. warning<\/h3>\n\n\n\n<p>\u7528\u4e8e\u5c55\u793a\u8b66\u544a\u6d88\u606f\uff0c\u63d0\u793a\u7528\u6237\u67d0\u4e9b\u60c5\u51b5\u53ef\u80fd\u9700\u8981\u6ce8\u610f\uff0c\u4f46\u4e0d\u4e00\u5b9a\u610f\u5473\u7740\u64cd\u4f5c\u5df2\u7ecf\u5931\u8d25\u3002\u6bd4\u5982\u7528\u6237\u8f93\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u5b58\u5728\u6f5c\u5728\u98ce\u9669\u3001\u67d0\u4e9b\u8bbe\u7f6e\u5373\u5c06\u8d85\u51fa\u5141\u8bb8\u8303\u56f4\u7b49\u573a\u666f\u3002\u540c\u6837\u4ee5 Element UI \u4e3a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$message.warning(\"\u60a8\u8f93\u5165\u7684\u5bc6\u7801\u8fc7\u4e8e\u7b80\u5355\uff0c\u8bf7\u91cd\u65b0\u8bbe\u7f6e\u4e00\u4e2a\u66f4\u5b89\u5168\u7684\u5bc6\u7801\u3002\");<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">3. info<\/h3>\n\n\n\n<p>\u7528\u4e8e\u5c55\u793a\u4e00\u822c\u7684\u4fe1\u606f\u6d88\u606f\uff0c\u7ed9\u7528\u6237\u4f20\u8fbe\u4e00\u4e9b\u666e\u901a\u7684\u3001\u9700\u8981\u4e86\u89e3\u7684\u5185\u5bb9\u3002\u6bd4\u5982\u7cfb\u7edf\u66f4\u65b0\u901a\u77e5\u3001\u65b0\u529f\u80fd\u4ecb\u7ecd\u7b49\u60c5\u51b5\u3002\u4ee5\u4e0b\u662f\u4f7f\u7528 Ant Design Vue \u7684\u793a\u4f8b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$message.info(\"\u7cfb\u7edf\u5c06\u4e8e\u660e\u65e5\u51cc\u6668\u8fdb\u884c\u7ef4\u62a4\uff0c\u8bf7\u63d0\u524d\u505a\u597d\u51c6\u5907\u3002\");<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">4. loading<\/h3>\n\n\n\n<p>\u6709\u4e9b\u6d88\u606f\u63d0\u793a\u7ec4\u4ef6\u8fd8\u63d0\u4f9b&nbsp;<code>loading<\/code>&nbsp;\u529f\u80fd\uff0c\u7528\u4e8e\u5728\u67d0\u4e9b\u64cd\u4f5c\uff08\u5982\u957f\u65f6\u95f4\u7684\u7f51\u7edc\u8bf7\u6c42\u3001\u590d\u6742\u7684\u8ba1\u7b97\u7b49\uff09\u8fdb\u884c\u671f\u95f4\u5411\u7528\u6237\u5c55\u793a\u4e00\u4e2a\u52a0\u8f7d\u4e2d\u7684\u63d0\u793a\uff0c\u8ba9\u7528\u6237\u77e5\u9053\u7cfb\u7edf\u6b63\u5728\u5904\u7406\u76f8\u5173\u4e8b\u52a1\uff0c\u800c\u4e0d\u662f\u65e0\u54cd\u5e94\u72b6\u6001\u3002\u4f8b\u5982\u5728\u53d1\u9001\u4e00\u4e2a\u5927\u578b\u6587\u4ef6\u7684\u7f51\u7edc\u8bf7\u6c42\u65f6\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$message.loading(\"\u6b63\u5728\u4e0a\u4f20\u6587\u4ef6\uff0c\u8bf7\u7a0d\u5019...\");<\/code><\/pre>\n\n\n\n<p>\u6211\u4eec\u7684\u4ee3\u7801\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>this.$refs.loginFormRef.validate(\nasync  valid=>{\nif(!valid)return;\nconst{data:res}=await this.$http.post(\"test\");\nif(res==\"ok\"){\nthis.$message.success(\"\u767b\u5f55\u6210\u529f\");\n}else{\nthis.$mssage.erroe(\"\u767b\u5f55\u5931\u8d25\");\n}\n}\n\n)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6b63\u5f0f\u5f00\u53d1 \u4e00\uff1a\u6570\u636e\u5e93\u8bbe\u8ba1\u3001 \u9996\u5148\u521b\u5efa\u7b80\u5355\u7684\u7528\u6237\u8868\uff08easyuser\uff09\uff1a \u7528\u6237\u8868\u7684\u5b57\u6bb5\u6709\uff1a id,\u81ea\u589e\uff0c\u4e3b\u952e u [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1419","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1419","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/comments?post=1419"}],"version-history":[{"count":6,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1419\/revisions"}],"predecessor-version":[{"id":1440,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/posts\/1419\/revisions\/1440"}],"wp:attachment":[{"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/media?parent=1419"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/categories?post=1419"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/note.ui11.cc\/index.php\/wp-json\/wp\/v2\/tags?post=1419"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}