Firstly,the natural pigment of lycium barbarum was extracted,and then the chitosan modified cotton fabric was directly dyed with lycium barbarum extract.The effects of bath pH value,temperature,time,concentration of sodium chloride and other factors on the dyeing effect and UV resistance were explored.Through the comprehensive evaluation of the color depth value Integ,color characteristic value and UPF value of the dyed fabric,the best dyeing process was obtained as follows:bath ratio of 1∶30,extraction mother liquor of 30 mL,pH value of 4,salt concentration of 0,baking at 110 ℃ for 4 minutes.At the same time,the salt-free dyeing is realized without adding salt in the dyeing process,which greatly reduces the burden of dye wastewater treatment.The dyed purple cotton fabric not only has good rubbing fastness,washing fastness and sun fastness,but also has excellent UV resistance.