Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

hyapp-template

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyapp-template - npm Package Compare versions

Comparing version 1.0.9 to 1.1.1

8

package.json
{
"name": "hyapp-template",
"version": "v1.0.9",
"version": "v1.1.1",
"description": "mvvm",

@@ -8,8 +8,4 @@ "author": "yangbin <yangb@2345.com>",

"dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
"start": "npm run dev",
"server": "webpack-dev-server --inline --progress --host 172.17.106.33 --config build/webpack.dev.conf.js",
"skeleton": "webpack --config build/webpack.skeleton.conf.js && node skeleton.js",
"unit": "jest --config test/unit/jest.conf.js --coverage",
"e2e": "node test/e2e/runner.js",
"test": "npm run unit && npm run e2e",
"lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
"build": "node build/build.js"

@@ -16,0 +12,0 @@ },

import axios from 'axios'
// import qs from 'qs'
import qs from 'qs'

@@ -34,4 +34,13 @@ // axios全局配置

} else {
config.headers['Content-Type'] = 'application/json'
config.headers['Content-Type'] = config.headers['Content-Type'] || 'application/json'
}
config.headers.token = '3AD17D3EFF1EAD2E24B61753C0D5127F85005DD945F66A3F4614D0BD699FA7DF'
config.headers.terminalId = '1'
// 产品id 立即贷写死是10002
config.headers.pid = '10002'
config.headers.terminalType = 'ljd_3rd'
config.headers.os = window.vm.$tools.getBrowser() === 'iOS' ? 'ios' : 'android'
// version 和 channel 字段需要找产品确认
config.headers.channel = 'test_channel'
config.headers.version = '9.2.1'
if (isApp) { // 移动端

@@ -44,2 +53,4 @@ return reqInterceptor(config).then(rst => {

config.data = config.data.form
} else if (config.headers['Content-Type'] === 'application/x-www-form-urlencoded') {
config.data = qs.stringify(config.data)
}

@@ -63,8 +74,8 @@ return config

axios.interceptors.response.use(function (rst) {
if (rst.data.respCode === '1000') {
return Promise.resolve(rst.data)
} else if (rst.data.respCode === '1008') { // 1008:未登录
window.vm.$appInvoked('appTokenInvalid', {message: rst.data.respMsg})
return Promise.reject(rst.data)
} else if (rst.data.respCode === '1001') { // 1001:失败!
if (rst.data.code === 'success') {
return Promise.resolve(rst.data.result)
} else if (rst.data.code === 'uc_user_007') { // 1008:未登录
window.vm.$appInvoked('appTokenInvalid', {message: rst.data.error.message})
return Promise.reject(rst.data.error.message)
} else if (rst.data.code === '"SYS_ERR_0001"') { // 1001:系统异常!
let timestamp2 = Date.parse(new Date())

@@ -71,0 +82,0 @@ let url = rst.request.responseURL

@@ -79,7 +79,4 @@ // The Vue build version to load with the `import` command

// 添加版本信息
let vData = new Date()
let m = (vData.getMonth() + 1) + ''
let d = vData.getDate() + ''
console.log('版本号:', VERSION + '_' + (m.length === 1 ? ('0' + m) : m) + '' + (d.length === 1 ? ('0' + d) : d))
// 添加版本信息 VERSION => 取package.json 'version'字段
console.log('版本号:', VERSION)
}
import Vue from 'vue'
import Router from 'vue-router'
import HomeIndex from '@/pages/home/index'
const HomeIndex = resolve => require(['@/pages/home/index'], resolve)

@@ -5,0 +5,0 @@ Vue.use(Router)

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc