Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
jz_Travel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengke
jz_Travel
Commits
bb2971ce
Commit
bb2971ce
authored
Mar 04, 2025
by
罗超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增配置
parent
b19165c0
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
35 deletions
+80
-35
index.vue
components/auth/index.vue
+9
-3
manifest.json
manifest.json
+1
-1
package.json
package.json
+3
-3
api.js
plugin/api.js
+18
-20
vue.config.js
vue.config.js
+49
-0
yarn.lock
yarn.lock
+0
-8
No files found.
components/auth/index.vue
View file @
bb2971ce
...
...
@@ -119,14 +119,15 @@
//这里请求接口
var
OpenId
=
""
;
that
.
request2
({
url
:
"/api/mall/GetWeChatOpenId"
,
url
:
"/api/mall/Get
HP
WeChatOpenId"
,
data
:
{
Code
:
obj
.
code
,
},
},
(
res
)
=>
{
if
(
res
.
resultCode
==
1
)
{
obj
.
OpenId
=
res
.
data
;
obj
.
OpenId
=
res
.
data
.
openId
;
obj
.
Unoinid
=
res
.
data
.
unionid
that
.
getLogin
(
obj
);
}
}
...
...
@@ -159,9 +160,14 @@
UserPageType
:
Up
,
CounponPassword
:
CounponPassword
,
KeyWord
:
KeyWord
,
Unoinid
:
obj
.
Unoinid
}
let
url
=
"/api/AppletLogin/Login"
// #ifdef MP-DI
url
=
"/api/AppletLogin/HPSLLogin"
// #endif
that
.
request2
({
url
:
"/api/AppletLogin/Login"
,
url
,
data
:
loginMsg
,
},
(
res
)
=>
{
...
...
manifest.json
View file @
bb2971ce
...
...
@@ -69,7 +69,7 @@
"quickapp"
:
{},
/*
小程序特有相关
*/
"mp-weixin"
:
{
"appid"
:
"wxcf0727a7c78b501e
"
,
"appid"
:
"wx5564525562e92ddb
"
,
"setting"
:
{
"urlCheck"
:
true
,
"minified"
:
false
...
...
package.json
View file @
bb2971ce
...
...
@@ -4,10 +4,10 @@
},
"uni-app"
:
{
"scripts"
:
{
"mp-direct"
:
{
"mp-direct"
:
{
"title"
:
"直客微信小程序"
,
"env"
:
{
"UNI_PLATFORM"
:
"mp-weixin"
"UNI_PLATFORM"
:
"mp-weixin"
},
"define"
:
{
"MP-DI"
:
true
...
...
@@ -16,7 +16,7 @@
"mp-agent"
:
{
"title"
:
"同业微信小程序"
,
"env"
:
{
"UNI_PLATFORM"
:
"mp-weixin"
"UNI_PLATFORM"
:
"mp-weixin"
},
"define"
:
{
"MP-AG"
:
true
...
...
plugin/api.js
View file @
bb2971ce
...
...
@@ -23,9 +23,9 @@ export default {
install
(
Vue
,
options
)
{
Vue
.
prototype
.
host
=
"https://wx.weibaoge.cn/web/index.php?_mall_id=1285"
// Vue.prototype.host2 = "http://192.168.5.46:8300
"
Vue
.
prototype
.
host2
=
"http://192.168.5.56:8033
"
//Vue.prototype.host3 = "http://192.168.5.46:8501"
Vue
.
prototype
.
host2
=
"https://erpmallapi.oytour.com"
//
Vue.prototype.host2 = "https://erpmallapi.oytour.com"
Vue
.
prototype
.
host3
=
"https://reborn.oytour.com"
Vue
.
prototype
.
request
=
function
(
param
,
success
,
failed
)
{
...
...
@@ -317,24 +317,22 @@ export default {
Vue
.
prototype
.
GetMiniAppId
=
function
()
{
let
appObj
=
{};
let
appType
=
2
;
switch
(
appType
)
{
case
1
:
//旅小友-支付宝
appObj
=
{
AppId
:
'2021002181604459'
,
TenantId
:
12
,
MallBaseId
:
2
,
};
break
;
case
2
:
//旅小友-微信
//wx5564525562e92ddb
//wxcf0727a7c78b501e
appObj
=
{
AppId
:
'wxcf0727a7c78b501e'
,
TenantId
:
12
,
MallBaseId
:
2
,
};
break
;
}
// #ifdef MP-DI
appObj
=
{
AppId
:
'wx5564525562e92ddb'
,
TenantId
:
29
,
MallBaseId
:
19
,
};
// #endif
// #ifdef MP-AG
appObj
=
{
AppId
:
'wxcf0727a7c78b501e'
,
TenantId
:
12
,
MallBaseId
:
2
,
};
// #endif
return
appObj
;
}
//获取OpenId
...
...
vue.config.js
0 → 100644
View file @
bb2971ce
// 导入fs模块
const
fs
=
require
(
'fs'
)
const
manifestPath
=
`
${
__dirname
}
/manifest.json`
;
let
Manifest
=
fs
.
readFileSync
(
manifestPath
,
{
encoding
:
'utf-8'
})
const
ENV_CONFIG
=
{
'mp-direct'
:{
'appid'
:
"wx5564525562e92ddb"
,
},
'mp-agent'
:{
'appid'
:
"wxcf0727a7c78b501e"
}
}
function
replaceManifest
(
path
,
value
)
{
const
arr
=
path
.
split
(
'.'
)
const
len
=
arr
.
length
const
lastItem
=
arr
[
len
-
1
]
let
i
=
0
let
ManifestArr
=
Manifest
.
split
(
/
\n
/
)
for
(
let
index
=
0
;
index
<
ManifestArr
.
length
;
index
++
)
{
const
item
=
ManifestArr
[
index
]
if
(
new
RegExp
(
`"
${
arr
[
i
]}
"`
).
test
(
item
))
++
i
if
(
i
===
len
)
{
const
hasComma
=
/,/
.
test
(
item
)
ManifestArr
[
index
]
=
item
.
replace
(
new
RegExp
(
`"
${
lastItem
}
"[\\s\\S]*:[\\s\\S]*`
),
`"
${
lastItem
}
":
${
value
}${
hasComma
?
','
:
''
}
`
)
break
}
}
Manifest
=
ManifestArr
.
join
(
'
\
n'
)
}
// 读取环境变量内容
const
appid
=
ENV_CONFIG
[
process
.
env
.
UNI_SCRIPT
].
appid
console
.
log
(
'新的APPID是:'
,
appid
,
ENV_CONFIG
)
if
(
appid
)
{
replaceManifest
(
'mp-weixin.appid'
,
`"
${
appid
}
"`
)
}
fs
.
writeFileSync
(
manifestPath
,
Manifest
,
{
flag
:
'w'
})
\ No newline at end of file
yarn.lock
deleted
100644 → 0
View file @
b19165c0
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
js-md5@^0.7.3:
version "0.7.3"
resolved "https://registry.npmmirror.com/js-md5/-/js-md5-0.7.3.tgz"
integrity sha512-ZC41vPSTLKGwIRjqDh8DfXoCrdQIyBgspJVPXHBGu4nZlAEvG3nf+jO9avM9RmLiGakg7vz974ms99nEV0tmTQ==
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment