Refactor(分享):分享标题、页面路径、图片通过接口获取
This commit is contained in:
@@ -222,3 +222,8 @@ export function getAiSystemInfoSetting() {
|
||||
export function getAiSystemInfoTopic() {
|
||||
return request.get('/ai/systemTopic', {}, { login: false })
|
||||
}
|
||||
|
||||
// 获取通用分享配置
|
||||
export function getWeixinShareConfig() {
|
||||
return request.get('/weixinShareConfig', {}, { login: false })
|
||||
}
|
||||
|
||||
+10
-4
@@ -1,3 +1,4 @@
|
||||
import { getWeixinShareConfig } from '@/api/public'
|
||||
export default{
|
||||
data(){
|
||||
return {
|
||||
@@ -17,10 +18,13 @@ export default{
|
||||
isPrivateMessage: false,
|
||||
withShareTicket: false
|
||||
})
|
||||
return {
|
||||
title: this.share.title,
|
||||
path: this.share.path,
|
||||
imageUrl: this.share.imageUrl,
|
||||
return new Promise(async (resolve, reject) => {
|
||||
const { success, data } = await getWeixinShareConfig()
|
||||
if (success) {
|
||||
resolve({
|
||||
title: data.title || this.share.title,
|
||||
path: data.url || this.share.path,
|
||||
imageUrl: data.image || this.share.imageUrl,
|
||||
desc: this.share.desc,
|
||||
content: this.share.content,
|
||||
success(res){
|
||||
@@ -34,6 +38,8 @@ export default{
|
||||
icon:'none'
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user