Abstract: Let Fr be an extension of a finite field Fq with r=q<sup>m. Let each gi be of order ni in Fr<sup>∗ and gcd(ni,nj)=1 for 1≤i=j≤u. We define a cyclic code over Fq by C(q,m,n1,n2,...,nu)=c(a1,a2,...,au):a1,a2,...,au∈Fr, where c(a1,a2,...,au)=(Tr<em>r/q(∑</em>i=1<sup>uaigi<sup>0),</sup></sup>...,Tr<em>r/q(∑</em>i=1<sup>uaigi<sup>n−1)) and n=n1n2...nu. In this paper, we present a method to compute the weights of C(q,m,n1,n2,...,nu). Further, we determine the weight distributions of the cyclic codes C(q,m,n1,n2) and C(q,m,n1,n2,1).