pc端增加工作台切换页,新增生产环境oss地址

This commit is contained in:
Double-_-Z 2025-01-26 16:04:45 +08:00
parent 1a1c5f6cbb
commit 2e62f3fc61
14 changed files with 71 additions and 28 deletions

View File

@ -5,15 +5,16 @@ let BASE_URL = '/pixelApi';
// #endif // #endif
// #ifdef APP-PLUS ||MP // #ifdef APP-PLUS ||MP
let BASE_URL = 'http://8.138.171.103/pixelApi';// 测试环境 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 // #endif
let IP = 'http://8.138.171.103/';// 测试环境 let IP = 'http://8.138.171.103/';// 测试环境
// let IP = 'http://www.ylemai.cn/';// 正式环境 // let IP = 'https://www.ylemai.cn/';// 正式环境
let FILE_URL = IP+'static/'; let FILE_URL = IP+'static/';
// 阿里OSS地址 // 阿里OSS地址
let ALIOSS_URL = 'http://guojunjie.oss-cn-hangzhou.aliyuncs.com'; 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 let ALIOSS_ASYNC_URL = "http://dashscope-result-bj.oss-cn-beijing.aliyuncs.com";// 异步url
// 火山引擎ai接口地址 // 火山引擎ai接口地址
let AI_URL = 'https://visual.volcengineapi.com'; let AI_URL = 'https://visual.volcengineapi.com';
@ -24,7 +25,8 @@ const configService = {
fileUrl: FILE_URL, fileUrl: FILE_URL,
aiUrl: AI_URL, aiUrl: AI_URL,
aliUrl: ALIOSS_URL, aliUrl: ALIOSS_URL,
otherAliUrl: ANOTHER_ALIOSS_URL, otherAliUrl: OTHER_ALIOSS_URL,
anotherAliUrl: ANOTHER_ALIOSS_URL,
aliAsyncUrl: ALIOSS_ASYNC_URL, aliAsyncUrl: ALIOSS_ASYNC_URL,
}; };

View File

@ -47,6 +47,7 @@ const ossUpload = async(vm,filePath,success) => {
// #ifdef H5 // #ifdef H5
clientPath = res.data.replace(configService.aliUrl, "/ossUpload"); clientPath = res.data.replace(configService.aliUrl, "/ossUpload");
clientPath = clientPath.replace(configService.otherAliUrl, "/otherOssUpload"); clientPath = clientPath.replace(configService.otherAliUrl, "/otherOssUpload");
clientPath = clientPath.replace(configService.anotherAliUrl, "/anotherOssUpload");
// #endif // #endif
// #ifndef H5 // #ifndef H5
clientPath = res.data; clientPath = res.data;

View File

@ -24,7 +24,10 @@ const install = (vm) => {
// H5路由拦截,用于拦截用户地址栏输入地址 // H5路由拦截,用于拦截用户地址栏输入地址
const token = vm.$store.state.vuex_token; const token = vm.$store.state.vuex_token;
let locationUrl = window.location.href.split("/#")[1]; 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({ uni.showToast({
title: '该页面需要登录才能访问,请先登录', title: '该页面需要登录才能访问,请先登录',
icon: 'none' icon: 'none'
@ -32,7 +35,7 @@ const install = (vm) => {
uni.navigateTo({ uni.navigateTo({
url: "/pages/mobile_web/my/child_pages/login?nextUrl="+locationUrl 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){ locationUrl.indexOf(vm.$store.state.current_platform)==-1){
uni.navigateTo({ uni.navigateTo({
url: `/pages/${vm.$store.state.current_platform}/index/index`, url: `/pages/${vm.$store.state.current_platform}/index/index`,
@ -66,7 +69,7 @@ const install = (vm) => {
return false; return false;
} }
// #ifndef APP // #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({ uni.showToast({
title: '该设备端无法访问对应页面!', title: '该设备端无法访问对应页面!',
icon: 'none' icon: 'none'

View File

@ -136,7 +136,7 @@
"proxy" : { "proxy" : {
"/pixelApi" : { "/pixelApi" : {
"target" : "http://8.138.171.103/pixelApi", // "target" : "http://8.138.171.103/pixelApi", //
// "target" : "http://www.ylemai.cn/pixelApi",// // "target" : "https://www.ylemai.cn/pixelApi",//
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,
"ws" : false, "ws" : false,
@ -146,21 +146,21 @@
}, },
"/upload" : { "/upload" : {
"target" : "http://8.138.171.103", // "target" : "http://8.138.171.103", //
// "target" : "http://www.ylemai.cn",// // "target" : "https://www.ylemai.cn",//
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,
"ws" : false "ws" : false
}, },
"/static" : { "/static" : {
"target" : "http://8.138.171.103", // "target" : "http://8.138.171.103", //
// "target" : "http://www.ylemai.cn",// // "target" : "https://www.ylemai.cn",//
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,
"ws" : false "ws" : false
}, },
"/aiupload" : { "/aiupload" : {
"target" : "http://8.138.171.103/upload", // "target" : "http://8.138.171.103/upload", //
// "target" : "http://www.ylemai.cn/upload",// // "target" : "https://www.ylemai.cn/upload",//
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,
"ws" : false, "ws" : false,
@ -187,6 +187,15 @@
"^/otherOssUpload/" : "" "^/otherOssUpload/" : ""
} }
}, },
"/anotherOssUpload" : {
"target" : "http://pixel-ai-file.oss-cn-guangzhou.aliyuncs.com",
"changeOrigin" : true,
"secure" : true,
"ws" : false,
"pathRewrite" : {
"^/anotherOssUpload/" : ""
}
},
"/asyncOssUpload" : { "/asyncOssUpload" : {
"target" : "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com", "target" : "https://dashscope-result-bj.oss-cn-beijing.aliyuncs.com",
"changeOrigin" : true, "changeOrigin" : true,

View File

@ -218,7 +218,8 @@ export default {
getWorkPath(path){ getWorkPath(path){
if(!path) return; if(!path) return;
let index = path?.indexOf('?'); 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(){ async getServices(){

View File

@ -151,7 +151,8 @@
getImagePath(path){ getImagePath(path){
if(!path) return; if(!path) return;
let index = path?.indexOf('?'); 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(){ back(){

View File

@ -253,7 +253,8 @@ export default {
// //
getPhotoPath(path){ getPhotoPath(path){
let index = path?.indexOf('?'); 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){ navigateTo(id){

View File

@ -221,7 +221,8 @@ export default {
getImagePath(path){ getImagePath(path){
if(!path) return; if(!path) return;
let index = path?.indexOf('?'); 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){ changeSelect(index){

View File

@ -205,7 +205,8 @@ export default {
// //
getImagePath(path){ getImagePath(path){
let index = path?.indexOf('?'); 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){ mannequinJudge(index){

View File

@ -205,6 +205,7 @@ export default {
ip: configService.ip, ip: configService.ip,
aliIp: configService.aliUrl, aliIp: configService.aliUrl,
otherAliIp: configService.otherAliUrl, otherAliIp: configService.otherAliUrl,
anotherAliIp: configService.anotherAliUrl,
aliAsyncIp: configService.aliAsyncUrl, aliAsyncIp: configService.aliAsyncUrl,
myFileUrl: configService.fileUrl + 'pixel/my/', myFileUrl: configService.fileUrl + 'pixel/my/',
fileUrl: configService.fileUrl + 'pixel/workshops/', fileUrl: configService.fileUrl + 'pixel/workshops/',
@ -519,7 +520,8 @@ export default {
getResultImagePath(path){ getResultImagePath(path){
if(!path) return; if(!path) return;
let index = path?.indexOf('?'); 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) { async asyncPoll(id) {
@ -702,6 +704,7 @@ export default {
// #ifdef H5 // #ifdef H5
let downloadUrl = await that.resultFile.replace(that.aliIp, "/ossUpload"); let downloadUrl = await that.resultFile.replace(that.aliIp, "/ossUpload");
downloadUrl = await downloadUrl.replace(that.otherAliIp, "/otherOssUpload"); downloadUrl = await downloadUrl.replace(that.otherAliIp, "/otherOssUpload");
downloadUrl = await downloadUrl.replace(that.anotherAliIp, "/anotherOssUpload");
// #endif // #endif
// #ifndef H5 // #ifndef H5
let downloadUrl = that.resultFile; let downloadUrl = that.resultFile;

View File

@ -78,6 +78,7 @@ export default {
fileUrl: configService.fileUrl + 'pixel/', fileUrl: configService.fileUrl + 'pixel/',
aliIp: configService.aliUrl, aliIp: configService.aliUrl,
otherAliIp: configService.otherAliUrl, otherAliIp: configService.otherAliUrl,
anotherAliIp: configService.anotherAliUrl,
// //
blackStar: 'work/black-star.png', blackStar: 'work/black-star.png',
// //
@ -170,7 +171,8 @@ export default {
getWorkPath(path){ getWorkPath(path){
if(!path) return; if(!path) return;
let index = path?.indexOf('?'); 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){ linkTo(url){
@ -208,7 +210,7 @@ export default {
// //
// let downloadUrl = await path.replace(that.aliIp, "/ossUpload"); // let downloadUrl = await path.replace(that.aliIp, "/ossUpload");
let downloadUrl = path; 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 else
uni.request({ uni.request({
url: encodeURI(downloadUrl), url: encodeURI(downloadUrl),

View File

@ -2,7 +2,7 @@
<view class="web-header"> <view class="web-header">
<view class="header-left"> <view class="header-left">
<image class="header-logo" :src="homeFileUrl+logo"></image> <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':''"> :key="index" :class="judgeSelect(item.path)?'function-select':''">
{{ item.name }} {{ item.name }}
</view> </view>
@ -54,6 +54,10 @@ export default {
isLogin: { isLogin: {
type: String, type: String,
default: '' default: ''
},
currentPage: {
type: String,
default: 'home'
} }
}, },
components: { components: {
@ -71,14 +75,13 @@ export default {
functionList:[ functionList:[
{ {
name: '首页', name: '首页',
path: '/pages/pc_web/index/index' path: 'home'
}, },
{ {
name: '工作台', name: '工作台',
path: '' path: 'workshops'
}, },
], ],
routePath: this.$route.path,//
// //
avatar: 'avatar.png', avatar: 'avatar.png',
// //
@ -128,7 +131,7 @@ export default {
methods:{ methods:{
// //
judgeSelect(path){ judgeSelect(path){
return this.routePath == path; return this.currentPage === path;
}, },
// //
init(){ init(){
@ -160,6 +163,10 @@ export default {
}) })
} else if(path) uni.navigateTo({url: path}); } else if(path) uni.navigateTo({url: path});
}, },
//
changePage(index){
this.$emit('changePlat',index);
},
// //
login(userMessage){ login(userMessage){
this.userMessage = userMessage; this.userMessage = userMessage;

View File

@ -40,7 +40,7 @@
</el-form> </el-form>
<view class="ldr-agreement"> <view class="ldr-agreement">
<u-checkbox class="ldr-checkbox" active-color="#8fca80" v-model="isAgreed"></u-checkbox> <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> </view>
</view> </view>
@ -214,6 +214,10 @@ export default {
finally{ finally{
this.dotLoading = false; this.dotLoading = false;
} }
},
//
toAgreement(type = ''){
if(type) uni.navigateTo({ url: `/pages/index/rich-detail?name=${type}` });
} }
}, },
mounted() { mounted() {

View File

@ -2,7 +2,7 @@
<view> <view>
<!-- <el-container class="pc-container"> <!-- <el-container class="pc-container">
<view class="pc-header"> <view class="pc-header">
<Header :isLogin="isLogin" /> <Header :currentPage="refs[current]" :isLogin="isLogin" @changePlat="changePlat" />
</view> </view>
<view style="width: 100%;height: 100rpx;"></view> <view style="width: 100%;height: 100rpx;"></view>
<view class="pc-main"> <view class="pc-main">
@ -27,11 +27,12 @@
<script> <script>
import Header from './components/header.vue'; import Header from './components/header.vue';
import Home from '@/pages/pc_web/home/home.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 configService from '@/common/config.service.js';
import { tools } from '@/utils/utils.js'; import { tools } from '@/utils/utils.js';
export default { export default {
components:{ components:{
Header, Home Header, Home, Workshops
}, },
data(){ data(){
return{ return{
@ -41,7 +42,7 @@ export default {
// //
current: uni.getStorageSync('pc_current')||0, current: uni.getStorageSync('pc_current')||0,
// refs // refs
refs: ['home'], refs: ['home','workshops'],
// //
loading: false, loading: false,
// //
@ -64,6 +65,7 @@ export default {
onLoad() { onLoad() {
}, },
methods:{ methods:{
//
copyUrl(){ copyUrl(){
let that = this; let that = this;
tools.methods.uniCopy({ tools.methods.uniCopy({
@ -75,6 +77,11 @@ export default {
that.$refs.uToast.show({type: 'error', title: result}); that.$refs.uToast.show({type: 'error', title: result});
} }
}); });
},
//
changePlat(current){
this.current = current;
uni.setStorageSync('pc_current', current);
} }
} }
} }