plugin.ts 980 B

12345678910111213141516171819202122232425
  1. /*
  2. * @Author: code4eat awesomedema@gmail.com
  3. * @Date: 2023-12-11 17:09:15
  4. * @LastEditors: code4eat awesomedema@gmail.com
  5. * @LastEditTime: 2023-12-12 15:10:16
  6. * @FilePath: /kcim-frontend-template/plugin.ts
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. */
  9. import { IApi } from "@umijs/max";
  10. const { REACT_APP_ENV } = process.env;
  11. export default (api: IApi) => {
  12. api.modifyHTML(($:any) => {
  13. if(REACT_APP_ENV == 'dev'){
  14. $('head').append([
  15. `<link rel="icon" href="/favicon.ico" type="image/x-icon">`,
  16. ]);
  17. $('body').prepend([
  18. `<div style="height:48px;background: #3377FF;position: relative;z-index: 99;line-height: 48px;color: white;padding: 0 16px;font-size: 20px;">Header<span style="font-size:14px;padding-left:20px;color:red; ">just display in dev env</span></div>`,
  19. ]);
  20. }
  21. return $;
  22. });
  23. };