抖音小程序发布平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 
 

33 righe
870 B

  1. import Util from "../../core/tool/commonUtil.js";
  2. function AuthHOC(Component){
  3. return {
  4. mounted (){
  5. },
  6. props:Component.props,
  7. render(h){
  8. let uname = Util.cookie.getCookie("uname");
  9. if(!uname){
  10. this.$router.push({path:"/login"});
  11. return h();
  12. }
  13. const slots = Object.keys(this.$slots);
  14. slots.reduce((arr, key) => arr.concat(this.$slots[key]), [])
  15. .map(vnode => {
  16. vnode.context = this._self
  17. return vnode
  18. })
  19. return h(Component,{
  20. on: this.$listeners,
  21. props: this.$props,
  22. scopedSlots: this.$scopedSlots,
  23. attrs: this.$attrs
  24. },slots)
  25. }
  26. }
  27. }
  28. export default AuthHOC