Commit 9b243cbf authored by 劳琪峰's avatar 劳琪峰

chore: 活动页>内置url改用请求的url的origin

parent 4d5d6375
...@@ -15,12 +15,12 @@ const { ...@@ -15,12 +15,12 @@ const {
// request.js // request.js
// 通常可以吧 baseUrl 单独放在一个 js 文件了 // 通常可以吧 baseUrl 单独放在一个 js 文件了
// const baseUrl = "http://172.16.230.108:7777/pmall"; // export const baseUrl = "http://172.16.230.108:7777/pmall";
// const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境 // export const baseUrl = "https://momclub-uat.feihe.com/pmall";//测试环境
// const baseUrl = "https://momclub-test.feihe.com/pmall";//测试环境2 export const baseUrl = "https://momclub-test.feihe.com/pmall";//测试环境2
const baseUrl = "https://momclub.feihe.com/pmall";//生产环境 // export const baseUrl = "https://momclub.feihe.com/pmall";//生产环境
// const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock // export const baseUrl = "https://docs.dui88.com/mock/1956/api";//mock
// const baseUrl = "https://feihe.m.duibatest.com.cn/pmall" // export const baseUrl = "https://feihe.m.duibatest.com.cn/pmall"
const request = (options = {}) => { const request = (options = {}) => {
// 在这里可以对请求头进行一些设置 // 在这里可以对请求头进行一些设置
......
...@@ -3,11 +3,12 @@ ...@@ -3,11 +3,12 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import {ref, watch, nextTick} from "vue"; import {ref, watch, nextTick, computed} from "vue";
import {onLoad, onShow, onShareAppMessage, onShareTimeline} from "@dcloudio/uni-app"; import {onLoad, onShow, onShareAppMessage, onShareTimeline} from "@dcloudio/uni-app";
import {useGlobalStore} from "../../stores/global"; import {useGlobalStore} from "@/stores/global";
import {useUserStore} from "../../stores/user"; import {useUserStore} from "@/stores/user";
import {jump, JumpType} from "../../utils"; import {jump, JumpType} from "@/utils";
import {baseUrl as requestBaseUrl} from "@/api/request";
const userStore = useUserStore(); const userStore = useUserStore();
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
...@@ -21,14 +22,15 @@ const src = ref("") ...@@ -21,14 +22,15 @@ const src = ref("")
const registered = ref(undefined) const registered = ref(undefined)
const urlMap = { const urlMap = {
//'main': 'http://192.168.0.5:8001/#/page', 'main': '/h5/#/page',
'main': 'https://momclub.feihe.com/h5/#/page',
//'main': 'https://momclub-test.feihe.com/h5/#/page',
//'main': 'https://momclub-uat.feihe.com/h5/#/page',
}; };
const shareData = ref(null) const shareData = ref(null)
const baseUrl = computed(() => {
return requestBaseUrl.substring(0, requestBaseUrl.indexOf('/', 'http'.length + 4))
})
const handleBack = () => { const handleBack = () => {
try { try {
uni.navigateBack({ uni.navigateBack({
...@@ -51,7 +53,7 @@ const handleBack = () => { ...@@ -51,7 +53,7 @@ const handleBack = () => {
async function ensureAutoLogin() { async function ensureAutoLogin() {
//debugger //debugger
//if (!globalStore.cuk) { //if (!globalStore.cuk) {
await userStore.normalAutoLogin() await userStore.normalAutoLogin()
//} //}
} }
...@@ -108,7 +110,7 @@ function initOk() { ...@@ -108,7 +110,7 @@ function initOk() {
if (options.type) { if (options.type) {
const type = options.type; const type = options.type;
url = urlMap[type]; url = baseUrl.value + urlMap[type];
} else if (options.url) { } else if (options.url) {
url = decodeURIComponent(options.url) url = decodeURIComponent(options.url)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment