提交 0a3e301b 编写于 作者: huangwensu's avatar huangwensu

修改token名称

上级 3db4b7cd
{
"presets": [
[
"@babel/preset-env",
{
"modules": false
}
]
]
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ var axios = _interopDefault(require('axios'));
// 时间处理
Date.prototype.format = function (fmt) {
// author: meizz
let o = {
var o = {
'M+': this.getMonth() + 1,
// 月份
'd+': this.getDate(),
......@@ -24,7 +24,7 @@ Date.prototype.format = function (fmt) {
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + '').substr(4 - RegExp.$1.length));
for (let k in o) {
for (var k in o) {
if (new RegExp('(' + k + ')').test(fmt)) {
fmt = fmt.replace(RegExp.$1, RegExp.$1.length == 1 ? o[k] : ('00' + o[k]).substr(('' + o[k]).length));
}
......@@ -33,19 +33,19 @@ Date.prototype.format = function (fmt) {
return fmt;
};
let axiosInstance = axios.create();
axiosInstance.interceptors.request.use(config => {
var axiosInstance = axios.create();
axiosInstance.interceptors.request.use(function (config) {
// if (config.withCredentials) {
// config.headers.token = getItem('token');
// }
return config;
});
axiosInstance.interceptors.response.use(response => {
let data = response.data == undefined ? response.request.responseText : response.data;
axiosInstance.interceptors.response.use(function (response) {
var data = response.data == undefined ? response.request.responseText : response.data;
return data;
});
function request(options) {
const axiosConfig = {
var axiosConfig = {
headers: {
'X-Requested-With': 'XMLHttpRequest',
'Content-Type': 'application/json;charset=UTF-8'
......@@ -56,10 +56,10 @@ function request(options) {
method: 'get'
};
options = Object.assign(axiosConfig, options);
return new Promise((resolve, reject) => {
axiosInstance(options).then(res => {
return new Promise(function (resolve, reject) {
axiosInstance(options).then(function (res) {
resolve(res);
}).catch(error => {
}).catch(function (error) {
reject(error);
});
});
......@@ -72,13 +72,24 @@ function request(options) {
* @return {[type]} 协议类型 2:云鹊医用户协议 3:云鹊医隐私协议
*/
const signAgreementApi = async data => {
return request({
method: 'post',
headers: {
token: data.token
},
url: `${data.baseUrl}/smartcontract/protocol/sign?type=${data.type}`
var signAgreementApi = function signAgreementApi(data) {
return regeneratorRuntime.async(function signAgreementApi$(_context) {
while (1) {
switch (_context.prev = _context.next) {
case 0:
return _context.abrupt("return", request({
method: 'post',
headers: {
token: data.token
},
url: "".concat(data.baseUrl, "/smartcontract/protocol/sign?type=").concat(data.type)
}));
case 1:
case "end":
return _context.stop();
}
}
});
};
......@@ -103,44 +114,37 @@ var script = {
default: false
}
},
data() {
data: function data() {
return {};
},
created() {},
created: function created() {},
methods: {
readAndAgree() {
const _this = this;
readAndAgree: function readAndAgree() {
var _this = this;
const data = {
var data = {
baseUrl: _this.baseUrl,
token: _this.agreementToken,
type: 3
};
signAgreementApi(data).then(res => {
signAgreementApi(data).then(function (res) {
if (res.code == '000000') {
_this.$emit('hasSignAgreement');
}
});
},
gotoAgreement() {
gotoAgreement: function gotoAgreement() {
//https://dev-scale.yunqueyi.com
window.location.href = `${this.agreementPageUrl}/loginAgreement?token=${this.agreementToken}&pageUrl=${window.location.href}`;
window.location.href = "".concat(this.agreementPageUrl, "/loginAgreement?agreementToken=").concat(this.agreementToken, "&pageUrl=").concat(window.location.href);
}
}
};
function styleInject(css, ref) {
if (ref === void 0) ref = {};
if ( ref === void 0 ) ref = {};
var insertAt = ref.insertAt;
if (!css || typeof document === 'undefined') {
return;
}
if (!css || typeof document === 'undefined') { return; }
var head = document.head || document.getElementsByTagName('head')[0];
var style = document.createElement('style');
......@@ -163,7 +167,7 @@ function styleInject(css, ref) {
}
}
var css = ".pica-h5-agreement-container[data-v-1c3d08a4] {\n width: 8rem;\n background: #fff;\n border-radius: 0.08rem;\n font-family: PingFangSC-Semibold;\n box-shadow: 0 0 0.13333rem #ededed;\n -webkit-user-select: none;\n user-select: none;\n}\n.pica-h5-agreement-container .agreement-title[data-v-1c3d08a4] {\n color: #333;\n font-size: 0.48rem;\n padding: 0.8rem 0 0.37333rem;\n text-align: center;\n}\n.pica-h5-agreement-container .agreement-content[data-v-1c3d08a4] {\n color: #676869;\n font-size: 0.37333rem;\n padding: 0 0.8rem 0.21333rem;\n line-height: 0.56rem;\n}\n.pica-h5-agreement-container .agreement-content span[data-v-1c3d08a4] {\n color: #449284;\n text-decoration: underline;\n}\n.pica-h5-agreement-container .agreement-btn[data-v-1c3d08a4] {\n color: #449284;\n font-size: 0.45333rem;\n text-align: center;\n padding: 0.32rem 0;\n border: 1PX solid #F0F1F2;\n}\n";
var css = ".pica-h5-agreement-container[data-v-430a9a0e] {\n width: 8rem;\n background: #fff;\n border-radius: 0.08rem;\n font-family: PingFangSC-Semibold;\n box-shadow: 0 0 0.13333rem #ededed;\n -webkit-user-select: none;\n user-select: none;\n}\n.pica-h5-agreement-container .agreement-title[data-v-430a9a0e] {\n color: #333;\n font-size: 0.48rem;\n padding: 0.8rem 0 0.37333rem;\n text-align: center;\n}\n.pica-h5-agreement-container .agreement-content[data-v-430a9a0e] {\n color: #676869;\n font-size: 0.37333rem;\n padding: 0 0.8rem 0.21333rem;\n line-height: 0.56rem;\n}\n.pica-h5-agreement-container .agreement-content span[data-v-430a9a0e] {\n color: #449284;\n text-decoration: underline;\n}\n.pica-h5-agreement-container .agreement-btn[data-v-430a9a0e] {\n color: #449284;\n font-size: 0.45333rem;\n text-align: center;\n padding: 0.32rem 0;\n border: 1PX solid #F0F1F2;\n}\n";
styleInject(css);
function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier
......@@ -176,7 +180,7 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
} // Vue.extend constructor export interop.
const options = typeof script === 'function' ? script.options : script; // render functions
var options = typeof script === 'function' ? script.options : script; // render functions
if (template && template.render) {
options.render = template.render;
......@@ -193,11 +197,11 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
options._scopeId = scopeId;
}
let hook;
var hook;
if (moduleIdentifier) {
// server build
hook = function (context) {
hook = function hook(context) {
// 2.3 injection
context = context || // cached call
this.$vnode && this.$vnode.ssrContext || // stateful
......@@ -223,8 +227,8 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
options._ssrRegister = hook;
} else if (style) {
hook = shadowMode ? function (context) {
style.call(this, createInjectorShadow(context, this.$root.$options.shadowRoot));
hook = shadowMode ? function () {
style.call(this, createInjectorShadow(this.$root.$options.shadowRoot));
} : function (context) {
style.call(this, createInjector(context));
};
......@@ -233,7 +237,7 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
if (hook) {
if (options.functional) {
// register for functional component in vue file
const originalRender = options.render;
var originalRender = options.render;
options.render = function renderWithStyleInjection(h, context) {
hook.call(context);
......@@ -241,7 +245,7 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
};
} else {
// inject component registration as beforeCreate hook
const existing = options.beforeCreate;
var existing = options.beforeCreate;
options.beforeCreate = existing ? [].concat(existing, hook) : [hook];
}
}
......@@ -249,11 +253,13 @@ function normalizeComponent(template, style, script, scopeId, isFunctionalTempla
return script;
}
var normalizeComponent_1 = normalizeComponent;
/* script */
const __vue_script__ = script;
var __vue_script__ = script;
/* template */
var __vue_render__ = function () {
var __vue_render__ = function __vue_render__() {
var _vm = this;
var _h = _vm.$createElement;
......@@ -282,29 +288,29 @@ var __vue_staticRenderFns__ = [];
__vue_render__._withStripped = true;
/* style */
const __vue_inject_styles__ = undefined;
var __vue_inject_styles__ = undefined;
/* scoped */
const __vue_scope_id__ = "data-v-1c3d08a4";
var __vue_scope_id__ = "data-v-430a9a0e";
/* module identifier */
const __vue_module_identifier__ = undefined;
var __vue_module_identifier__ = undefined;
/* functional template */
const __vue_is_functional_template__ = false;
var __vue_is_functional_template__ = false;
/* style inject */
/* style inject SSR */
/* style inject shadow dom */
var PicaH5Agreement = normalizeComponent({
var __vue_component__ = normalizeComponent_1({
render: __vue_render__,
staticRenderFns: __vue_staticRenderFns__
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
PicaH5Agreement.install = function (Vue) {
Vue.component(PicaH5Agreement.name, PicaH5Agreement);
__vue_component__.install = function (Vue) {
Vue.component(__vue_component__.name, __vue_component__);
};
module.exports = PicaH5Agreement;
module.exports = __vue_component__;
{
"name": "pica-h5-agreement",
"version": "1.0.4",
"version": "1.0.6",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......@@ -930,9 +930,9 @@
}
},
"@vue/component-compiler": {
"version": "4.1.0",
"resolved": "http://192.168.110.93:4873/@vue%2fcomponent-compiler/-/component-compiler-4.1.0.tgz",
"integrity": "sha512-20S7mm7CYP94m2Morw2ftz1tqoBu1nX7KYiqo5rlgKPZ0dlY7VZX7wAL/etN3s4HD0PBeenr1pUUCBIgGSaB2g==",
"version": "4.2.0",
"resolved": "http://192.168.110.93:4873/@vue%2fcomponent-compiler/-/component-compiler-4.2.0.tgz",
"integrity": "sha512-bxFNxUpKzLfHDoGTsAe2w7gEz4OwII7tp5m7sAXES1DApbpYglH4YSpYxdZRZ4GN/wj2fPD0u72QRJXd4UPvFQ==",
"dev": true,
"requires": {
"@vue/component-compiler-utils": "^3.0.0",
......@@ -6110,12 +6110,12 @@
}
},
"rollup-plugin-vue": {
"version": "5.1.1",
"resolved": "http://192.168.110.93:4873/rollup-plugin-vue/-/rollup-plugin-vue-5.1.1.tgz",
"integrity": "sha512-lSIiiaNfwOWpbAN7Z1ZQzY0WUIa6+6cVopZrICBlrSKqGpmlkHm2+cgCtv1PsY5EkR0ZasHoeNNQn5b2B8HvkA==",
"version": "5.0.0",
"resolved": "http://192.168.110.93:4873/rollup-plugin-vue/-/rollup-plugin-vue-5.0.0.tgz",
"integrity": "sha1-nGDTIkzXsK0bGpIiWCZiyCKrj4U=",
"dev": true,
"requires": {
"@vue/component-compiler": "^4.1.0",
"@vue/component-compiler": "^4.0.0",
"@vue/component-compiler-utils": "^3.0.0",
"debug": "^4.1.1",
"hash-sum": "^1.0.2",
......@@ -6123,7 +6123,7 @@
"querystring": "^0.2.0",
"rollup-pluginutils": "^2.4.1",
"source-map": "0.7.3",
"vue-runtime-helpers": "^1.1.1"
"vue-runtime-helpers": "1.0.0"
},
"dependencies": {
"debug": {
......@@ -6178,9 +6178,9 @@
"optional": true
},
"sass": {
"version": "1.23.3",
"resolved": "http://192.168.110.93:4873/sass/-/sass-1.23.3.tgz",
"integrity": "sha512-1DKRZxJMOh4Bme16AbWTyYeJAjTlrvw2+fWshHHaepeJfGq2soFZTnt0YhWit+bohtDu4LdyPoEj6VFD4APHog==",
"version": "1.23.7",
"resolved": "http://192.168.110.93:4873/sass/-/sass-1.23.7.tgz",
"integrity": "sha512-cYgc0fanwIpi0rXisGxl+/wadVQ/HX3RhpdRcjLdj2o2ye/sxUTpAxIhbmJy3PLQgRFbf6Pn8Jsrta2vdXcoOQ==",
"dev": true,
"optional": true,
"requires": {
......@@ -6951,9 +6951,9 @@
"dev": true
},
"vue-runtime-helpers": {
"version": "1.1.2",
"resolved": "http://192.168.110.93:4873/vue-runtime-helpers/-/vue-runtime-helpers-1.1.2.tgz",
"integrity": "sha512-pZfGp+PW/IXEOyETE09xQHR1CKkR9HfHZdnMD/FVLUNI+HxYTa82evx5WrF6Kz4s82qtqHvMZ8MZpbk2zT2E1Q==",
"version": "1.0.0",
"resolved": "http://192.168.110.93:4873/vue-runtime-helpers/-/vue-runtime-helpers-1.0.0.tgz",
"integrity": "sha512-DgwCNgIXkq1GJsWwtFOjA/K2nxpjyon/QqAut0EiwrMHBatAPbfdqksDdRoK15b5YrSJRa59rx3pc0L6V4udUA==",
"dev": true
},
"vue-template-compiler": {
......
{
"name": "pica-h5-agreement",
"version": "1.0.6",
"version": "1.0.9",
"description": "vue h5 agreement component",
"author": "pica",
"private": false,
......@@ -43,7 +43,7 @@
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-terser": "^4.0.1",
"rollup-plugin-url": "^2.2.1",
"rollup-plugin-vue": "^5.1.1",
"rollup-plugin-vue": "^5.0.0",
"vue": "^2.5.17",
"vue-template-compiler": "^2.5.17"
},
......
......@@ -9,6 +9,7 @@ import pxtorem from 'postcss-pxtorem';
import postcss from 'rollup-plugin-postcss';
import url from 'postcss-url';
import purl from "rollup-plugin-url"
import json from 'rollup-plugin-json';
export default {
input: './index.js',
......@@ -45,10 +46,12 @@ export default {
}),
babel({
runtimeHelpers: true,
// sourceMap: false,
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue']
sourceMap: false,
extensions: ['.js', '.jsx', '.es6', '.es', '.mjs', '.vue'],
exclude: 'node_modules/**' // 只编译我们的源代码
}),
resolve(),
commonjs()
commonjs(),
json()
]
};
\ No newline at end of file
......@@ -54,7 +54,7 @@ export default {
})
},
gotoAgreement() { //https://dev-scale.yunqueyi.com
window.location.href = `${this.agreementPageUrl}/loginAgreement?token=${this.agreementToken}&pageUrl=${window.location.href}`;
window.location.href = `${this.agreementPageUrl}/loginAgreement?agreementToken=${this.agreementToken}&pageUrl=${window.location.href}`;
}
}
}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册