修正ProfileArtis.is对数字格式位置的兼容问题

This commit is contained in:
yoimiya-kokomi 2022-09-22 05:26:19 +08:00
parent 712281468a
commit 503c046e19
2 changed files with 3 additions and 1 deletions

View File

@ -195,6 +195,8 @@ let Data = {
if (lodash.isString(arr)) { if (lodash.isString(arr)) {
arr = arr.replace(/\s*(;||、|)\s*/, ',') arr = arr.replace(/\s*(;||、|)\s*/, ',')
arr = arr.split(',') arr = arr.split(',')
} else if (typeof (arr) === 'number') {
arr = [arr.toString()]
} }
lodash.forEach(arr, (str, idx) => { lodash.forEach(arr, (str, idx) => {
if (!lodash.isUndefined(str)) { if (!lodash.isUndefined(str)) {

View File

@ -119,7 +119,7 @@ export default class ProfileArtis extends Base {
isAttr (attr, pos = '3,4,5') { isAttr (attr, pos = '3,4,5') {
let mainAttr = this.mainAttr() let mainAttr = this.mainAttr()
let check = true let check = true
Data.eachStr(pos, (p) => { Data.eachStr(pos.toString(), (p) => {
if (!attr.split(',').includes(mainAttr[p])) { if (!attr.split(',').includes(mainAttr[p])) {
check = false check = false
return false return false