pc端增加工作台切换页,新增生产环境oss地址
This commit is contained in:
parent
1a1c5f6cbb
commit
2e62f3fc61
@ -5,15 +5,16 @@ let BASE_URL = '/pixelApi';
|
||||
// #endif
|
||||
// #ifdef APP-PLUS ||MP
|
||||
let BASE_URL = 'http://8.138.171.103/pixelApi';// 测试环境
|
||||
// let BASE_URL = 'http://www.ylemai.cn/pixelApi';// 正式环境
|
||||
// let BASE_URL = 'https://www.ylemai.cn/pixelApi';// 正式环境
|
||||
// #endif
|
||||
|
||||
let IP = 'http://8.138.171.103/';// 测试环境
|
||||
// let IP = 'http://www.ylemai.cn/';// 正式环境
|
||||
// let IP = 'https://www.ylemai.cn/';// 正式环境
|
||||
let FILE_URL = IP+'static/';
|
||||
// 阿里OSS地址
|
||||
let ALIOSS_URL = 'http://guojunjie.oss-cn-hangzhou.aliyuncs.com';
|
||||
let ANOTHER_ALIOSS_URL = 'http://pixel-ai-file-test.oss-cn-guangzhou.aliyuncs.com';
|
||||
let OTHER_ALIOSS_URL = 'http://pixel-ai-file-test.oss-cn-guangzhou.aliyuncs.com';// 测试环境
|
||||
let ANOTHER_ALIOSS_URL = 'http://pixel-ai-file.oss-cn-guangzhou.aliyuncs.com';// 正式环境
|
||||
let ALIOSS_ASYNC_URL = "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com";// 异步url
|
||||
// 火山引擎ai接口地址
|
||||
let AI_URL = 'https://visual.volcengineapi.com';
|
||||
@ -24,7 +25,8 @@ const configService = {
|
||||
fileUrl: FILE_URL,
|
||||
aiUrl: AI_URL,
|
||||
aliUrl: ALIOSS_URL,
|
||||
otherAliUrl: ANOTHER_ALIOSS_URL,
|
||||
otherAliUrl: OTHER_ALIOSS_URL,
|
||||
anotherAliUrl: ANOTHER_ALIOSS_URL,
|
||||
aliAsyncUrl: ALIOSS_ASYNC_URL,
|
||||
};
|
||||
|
||||
|
@ -47,6 +47,7 @@ const ossUpload = async(vm,filePath,success) => {
|
||||
// #ifdef H5
|
||||
clientPath = res.data.replace(configService.aliUrl, "/ossUpload");
|
||||
clientPath = clientPath.replace(configService.otherAliUrl, "/otherOssUpload");
|
||||
clientPath = clientPath.replace(configService.anotherAliUrl, "/anotherOssUpload");
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
clientPath = res.data;
|
||||
|
@ -24,7 +24,10 @@ const install = (vm) => {
|
||||
// H5路由拦截,用于拦截用户地址栏输入地址
|
||||
const token = vm.$store.state.vuex_token;
|
||||
let locationUrl = window.location.href.split("/#")[1];
|
||||
if(needLogin.includes(locationUrl)&&!token){
|
||||
// 参数下标——地址?下标
|
||||
let quteIndex = locationUrl?.indexOf('?');
|
||||
let quteUrl = locationUrl.substring(0,(!quteIndex||quteIndex===-1) ? locationUrl.length : quteIndex);
|
||||
if(needLogin.includes(quteUrl)&&!token){
|
||||
uni.showToast({
|
||||
title: '该页面需要登录才能访问,请先登录',
|
||||
icon: 'none'
|
||||
@ -32,7 +35,7 @@ const install = (vm) => {
|
||||
uni.navigateTo({
|
||||
url: "/pages/mobile_web/my/child_pages/login?nextUrl="+locationUrl
|
||||
});
|
||||
} else if(!filterRoute.includes(locationUrl)&&locationUrl!=='/'&&vm.$store.state.current_platform&&
|
||||
} else if(quteUrl!=='/'&&!filterRoute.includes(quteUrl)&&vm.$store.state.current_platform&&
|
||||
locationUrl.indexOf(vm.$store.state.current_platform)==-1){
|
||||
uni.navigateTo({
|
||||
url: `/pages/${vm.$store.state.current_platform}/index/index`,
|
||||
@ -66,7 +69,7 @@ const install = (vm) => {
|
||||
return false;
|
||||
}
|
||||
// #ifndef APP
|
||||
else if(!filterRoute.includes(url)&&url.indexOf(vm.$store.state.current_platform)==-1){
|
||||
else if(!filterRoute.includes(url)&&url.indexOf(vm.$store.state.current_platform)===-1){
|
||||
uni.showToast({
|
||||
title: '该设备端无法访问对应页面!',
|
||||
icon: 'none'
|
||||
|
@ -136,7 +136,7 @@
|
||||
"proxy" : {
|
||||
"/pixelApi" : {
|
||||
"target" : "http://8.138.171.103/pixelApi", // 测试环境
|
||||
// "target" : "http://www.ylemai.cn/pixelApi",// 正式环境
|
||||
// "target" : "https://www.ylemai.cn/pixelApi",// 正式环境
|
||||
"changeOrigin" : true,
|
||||
"secure" : true,
|
||||
"ws" : false,
|
||||
@ -146,21 +146,21 @@
|
||||
},
|
||||
"/upload" : {
|
||||
"target" : "http://8.138.171.103", // 测试环境
|
||||
// "target" : "http://www.ylemai.cn",// 正式环境
|
||||
// "target" : "https://www.ylemai.cn",// 正式环境
|
||||
"changeOrigin" : true,
|
||||
"secure" : true,
|
||||
"ws" : false
|
||||
},
|
||||
"/static" : {
|
||||
"target" : "http://8.138.171.103", // 测试环境
|
||||
// "target" : "http://www.ylemai.cn",// 正式环境
|
||||
// "target" : "https://www.ylemai.cn",// 正式环境
|
||||
"changeOrigin" : true,
|
||||
"secure" : true,
|
||||
"ws" : false
|
||||
},
|
||||
"/aiupload" : {
|
||||
"target" : "http://8.138.171.103/upload", // 测试环境
|
||||
// "target" : "http://www.ylemai.cn/upload",// 正式环境
|
||||
// "target" : "https://www.ylemai.cn/upload",// 正式环境
|
||||
"changeOrigin" : true,
|
||||
"secure" : true,
|
||||
"ws" : false,
|
||||
@ -187,6 +187,15 @@
|
||||
"^/otherOssUpload/" : ""
|
||||
}
|
||||
},
|
||||
"/anotherOssUpload" : {
|
||||
"target" : "http://pixel-ai-file.oss-cn-guangzhou.aliyuncs.com",
|
||||
"changeOrigin" : true,
|
||||
"secure" : true,
|
||||
"ws" : false,
|
||||
"pathRewrite" : {
|
||||
"^/anotherOssUpload/" : ""
|
||||
}
|
||||
},
|
||||
"/asyncOssUpload" : {
|
||||
"target" : "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com",
|
||||
"changeOrigin" : true,
|
||||
|
@ -218,7 +218,8 @@ export default {
|
||||
getWorkPath(path){
|
||||
if(!path) return;
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
},
|
||||
// 获取应用服务列表
|
||||
async getServices(){
|
||||
|
@ -151,7 +151,8 @@
|
||||
getImagePath(path){
|
||||
if(!path) return;
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
},
|
||||
// 返回
|
||||
back(){
|
||||
|
@ -253,7 +253,8 @@ export default {
|
||||
// 图片格式化
|
||||
getPhotoPath(path){
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
},
|
||||
// 跳转专栏
|
||||
navigateTo(id){
|
||||
|
@ -221,7 +221,8 @@ export default {
|
||||
getImagePath(path){
|
||||
if(!path) return;
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
|
||||
},
|
||||
// 切换选项
|
||||
changeSelect(index){
|
||||
|
@ -205,7 +205,8 @@ export default {
|
||||
// 获取图片路径
|
||||
getImagePath(path){
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
},
|
||||
// 判断模特是否选中
|
||||
mannequinJudge(index){
|
||||
|
@ -205,6 +205,7 @@ export default {
|
||||
ip: configService.ip,
|
||||
aliIp: configService.aliUrl,
|
||||
otherAliIp: configService.otherAliUrl,
|
||||
anotherAliIp: configService.anotherAliUrl,
|
||||
aliAsyncIp: configService.aliAsyncUrl,
|
||||
myFileUrl: configService.fileUrl + 'pixel/my/',
|
||||
fileUrl: configService.fileUrl + 'pixel/workshops/',
|
||||
@ -519,7 +520,8 @@ export default {
|
||||
getResultImagePath(path){
|
||||
if(!path) return;
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.ip+path);
|
||||
},
|
||||
// 轮询
|
||||
async asyncPoll(id) {
|
||||
@ -702,6 +704,7 @@ export default {
|
||||
// #ifdef H5
|
||||
let downloadUrl = await that.resultFile.replace(that.aliIp, "/ossUpload");
|
||||
downloadUrl = await downloadUrl.replace(that.otherAliIp, "/otherOssUpload");
|
||||
downloadUrl = await downloadUrl.replace(that.anotherAliIp, "/anotherOssUpload");
|
||||
// #endif
|
||||
// #ifndef H5
|
||||
let downloadUrl = that.resultFile;
|
||||
|
@ -78,6 +78,7 @@ export default {
|
||||
fileUrl: configService.fileUrl + 'pixel/',
|
||||
aliIp: configService.aliUrl,
|
||||
otherAliIp: configService.otherAliUrl,
|
||||
anotherAliIp: configService.anotherAliUrl,
|
||||
// 选择黑星图片
|
||||
blackStar: 'work/black-star.png',
|
||||
// 魔术棒
|
||||
@ -170,7 +171,8 @@ export default {
|
||||
getWorkPath(path){
|
||||
if(!path) return;
|
||||
let index = path?.indexOf('?');
|
||||
return path?.includes('://') ? path.substring(0,(!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
let judge = path?.includes(configService.anotherAliUrl);
|
||||
return path?.includes('://') ? path.substring(0,(judge||!index||index===-1) ? path.length : index) : encodeURI(this.staticIp+path);
|
||||
},
|
||||
// 轮播图跳转
|
||||
linkTo(url){
|
||||
@ -208,7 +210,7 @@ export default {
|
||||
// 下载地址
|
||||
// let downloadUrl = await path.replace(that.aliIp, "/ossUpload");
|
||||
let downloadUrl = path;
|
||||
if(path.includes(that.aliIp)||path.includes(that.otherAliIp)){window.open(downloadUrl);item.loading = false;}
|
||||
if(path.includes(that.aliIp)||path.includes(that.otherAliIp)||path.includes(that.anotherAliIp)){window.open(downloadUrl);item.loading = false;}
|
||||
else
|
||||
uni.request({
|
||||
url: encodeURI(downloadUrl),
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view class="web-header">
|
||||
<view class="header-left">
|
||||
<image class="header-logo" :src="homeFileUrl+logo"></image>
|
||||
<view class="header-function" v-for="(item,index) in functionList"
|
||||
<view class="header-function" v-for="(item,index) in functionList" @click="changePage(index)"
|
||||
:key="index" :class="judgeSelect(item.path)?'function-select':''">
|
||||
{{ item.name }}
|
||||
</view>
|
||||
@ -54,6 +54,10 @@ export default {
|
||||
isLogin: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
currentPage: {
|
||||
type: String,
|
||||
default: 'home'
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@ -71,14 +75,13 @@ export default {
|
||||
functionList:[
|
||||
{
|
||||
name: '首页',
|
||||
path: '/pages/pc_web/index/index'
|
||||
path: 'home'
|
||||
},
|
||||
{
|
||||
name: '工作台',
|
||||
path: ''
|
||||
path: 'workshops'
|
||||
},
|
||||
],
|
||||
routePath: this.$route.path,// 当前路由
|
||||
// 头像
|
||||
avatar: 'avatar.png',
|
||||
// 默认登录头像
|
||||
@ -128,7 +131,7 @@ export default {
|
||||
methods:{
|
||||
// 判断当前显示项
|
||||
judgeSelect(path){
|
||||
return this.routePath == path;
|
||||
return this.currentPage === path;
|
||||
},
|
||||
// 初始化
|
||||
init(){
|
||||
@ -160,6 +163,10 @@ export default {
|
||||
})
|
||||
} else if(path) uni.navigateTo({url: path});
|
||||
},
|
||||
// 换页
|
||||
changePage(index){
|
||||
this.$emit('changePlat',index);
|
||||
},
|
||||
// 登录
|
||||
login(userMessage){
|
||||
this.userMessage = userMessage;
|
||||
|
@ -40,7 +40,7 @@
|
||||
</el-form>
|
||||
<view class="ldr-agreement">
|
||||
<u-checkbox class="ldr-checkbox" active-color="#8fca80" v-model="isAgreed"></u-checkbox>
|
||||
我已阅读并同意<text>用户服务协议</text>、<text>隐私权政策</text>
|
||||
我已阅读并同意<text @click="toAgreement('用户协议')">用户服务协议</text>、<text @click="toAgreement('隐私协议')">隐私权政策</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -214,6 +214,10 @@ export default {
|
||||
finally{
|
||||
this.dotLoading = false;
|
||||
}
|
||||
},
|
||||
// 查看协议
|
||||
toAgreement(type = ''){
|
||||
if(type) uni.navigateTo({ url: `/pages/index/rich-detail?name=${type}` });
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -2,7 +2,7 @@
|
||||
<view>
|
||||
<!-- <el-container class="pc-container">
|
||||
<view class="pc-header">
|
||||
<Header :isLogin="isLogin" />
|
||||
<Header :currentPage="refs[current]" :isLogin="isLogin" @changePlat="changePlat" />
|
||||
</view>
|
||||
<view style="width: 100%;height: 100rpx;"></view>
|
||||
<view class="pc-main">
|
||||
@ -27,11 +27,12 @@
|
||||
<script>
|
||||
import Header from './components/header.vue';
|
||||
import Home from '@/pages/pc_web/home/home.vue';
|
||||
import Workshops from '@/pages/pc_web/workshops/workshops.vue'
|
||||
import configService from '@/common/config.service.js';
|
||||
import { tools } from '@/utils/utils.js';
|
||||
export default {
|
||||
components:{
|
||||
Header, Home
|
||||
Header, Home, Workshops
|
||||
},
|
||||
data(){
|
||||
return{
|
||||
@ -41,7 +42,7 @@ export default {
|
||||
// 当前页码下标
|
||||
current: uni.getStorageSync('pc_current')||0,
|
||||
// refs组件列表
|
||||
refs: ['home'],
|
||||
refs: ['home','workshops'],
|
||||
// 加载
|
||||
loading: false,
|
||||
// 滚动顶部
|
||||
@ -64,6 +65,7 @@ export default {
|
||||
onLoad() {
|
||||
},
|
||||
methods:{
|
||||
// 复制地址
|
||||
copyUrl(){
|
||||
let that = this;
|
||||
tools.methods.uniCopy({
|
||||
@ -75,6 +77,11 @@ export default {
|
||||
that.$refs.uToast.show({type: 'error', title: result});
|
||||
}
|
||||
});
|
||||
},
|
||||
// 切换主体
|
||||
changePlat(current){
|
||||
this.current = current;
|
||||
uni.setStorageSync('pc_current', current);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user