Commit b2d47cdf authored by Allen Bai's avatar Allen Bai

feat: 添加测试请求

parent e977b180
...@@ -37,10 +37,15 @@ function request(option) { ...@@ -37,10 +37,15 @@ function request(option) {
xhr.send(option.method === 'POST' ? option.data : null) xhr.send(option.method === 'POST' ? option.data : null)
} }
function getRequestUrl() {
// 如果有测试链接 就用测试的链接
return window.localStorage.getItem('__ipc_test_url__') || 'http://activity.tuiatest.cn/land/getIcpInfo'
}
function getIPCByDomain(domain: string) { function getIPCByDomain(domain: string) {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
request({ request({
url: `http://activity.tuiatest.cn/land/getIcpInfo?domain=${encodeURIComponent(domain)}`, url: `${getRequestUrl()}?domain=${encodeURIComponent(domain)}`,
method: 'GET', method: 'GET',
success(res) { success(res) {
console.log('当前域名的IPC备案为', res) console.log('当前域名的IPC备案为', res)
......
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