修改优惠券的编辑功能, 增加viewport的meta
This commit is contained in:
parent
50130eae38
commit
268eb1d959
@ -2,6 +2,7 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
export interface IRewardData {
|
||||
_id?: string
|
||||
id?: number
|
||||
rank?: number
|
||||
rankEnd?: number
|
||||
|
@ -247,6 +247,10 @@ export default class extends Vue {
|
||||
try {
|
||||
await this.$refs.postForm.validate()
|
||||
this.loading = true
|
||||
if (this.postForm.content.search(/meta name=.+?viewport/) === -1) {
|
||||
const metaStr = '\n<meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />\n'
|
||||
this.postForm.content = this.postForm.content.replace('<head>', `<head>${metaStr}`)
|
||||
}
|
||||
const { data } = await saveCoupon(this.postForm)
|
||||
this.postForm = data
|
||||
if (this.postForm.validBegin && this.postForm.validEnd) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user